1. Introduction to Technical Analysis

30 minbeginner

1. Introduction to Technical Analysis

What is Technical Analysis?

Technical analysis is a method of evaluating securities by analyzing statistics generated by market activity, such as past prices and volume. Unlike fundamental analysis, which attempts to measure a security's intrinsic value by examining financial statements and economic factors, technical analysis focuses on the study of price action and market behavior. Technical analysts believe that all relevant information about a security is already reflected in its price, and that analyzing price patterns and trends can help predict future price movements.

Technical Analysis: A trading discipline employed to evaluate investments and identify trading opportunities by analyzing statistical trends gathered from trading activity, such as price movement and volume. Technical analysis assumes that market prices reflect all available information and that price movements follow patterns that can be identified and exploited.

The fundamental premise of technical analysis is that price action reflects the collective psychology of all market participants. When buyers and sellers interact in the market, their actions create patterns that technical analysts can identify and use to make trading decisions. These patterns repeat because human psychology - fear, greed, hope, and regret - tends to be consistent across time and markets.

Technical analysis is used by traders, investors, and portfolio managers across all asset classes - stocks, bonds, commodities, currencies, and derivatives. While it's often associated with short-term trading, technical analysis principles can also be applied to longer-term investment decisions. The key is understanding which tools and techniques are appropriate for different timeframes and market conditions.

The Philosophy of Technical Analysis

Technical analysis is built on several core philosophical principles that distinguish it from other approaches to market analysis. Understanding these principles is essential for applying technical analysis effectively and recognizing its strengths and limitations.

The first principle is that the market discounts everything. This means that all available information - earnings reports, economic data, news events, investor sentiment, and even future expectations - is already reflected in the current price. Technical analysts don't need to analyze why a stock is moving; they simply need to analyze how it's moving. This principle frees technical analysts from the need to process vast amounts of fundamental information and allows them to focus solely on price action.

The following visualization illustrates how the market discounts information - notice how price movements anticipate and react to news events, with all information eventually reflected in the price action:

Python exercise

#| label: fig-market-discounts-everything
#| fig-cap: "The Market Discounts Everything: Enhanced Analysis - Price, Volume, and Information Absorption"
#| fig-width: 18
#| fig-height: 12

# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas

import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
from datetime import datetime, timedelta
from IPython.display import display

# Generate price data showing how market discounts information
np.random.seed(101)
dates = [datetime(2024, 1, 1) + timedelta(days=i) for i in range(60)]
base_price = 100
prices = [base_price]

# Create scenario: Stock with various information events
for i in range(59):
    if i < 10:
        # Normal trading
        change = np.random.normal(0, 0.5)
    elif i < 15:
        # Earnings announcement approaching - price starts moving up (anticipation)
        change = 0.3 + np.random.normal(0, 0.4)
    elif i == 15:
        # Earnings beat announced - sharp jump
        change = 5 + np.random.normal(0, 0.5)
    elif i < 20:
        # Post-earnings consolidation
        change = -0.1 + np.random.normal(0, 0.3)
    elif i < 30:
        # Normal trading
        change = np.random.normal(0, 0.4)
    elif i < 35:
        # Negative news rumor - price starts declining (discounting)
        change = -0.4 + np.random.normal(0, 0.3)
    elif i == 35:
        # Bad news confirmed - sharp drop
        change = -4 + np.random.normal(0, 0.5)
    elif i < 45:
        # Recovery phase
        change = 0.2 + np.random.normal(0, 0.3)
    else:
        # Normal trading - all information absorbed
        change = np.random.normal(0, 0.4)
    
    prices.append(max(prices[-1] + change, 80))

# Generate OHLC data
opens = [prices[i] + np.random.normal(0, 0.2) for i in range(59)]
closes = prices[1:]
highs = [max(o, c) + abs(np.random.normal(0, 0.5)) for o, c in zip(opens, closes)]
lows = [min(o, c) - abs(np.random.normal(0, 0.5)) for o, c in zip(opens, closes)]

# Generate volume data (higher volume on news events)
volumes = []
base_volume = 1000000
for i in range(59):
    if i < 10:
        volumes.append(base_volume + np.random.normal(0, 100000))
    elif i < 15:
        # Anticipation - increasing volume
        volumes.append(base_volume * (1.2 + (i-10)/10) + np.random.normal(0, 150000))
    elif i == 15:
        # Earnings announcement - very high volume
        volumes.append(base_volume * 3.5 + np.random.normal(0, 200000))
    elif i < 20:
        volumes.append(base_volume * 1.5 + np.random.normal(0, 120000))
    elif i < 30:
        volumes.append(base_volume + np.random.normal(0, 100000))
    elif i < 35:
        # Negative news rumor - increasing volume
        volumes.append(base_volume * (1.2 + (i-30)/10) + np.random.normal(0, 150000))
    elif i == 35:
        # Bad news - very high volume
        volumes.append(base_volume * 3.8 + np.random.normal(0, 200000))
    elif i < 45:
        volumes.append(base_volume * 1.3 + np.random.normal(0, 120000))
    else:
        volumes.append(base_volume + np.random.normal(0, 100000))

# Calculate price changes
price_changes = [closes[i] - opens[i] for i in range(len(closes))]

# Create 4-panel figure
fig = plt.figure(figsize=(18, 12))
gs = fig.add_gridspec(3, 2, hspace=0.3, wspace=0.3, height_ratios=[2, 1, 1])
fig.suptitle('The Market Discounts Everything: Enhanced Analysis - Price, Volume, and Information Absorption', 
             fontsize=17, fontweight='bold', y=0.98)

dates_plot = dates[1:]

# Panel 1: Price Action with Candlesticks
ax1 = fig.add_subplot(gs[0, :])
for i in range(len(opens)):
    date = dates_plot[i]
    open_price = opens[i]
    close_price = closes[i]
    high_price = highs[i]
    low_price = lows[i]
    
    color = '#2ecc71' if close_price >= open_price else '#e74c3c'
    body_low = min(open_price, close_price)
    body_high = max(open_price, close_price)
    body_height = body_high - body_low
    
    # Draw wick
    ax1.plot([date, date], [low_price, high_price], color='black', linewidth=0.8, alpha=0.6)
    # Draw body
    if body_height > 0:
        rect = plt.Rectangle((mdates.date2num(date) - 0.3, body_low), 0.6, body_height, 
                            facecolor=color, edgecolor='black', linewidth=0.5, alpha=0.8)
        ax1.add_patch(rect)
    else:
        ax1.plot([date, date], [open_price, close_price], color='black', linewidth=2)

# Annotate key events
ax1.axvspan(mdates.date2num(dates_plot[10]), mdates.date2num(dates_plot[15]), 
            alpha=0.15, color='yellow', label='Earnings Anticipation')
ax1.annotate('Earnings Beat\nAnnounced', 
            xy=(mdates.date2num(dates_plot[15]), closes[15]),
            xytext=(mdates.date2num(dates_plot[15]), closes[15] + 4),
            arrowprops=dict(arrowstyle='->', color='green', lw=2.5),
            fontsize=11, fontweight='bold', color='green',
            bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.9))

ax1.axvspan(mdates.date2num(dates_plot[30]), mdates.date2num(dates_plot[35]), 
            alpha=0.15, color='orange', label='Negative News Rumor')
ax1.annotate('Bad News\nConfirmed', 
            xy=(mdates.date2num(dates_plot[35]), closes[35]),
            xytext=(mdates.date2num(dates_plot[35]), closes[35] - 5),
            arrowprops=dict(arrowstyle='->', color='red', lw=2.5),
            fontsize=11, fontweight='bold', color='red',
            bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.9))

ax1.axvspan(mdates.date2num(dates_plot[45]), mdates.date2num(dates_plot[-1]), 
            alpha=0.1, color='blue', label='All Information Absorbed')

# Add EMA(20) for trend
ema_period = 20
ema_values = []
for i in range(len(closes)):
    if i < ema_period - 1:
        ema_values.append(None)
    else:
        ema = np.mean(closes[i-ema_period+1:i+1])
        ema_values.append(ema)
ema_dates = dates_plot[ema_period-1:]
ema_plot = [v for v in ema_values if v is not None]
ax1.plot(ema_dates, ema_plot, color='blue', linewidth=2, linestyle='--', alpha=0.7, label='EMA(20)')

ax1.set_ylabel('Price ($)', fontsize=12, fontweight='bold')
ax1.set_title('Panel 1: Price Action - Notice Price Moves Before News (Anticipation)', 
              fontsize=13, fontweight='bold')
ax1.legend(loc='upper left', fontsize=10)
ax1.grid(True, alpha=0.3, linestyle='--')
ax1.xaxis.set_major_formatter(mdates.DateFormatter('%b %d'))

# Panel 2: Volume Analysis
ax2 = fig.add_subplot(gs[1, 0])
ax2.bar([mdates.date2num(d) for d in dates_plot], volumes, width=0.8, 
        color=['#2ecc71' if c > o else '#e74c3c' for o, c in zip(opens, closes)], 
        alpha=0.6, edgecolor='black', linewidth=0.5)
ax2.axvline(mdates.date2num(dates_plot[15]), color='green', linestyle='--', linewidth=2, alpha=0.7, label='Earnings')
ax2.axvline(mdates.date2num(dates_plot[35]), color='red', linestyle='--', linewidth=2, alpha=0.7, label='Bad News')
ax2.set_ylabel('Volume', fontsize=11, fontweight='bold')
ax2.set_title('Panel 2: Volume Confirms Price Movements', fontsize=12, fontweight='bold')
ax2.legend(loc='upper left', fontsize=9)
ax2.grid(True, alpha=0.3, linestyle='--')
ax2.xaxis.set_major_formatter(mdates.DateFormatter('%b %d'))

# Panel 3: Price Change Analysis (Anticipation vs Confirmation)
ax3 = fig.add_subplot(gs[1, 1])
ax3.bar(range(len(price_changes)), price_changes, 
        color=['#2ecc71' if ch > 0 else '#e74c3c' for ch in price_changes], 
        alpha=0.7, edgecolor='black', linewidth=0.5)
ax3.axhline(y=0, color='black', linewidth=1, linestyle='-')
ax3.axvline(x=15, color='green', linestyle='--', linewidth=2, alpha=0.7)
ax3.axvline(x=35, color='red', linestyle='--', linewidth=2, alpha=0.7)
ax3.fill_between(range(10, 15), -10, 10, alpha=0.2, color='yellow', label='Anticipation')
ax3.fill_between(range(30, 35), -10, 10, alpha=0.2, color='orange', label='Anticipation')
ax3.set_xlabel('Days', fontsize=11, fontweight='bold')
ax3.set_ylabel('Daily Price Change ($)', fontsize=11, fontweight='bold')
ax3.set_title('Panel 3: Price Changes - Anticipation Before News Events', fontsize=12, fontweight='bold')
ax3.legend(loc='upper right', fontsize=9)
ax3.grid(True, alpha=0.3, linestyle='--')

# Panel 4: Information Absorption Timeline
ax4 = fig.add_subplot(gs[2, :])
events = [
    ('Day 10-15', 'Earnings\nAnticipation', 'yellow', 12.5, 0.8),
    ('Day 15', 'Earnings\nBeat', 'green', 15, 1.0),
    ('Day 20-30', 'Normal Trading', 'gray', 25, 0.5),
    ('Day 30-35', 'Negative\nNews Rumor', 'orange', 32.5, 0.8),
    ('Day 35', 'Bad News\nConfirmed', 'red', 35, 1.0),
    ('Day 45+', 'All Info\nAbsorbed', 'blue', 52, 0.6)
]
event_positions = [e[3] for e in events]
event_names = [e[1] for e in events]
event_colors = [e[2] for e in events]
event_heights = [e[4] for e in events]

for i, (pos, name, color, height) in enumerate(zip(event_positions, event_names, event_colors, event_heights)):
    ax4.barh(0, height, left=pos-height/2, height=0.4, color=color, alpha=0.7, 
             edgecolor='black', linewidth=1.5)
    ax4.text(pos, 0, name, ha='center', va='center', fontsize=10, fontweight='bold')

# Add arrows showing information flow
ax4.annotate('', xy=(15, 0), xytext=(10, 0.3), 
            arrowprops=dict(arrowstyle='->', color='green', lw=2))
ax4.annotate('', xy=(35, 0), xytext=(30, 0.3), 
            arrowprops=dict(arrowstyle='->', color='red', lw=2))

ax4.set_xlim(0, 60)
ax4.set_ylim(-0.5, 0.5)
ax4.set_xlabel('Days', fontsize=11, fontweight='bold')
ax4.set_title('Panel 4: Information Timeline - Market Discounts Information Over Time', 
              fontsize=12, fontweight='bold')
ax4.set_yticks([])
ax4.grid(True, alpha=0.3, axis='x')

plt.tight_layout()
display(fig)
plt.close(fig)

This visualization demonstrates the core principle that the market discounts everything. Notice how:

  • Price anticipates news: Before the earnings announcement (day 15), price begins moving up in anticipation
  • Price reacts to confirmation: When news is confirmed, price moves sharply
  • Price absorbs all information: Eventually, all information is reflected in the price, and trading returns to normal
  • Technical analysts don't need to know why: The price action itself tells the story

The second principle is that price moves in trends. Technical analysts believe that once a trend is established, it's more likely to continue than to reverse. This is based on the observation that market psychology tends to persist - if investors are bullish, they typically remain bullish until something changes their sentiment. This principle underlies most trend-following strategies, which seek to identify and ride existing trends rather than predict reversals.

The following visualization demonstrates the three types of trends - uptrends, downtrends, and sideways trends - and how they persist until evidence of reversal appears:

Python exercise

#| label: fig-price-moves-in-trends
#| fig-cap: "Price Moves in Trends: Enhanced Analysis - Trend Types, Strength, and Persistence"
#| fig-width: 18
#| fig-height: 12

# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas

import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
from datetime import datetime, timedelta
from IPython.display import display
from scipy import stats

# Generate three trend scenarios
np.random.seed(102)
dates = [datetime(2024, 1, 1) + timedelta(days=i) for i in range(90)]

# Scenario 1: Uptrend (higher highs, higher lows)
uptrend_prices = [100]
for i in range(89):
    # Create higher highs and higher lows
    base_change = 0.3 + (i / 89) * 0.2  # Increasing trend strength
    change = base_change + np.random.normal(0, 0.8)
    uptrend_prices.append(max(uptrend_prices[-1] + change, uptrend_prices[-1] * 0.99))

# Scenario 2: Downtrend (lower highs, lower lows)
downtrend_prices = [120]
for i in range(89):
    # Create lower highs and lower lows
    base_change = -0.3 - (i / 89) * 0.2  # Increasing trend strength
    change = base_change + np.random.normal(0, 0.8)
    downtrend_prices.append(min(downtrend_prices[-1] + change, downtrend_prices[-1] * 1.01))

# Scenario 3: Sideways trend (range-bound)
sideways_prices = [110]
for i in range(89):
    # Oscillate within range
    oscillation = np.sin(i * np.pi / 15) * 2
    change = oscillation + np.random.normal(0, 0.5)
    sideways_prices.append(max(min(sideways_prices[-1] + change, 115), 105))

# Calculate trend strength metrics (slope using linear regression)
def calculate_trend_strength(prices):
    x = np.arange(len(prices))
    slope, intercept, r_value, p_value, std_err = stats.linregress(x, prices)
    return slope, r_value**2  # R-squared indicates trend strength

uptrend_slope, uptrend_r2 = calculate_trend_strength(uptrend_prices)
downtrend_slope, downtrend_r2 = calculate_trend_strength(downtrend_prices)
sideways_slope, sideways_r2 = calculate_trend_strength(sideways_prices)

# Generate OHLC data for uptrend
uptrend_opens = [uptrend_prices[i] + np.random.normal(0, 0.3) for i in range(89)]
uptrend_closes = uptrend_prices[1:]
uptrend_highs = [max(o, c) + abs(np.random.normal(0, 0.6)) for o, c in zip(uptrend_opens, uptrend_closes)]
uptrend_lows = [min(o, c) - abs(np.random.normal(0, 0.6)) for o, c in zip(uptrend_opens, uptrend_closes)]

# Generate OHLC data for downtrend
downtrend_opens = [downtrend_prices[i] + np.random.normal(0, 0.3) for i in range(89)]
downtrend_closes = downtrend_prices[1:]
downtrend_highs = [max(o, c) + abs(np.random.normal(0, 0.6)) for o, c in zip(downtrend_opens, downtrend_closes)]
downtrend_lows = [min(o, c) - abs(np.random.normal(0, 0.6)) for o, c in zip(downtrend_opens, downtrend_closes)]

# Generate OHLC data for sideways
sideways_opens = [sideways_prices[i] + np.random.normal(0, 0.3) for i in range(89)]
sideways_closes = sideways_prices[1:]
sideways_highs = [max(o, c) + abs(np.random.normal(0, 0.6)) for o, c in zip(sideways_opens, sideways_closes)]
sideways_lows = [min(o, c) - abs(np.random.normal(0, 0.6)) for o, c in zip(sideways_opens, sideways_closes)]

# Helper function to plot candlesticks
def plot_candlesticks(ax, dates_plot, opens, closes, highs, lows):
    for i in range(len(opens)):
        date = dates_plot[i]
        open_price = opens[i]
        close_price = closes[i]
        high_price = highs[i]
        low_price = lows[i]
        
        color = '#2ecc71' if close_price >= open_price else '#e74c3c'
        body_low = min(open_price, close_price)
        body_high = max(open_price, close_price)
        body_height = body_high - body_low
        
        # Draw wick
        ax.plot([date, date], [low_price, high_price], color='black', linewidth=0.8, alpha=0.6)
        # Draw body
        if body_height > 0:
            rect = plt.Rectangle((mdates.date2num(date) - 0.3, body_low), 0.6, body_height, 
                                facecolor=color, edgecolor='black', linewidth=0.5, alpha=0.8)
            ax.add_patch(rect)
        else:
            ax.plot([date, date], [open_price, close_price], color='black', linewidth=2)

# Create 4-panel figure
fig = plt.figure(figsize=(18, 12))
gs = fig.add_gridspec(2, 2, hspace=0.35, wspace=0.3)
fig.suptitle('Price Moves in Trends: Enhanced Analysis - Trend Types, Strength, and Persistence', 
             fontsize=17, fontweight='bold', y=0.98)

dates_plot = dates[1:]

# Panel 1: Uptrend with Trendline and Moving Average
ax1 = fig.add_subplot(gs[0, 0])
plot_candlesticks(ax1, dates_plot, uptrend_opens, uptrend_closes, uptrend_highs, uptrend_lows)

# Add EMA(20)
ema_period = 20
ema_uptrend = []
for i in range(len(uptrend_closes)):
    if i < ema_period - 1:
        ema_uptrend.append(None)
    else:
        ema = np.mean(uptrend_closes[i-ema_period+1:i+1])
        ema_uptrend.append(ema)
ema_dates = dates_plot[ema_period-1:]
ema_plot_vals = [v for v in ema_uptrend if v is not None]
ax1.plot(ema_dates, ema_plot_vals, color='blue', linewidth=2.5, linestyle='--', 
         alpha=0.8, label=f'EMA(20) - Trend Strength: {uptrend_r2:.2%}')

# Draw support trendline
first_low_idx = 5
last_low_idx = len(uptrend_lows) - 5
ax1.plot([dates_plot[first_low_idx], dates_plot[last_low_idx]], 
        [uptrend_lows[first_low_idx], uptrend_lows[last_low_idx]],
        color='green', linestyle='--', linewidth=2.5, alpha=0.8, label='Support Trendline')

ax1.set_title('Panel 1: Uptrend - Higher Highs & Higher Lows', fontsize=13, fontweight='bold')
ax1.set_ylabel('Price ($)', fontsize=11, fontweight='bold')
ax1.legend(loc='upper left', fontsize=9)
ax1.grid(True, alpha=0.3, linestyle='--')
ax1.xaxis.set_major_formatter(mdates.DateFormatter('%b %d'))

# Panel 2: Downtrend with Trendline
ax2 = fig.add_subplot(gs[0, 1])
plot_candlesticks(ax2, dates_plot, downtrend_opens, downtrend_closes, downtrend_highs, downtrend_lows)

# Add EMA(20)
ema_downtrend = []
for i in range(len(downtrend_closes)):
    if i < ema_period - 1:
        ema_downtrend.append(None)
    else:
        ema = np.mean(downtrend_closes[i-ema_period+1:i+1])
        ema_downtrend.append(ema)
ema_plot_vals2 = [v for v in ema_downtrend if v is not None]
ax2.plot(ema_dates, ema_plot_vals2, color='blue', linewidth=2.5, linestyle='--', 
         alpha=0.8, label=f'EMA(20) - Trend Strength: {downtrend_r2:.2%}')

# Draw resistance trendline
first_high_idx = 5
last_high_idx = len(downtrend_highs) - 5
ax2.plot([dates_plot[first_high_idx], dates_plot[last_high_idx]], 
        [downtrend_highs[first_high_idx], downtrend_highs[last_high_idx]],
        color='red', linestyle='--', linewidth=2.5, alpha=0.8, label='Resistance Trendline')

ax2.set_title('Panel 2: Downtrend - Lower Highs & Lower Lows', fontsize=13, fontweight='bold')
ax2.set_ylabel('Price ($)', fontsize=11, fontweight='bold')
ax2.legend(loc='upper right', fontsize=9)
ax2.grid(True, alpha=0.3, linestyle='--')
ax2.xaxis.set_major_formatter(mdates.DateFormatter('%b %d'))

# Panel 3: Sideways Trend with Support/Resistance
ax3 = fig.add_subplot(gs[1, 0])
plot_candlesticks(ax3, dates_plot, sideways_opens, sideways_closes, sideways_highs, sideways_lows)

# Draw support and resistance levels
ax3.axhline(y=115, color='red', linestyle='--', linewidth=2.5, alpha=0.8, label='Resistance at $115')
ax3.axhline(y=105, color='green', linestyle='--', linewidth=2.5, alpha=0.8, label='Support at $105')
ax3.axhspan(105, 115, alpha=0.15, color='blue', label='Trading Range')

# Add EMA(20) to show it's flat
ema_sideways = []
for i in range(len(sideways_closes)):
    if i < ema_period - 1:
        ema_sideways.append(None)
    else:
        ema = np.mean(sideways_closes[i-ema_period+1:i+1])
        ema_sideways.append(ema)
ema_plot_vals3 = [v for v in ema_sideways if v is not None]
ax3.plot(ema_dates, ema_plot_vals3, color='blue', linewidth=2.5, linestyle='--', 
         alpha=0.8, label=f'EMA(20) - Range-Bound (R²={sideways_r2:.2%})')

ax3.set_title('Panel 3: Sideways Trend - Range-Bound Trading', fontsize=13, fontweight='bold')
ax3.set_xlabel('Date', fontsize=11, fontweight='bold')
ax3.set_ylabel('Price ($)', fontsize=11, fontweight='bold')
ax3.legend(loc='upper left', fontsize=9)
ax3.grid(True, alpha=0.3, linestyle='--')
ax3.xaxis.set_major_formatter(mdates.DateFormatter('%b %d'))

# Panel 4: Trend Strength Comparison
ax4 = fig.add_subplot(gs[1, 1])
trend_names = ['Uptrend', 'Downtrend', 'Sideways']
trend_slopes = [uptrend_slope, downtrend_slope, abs(sideways_slope)]
trend_r2_values = [uptrend_r2, downtrend_r2, sideways_r2]
colors = ['#2ecc71', '#e74c3c', '#3498db']

bars1 = ax4.bar([x - 0.2 for x in range(3)], trend_slopes, 0.4, label='Slope (Price Change/Day)', 
                color=colors, alpha=0.7, edgecolor='black', linewidth=1.5)
bars2 = ax4.bar([x + 0.2 for x in range(3)], [r*100 for r in trend_r2_values], 0.4, 
                label='R² (Trend Strength %)', color=[c for c in colors], alpha=0.5, 
                edgecolor='black', linewidth=1.5)

# Add value labels on bars
for i, (bar1, bar2, slope, r2) in enumerate(zip(bars1, bars2, trend_slopes, trend_r2_values)):
    ax4.text(bar1.get_x() + bar1.get_width()/2, bar1.get_height() + 0.01,
            f'{slope:.3f}', ha='center', va='bottom', fontsize=9, fontweight='bold')
    ax4.text(bar2.get_x() + bar2.get_width()/2, bar2.get_height() + 1,
            f'{r2*100:.1f}%', ha='center', va='bottom', fontsize=9, fontweight='bold')

ax4.set_xlabel('Trend Type', fontsize=11, fontweight='bold')
ax4.set_ylabel('Value', fontsize=11, fontweight='bold')
ax4.set_title('Panel 4: Trend Strength Metrics - Slope & R² Comparison', fontsize=13, fontweight='bold')
ax4.set_xticks(range(3))
ax4.set_xticklabels(trend_names, fontsize=10, fontweight='bold')
ax4.legend(loc='upper right', fontsize=9)
ax4.grid(True, alpha=0.3, linestyle='--', axis='y')

plt.tight_layout()
display(fig)
plt.close(fig)

This visualization demonstrates the three fundamental trend types:

  • Uptrend: Characterized by higher highs and higher lows, with a rising support trendline
  • Downtrend: Characterized by lower highs and lower lows, with a declining resistance trendline
  • Sideways Trend: Price oscillates within a defined range, with clear support and resistance levels

Notice how trends persist - once established, they continue until evidence of reversal appears, which is why trend-following strategies seek to ride existing trends rather than predict reversals.

The third principle is that history tends to repeat itself. Technical analysts believe that price patterns that have worked in the past will work in the future, because human psychology - which drives these patterns - doesn't change. This principle justifies the use of chart patterns and technical indicators that are based on historical price behavior. However, it's important to recognize that while patterns may be similar, they're never identical, and market conditions can change.

Technical Analysis vs. Fundamental Analysis

Technical analysis and fundamental analysis represent two distinct approaches to evaluating securities, each with different philosophies, methods, and timeframes. Understanding the differences between them helps you choose the appropriate approach for your investment style and objectives.

Fundamental Analysis focuses on determining a security's intrinsic value by examining financial statements, economic factors, industry conditions, and company management. Fundamental analysts believe that markets can misprice securities in the short run, but will eventually correct to reflect true value. They seek to buy undervalued securities and sell overvalued ones. Fundamental analysis is typically used for longer-term investment decisions, as it can take time for markets to recognize and correct pricing errors.

Technical Analysis focuses on analyzing price action and market behavior, assuming that all information is already reflected in the price. Technical analysts believe that price patterns and trends can predict future movements, regardless of fundamental factors. They seek to identify entry and exit points based on price action, volume, and technical indicators. Technical analysis is typically used for shorter-term trading decisions, as it focuses on timing rather than long-term value.

The two approaches are not mutually exclusive - many successful traders and investors combine both. For example, a fundamental analyst might use technical analysis to time entry into a fundamentally attractive stock, or a technical analyst might use fundamental analysis to filter out fundamentally weak stocks from consideration. The key is understanding when each approach is most appropriate and how to integrate them effectively.

Key Assumptions of Technical Analysis

Technical analysis is based on several key assumptions that, if accepted, justify the use of technical analysis methods. These assumptions are not universally accepted, and understanding them helps you recognize both the strengths and limitations of technical analysis.

Assumption 1: Market Prices Reflect All Available Information

This is the "efficient market" assumption in a weak form. Technical analysts believe that current prices incorporate all publicly available information, including fundamental factors, news, and investor sentiment. This assumption suggests that there's no need to analyze fundamentals separately - the price already tells you everything you need to know.

Assumption 2: Price Movements Follow Trends

Technical analysts assume that prices move in trends - upward, downward, or sideways - and that these trends persist until evidence of a reversal appears. This assumption underlies trend-following strategies and the use of moving averages and trendlines.

Assumption 3: History Repeats Itself

Technical analysts assume that price patterns that have occurred in the past will recur in the future, because the human psychology that drives these patterns is consistent. This assumption justifies the use of chart patterns and technical indicators based on historical analysis.

Assumption 4: Market Psychology Influences Price Action

Technical analysts believe that market prices are driven by the collective psychology of all participants - fear, greed, hope, and regret. These psychological factors create predictable patterns that can be identified and exploited.

Assumption 5: Price Action is More Important Than Why

Technical analysts focus on what is happening (price movement) rather than why it's happening (fundamental causes). This assumption allows technical analysts to make decisions based solely on price action without needing to understand underlying fundamentals.

Limitations and Criticisms

Technical analysis has several limitations and has been subject to significant criticism from both academics and practitioners. Understanding these limitations is crucial for applying technical analysis effectively and avoiding common pitfalls.

Criticism 1: Self-Fulfilling Prophecy

Some critics argue that technical analysis works only because many traders use it, creating a self-fulfilling prophecy. If enough traders identify a support level and place buy orders there, the support level becomes real through their collective action. However, this doesn't mean the pattern has predictive power - it just means traders are responding to the pattern itself.

Criticism 2: Subjectivity

Technical analysis is often subjective - different analysts can interpret the same chart differently. A support level that's obvious to one analyst might be invisible to another. This subjectivity can lead to inconsistent results and makes it difficult to backtest technical strategies objectively.

Criticism 3: Pattern Recognition Bias

Humans are prone to see patterns in random data - a phenomenon called pareidolia. Critics argue that many technical patterns are simply random price movements that traders mistakenly interpret as meaningful patterns. This bias can lead to false signals and poor trading decisions.

Criticism 4: No Theoretical Foundation

Unlike fundamental analysis, which has a clear theoretical foundation (intrinsic value equals present value of future cash flows), technical analysis lacks a solid theoretical basis. Critics argue that without a theoretical foundation, technical analysis is nothing more than reading tea leaves.

Criticism 5: Market Efficiency

The efficient market hypothesis suggests that if technical analysis worked consistently, arbitrageurs would exploit the patterns until they disappeared. The fact that these patterns persist suggests they may not be as reliable as technical analysts claim.

Criticism 6: Look-Ahead Bias

Technical analysis often suffers from look-ahead bias - patterns that seem obvious in hindsight may not have been identifiable in real-time. This can make technical analysis appear more effective in backtesting than it is in actual trading.

Despite these criticisms, technical analysis remains widely used and has many successful practitioners. The key is understanding its limitations, using it as one tool among many, and always combining it with proper risk management.


In Module 8: Technical Analysis for Equities

  1. Introduction
  2. 1. Introduction to Technical Analysis
  3. 2. Chart Patterns
  4. 3. Candlestick Patterns
  5. 4. Technical Indicators
  6. 5. Support and Resistance
  7. 6. Trend Analysis
  8. 7. Volume Analysis
  9. Advanced Technical Analysis
  10. End-of-Module Assessment