Lesson 04: The Real Role of Technical Indicators

Core insight: Indicators are not "buy/sell signals" - they are feature engineering.


The Illusion of "Golden Cross Means Rally"

Xiao Li is a stock market newbie. He learned a "guaranteed win" rule online: Buy on MACD golden cross, sell on death cross.

He excitedly wrote a program and backtested 10 years of data. Result: 52% win rate, -8% annualized return.

"How is this possible? The golden cross is clearly a bullish signal!"

He tried RSI oversold buying, Bollinger Band lower band buying, moving average bullish alignment buying... Every "classic signal," when used alone, had win rates hovering around 50%, all losing money after fees.

What went wrong?

Xiao Li made a common mistake: treating technical indicators as buy/sell signals.

The truth is:

  1. Indicators are lagging: By the time of a MACD golden cross, the price has already risen
  2. Indicators are simplified: A single number cannot capture complex market states
  3. Indicators are exploited: When everyone watches the same signal, the signal becomes ineffective

So what are technical indicators actually useful for?

The answer: Feature engineering. Indicators aren't meant for direct trading; they're for describing market states. When you combine dozens of indicators - MACD, RSI, Bollinger Bands, etc. - as input features for machine learning models, they can truly deliver value.

This lesson's goal: Help you understand the essence of technical indicators and learn to use them correctly.


4.1 The Essence of Indicators

Indicators = Mathematical Transformations

All technical indicators are essentially mathematical transformations of price and volume:

Raw DataTransformation MethodResulting Indicator
Close price seriesMoving averageMA (Moving Average)
Close price seriesExponentially weighted averageEMA (Exponential Moving Average)
Price change seriesRelative strength calculationRSI
Price seriesMean +/- standard deviationBollinger Bands
High, Low, Close pricesMultiple calculationsMACD

Core insight: Indicators don't create new information; they just present existing information differently.

Lag is an Inherent Property

Any indicator calculated from historical data is inherently lagging:

Price has already changed
        |
    Calculate indicator
        |
   Indicator generates signal
        |
    You take action
        |
  Price may have already reversed
IndicatorTypical ParametersLag Amount
MA55-day averageAbout 2-3 days
MA2020-day averageAbout 10 days
MACD12, 26, 9About 5-10 days
RSI(14)14-dayAbout 7 days

Takeaway: Don't expect indicators to "predict" the future; they can only describe "now" and "the past."

Information Compression and Loss

Compressing hundreds of days of price data into a single number (like RSI=65) inevitably loses significant information:

  • Distribution shape of prices? Lost
  • Volume change patterns? Lost
  • Intraday volatility characteristics? Lost

This is why a single indicator cannot effectively guide trading - there's too little information.


4.2 Trend Indicators

MA / EMA: The Smoothing vs Lag Trade-off

Moving Average (MA): Simple average of the past N days' closing prices.

MA(5) = (P1 + P2 + P3 + P4 + P5) / 5

Exponential Moving Average (EMA): Gives higher weight to recent prices.

EMA = Today's price x alpha + Yesterday's EMA x (1-alpha)
where alpha = 2 / (N+1)
ComparisonMA (Simple Moving Average)EMA (Exponential Moving Average)
Weight distributionEqualHigher for recent data
Response to new dataSlowFast
SmoothnessSmootherMore sensitive
Use caseLong-term trendsShort-term trends

Core trade-off: Smaller parameters -> More sensitive -> More noise; Larger parameters -> More stable -> More lag.

MACD: Trend and Momentum

MACD is one of the most commonly used trend indicators, consisting of three parts:

DIFF (Fast line) = EMA12 - EMA26
DEA (Signal line) = EMA9(DIFF)
Histogram = 2 x (DIFF - DEA)

Platform note: Some trading platforms (especially in Asian markets like TradingView China, Tonghuashun) multiply the histogram by 2, while Western platforms typically don't. When referencing MACD values, always confirm the formula your platform uses.

Intuitive understanding:

  • DIFF: Gap between short-term and long-term trend
  • DEA: Smoothed version of DIFF
  • Histogram: Degree of trend acceleration/deceleration
MACD StateMeaningMarket Interpretation
DIFF > 0, Histogram expandingUptrend acceleratingBulls strong
DIFF > 0, Histogram shrinkingUptrend deceleratingPossible top
DIFF < 0, Histogram shrinkingDowntrend deceleratingPossible bottom
DIFF < 0, Histogram expandingDowntrend acceleratingBears strong

Divergence Analysis

Divergence is one of the most important concepts in technical analysis:

Divergence TypePrice BehaviorMACD BehaviorMeaning
Bearish DivergenceNew highNo new highUpward momentum exhausted, may fall
Bullish DivergenceNew lowNo new lowDownward momentum exhausted, may rise
Bearish divergence example:
Price:  100 -> 110 -> 120 -> 125 -> 130 (new high)
MACD:    10 ->  15 ->  18 ->  16 ->  14 (no new high)
                              ^
                         Momentum exhaustion signal

Important warning:

  • Divergence is only a "possible" signal, not a "certain" signal
  • Trading on divergence alone typically has only 55-60% win rate
  • Needs confirmation from other indicators and market structure

4.3 Oscillator Indicators

RSI: Relative Strength

RSI measures the relative strength of recent ups and downs:

RS = Average gain / Average loss
RSI = 100 - 100/(1+RS)

RSI ranges from 0-100:

RSI RangeTraditional InterpretationReality
> 70Overbought, should sellStrong markets can stay > 80
30-70Normal rangeMost of the time here
< 30Oversold, should buyWeak markets can stay < 20

Real usage of RSI:

  • Don't rely solely on 70/30 as buy/sell signals
  • RSI trend matters more: RSI rising from 30 vs RSI oscillating at 60-70
  • RSI divergence is equally valid: Price makes new high but RSI doesn't = bearish divergence

Bollinger Bands

Bollinger Bands consist of three lines:

Middle band = MA20 (20-day moving average)
Upper band = MA20 + 2 sigma (mean + 2 standard deviations)
Lower band = MA20 - 2 sigma (mean - 2 standard deviations)

Statistical meaning: Under normal distribution assumption, price has 95% probability of being between upper and lower bands.

Bollinger SignalTraditional InterpretationApplicable Scenario
Touch upper bandOverbought, may pull backSideways market
Touch lower bandOversold, may bounceSideways market
Break upper bandTrend startingTrending market
Band narrowingVolatility decreasing, breakout comingAll markets

Key insight: Bollinger Bands are "reversion" signals in sideways markets, "breakout" signals in trending markets - you need to first identify the market state.


4.4 Volatility Indicators

Historical Volatility

Historical Volatility = Standard deviation of past N days' returns x sqrt(252) (annualized)

Example calculation:
Daily return standard deviation = 2%
Annualized volatility = 2% x sqrt(252) ~ 31.7%
Annualized VolatilityTypical AssetsRisk Level
10-15%Bonds, large-cap blue chipsLow
20-30%Regular stocksMedium
40-60%Small caps, cryptocurrenciesHigh
80%+Altcoins, expiring optionsExtreme

ATR (Average True Range)

ATR measures "true volatility range," accounting for gaps:

True Range = max(
    Today's High - Today's Low,
    |Today's High - Yesterday's Close|,
    |Today's Low - Yesterday's Close|
)
ATR = N-day average of True Range

Practical uses of ATR:

  • Stop-loss setting: Stop distance = Entry price +/- 2 x ATR
  • Position sizing: Reduce position when volatility is high, can increase when low
  • Breakout confirmation: Breakout > 1 x ATR more likely to be genuine

4.5 Strategy Evaluation Metrics

These metrics evaluate strategy performance, not trading signals:

Sharpe Ratio

Sharpe Ratio = (Rp - Rf) / sigma_p

Rp = Portfolio return
Rf = Risk-free rate (e.g., Treasury yield)
sigma_p = Standard deviation of returns

Intuitive understanding: How much excess return per unit of risk taken.

Sharpe RatioEvaluation
< 0Losing money, worse than bank deposit
0-1Average, may not be worth the risk
1-2Good
2-3Excellent
> 3Top-tier (or data issues)

Other Risk Metrics

MetricFormulaMeaning
Sortino Ratio(Rp - Rf) / sigma_downsideOnly penalizes downside volatility, focuses on loss risk
Maximum DrawdownLargest peak-to-trough declineWorst-case loss
Calmar RatioAnnualized return / Max drawdownBalance of return and drawdown
VaR (95%)Maximum loss at 95% confidenceRisk boundary under normal conditions

Example:

  • Strategy with 20% annual return, 40% max drawdown -> Calmar = 0.5 (average)
  • Strategy with 15% annual return, 10% max drawdown -> Calmar = 1.5 (excellent)

4.6 Indicator Combinations: From Signals to Features

Why Single Indicators Don't Work

Empirical research shows single technical indicators have very limited predictive power:

StrategyWin RateAnnualized Return (after fees)
MACD Golden/Death Cross51%-5% to +3%
RSI Overbought/Oversold52%-3% to +5%
Bollinger Band Breakout50%-8% to +2%
Dual Moving Average Cross53%-2% to +8%

Note: These figures are illustrative/reference values. Actual performance varies significantly by market, timeframe, parameter settings, and cost assumptions (commissions, slippage, bid-ask spread). Always validate with your own backtests.

Reasons:

  1. All market participants watch the same signal -> Signal gets priced in early
  2. Different market states need different interpretations -> Single rule can't adapt
  3. Indicator information is incomplete -> Needs multi-dimensional verification

Correct Usage of Indicators as Features

Traditional usage (wrong):
RSI < 30 -> Buy

Correct usage (feature engineering):
Feature vector = [
    RSI,
    RSI rate of change,
    MACD_DIFF,
    MACD_Histogram rate of change,
    Bollinger Band position (price's relative position within bands),
    ATR (volatility),
    Volume rate of change,
    ...more features
]
-> Input to ML model -> Output: Buy/Sell/Hold + Confidence

Multi-Agent Perspective:

  • Trend Agent: Focuses on MACD, moving averages, ATR
  • Mean Reversion Agent: Focuses on RSI, Bollinger Bands, deviation
  • Regime Agent: Focuses on volatility changes, correlation changes
  • Risk Agent: Focuses on VaR, max drawdown, Sharpe changes

Code Implementation (Optional)

If you want hands-on practice, here's sample code for calculating indicators:

import pandas as pd
import numpy as np

def calculate_indicators(df):
    """
    Calculate common technical indicators
    df needs columns: open, high, low, close, volume
    """
    # EMA
    df['EMA12'] = df['close'].ewm(span=12).mean()
    df['EMA26'] = df['close'].ewm(span=26).mean()

    # MACD
    df['MACD_DIFF'] = df['EMA12'] - df['EMA26']
    df['MACD_DEA'] = df['MACD_DIFF'].ewm(span=9).mean()
    df['MACD_Histogram'] = 2 * (df['MACD_DIFF'] - df['MACD_DEA'])

    # RSI
    delta = df['close'].diff()
    gain = delta.where(delta > 0, 0).rolling(14).mean()
    loss = (-delta.where(delta < 0, 0)).rolling(14).mean()
    # Avoid division by zero: when loss=0 (continuous up moves), RSI=100
    rs = gain / loss.replace(0, np.nan)
    df['RSI'] = (100 - 100 / (1 + rs)).fillna(100)

    # Bollinger Bands
    df['BB_Middle'] = df['close'].rolling(20).mean()
    df['BB_Std'] = df['close'].rolling(20).std()
    df['BB_Upper'] = df['BB_Middle'] + 2 * df['BB_Std']
    df['BB_Lower'] = df['BB_Middle'] - 2 * df['BB_Std']
    df['BB_Position'] = (df['close'] - df['BB_Lower']) / (df['BB_Upper'] - df['BB_Lower'])

    # ATR
    high_low = df['high'] - df['low']
    high_close = (df['high'] - df['close'].shift()).abs()
    low_close = (df['low'] - df['close'].shift()).abs()
    tr = pd.concat([high_low, high_close, low_close], axis=1).max(axis=1)
    df['ATR'] = tr.rolling(14).mean()

    return df

def calculate_sharpe_ratio(returns, risk_free_rate=0.04, periods_per_year=252):
    """Calculate Sharpe Ratio"""
    excess_returns = returns - risk_free_rate / periods_per_year
    return np.sqrt(periods_per_year) * excess_returns.mean() / returns.std()

Lesson Deliverables

After completing this lesson, you will have:

  1. Correct understanding of technical indicators - Know that indicators are "features" not "signals"
  2. Calculation methods for common indicators - Understand the essence of MACD, RSI, Bollinger Bands, ATR
  3. Strategy evaluation ability - Can use Sharpe, Sortino, Calmar and other metrics to evaluate strategies
  4. Multi-dimensional thinking framework - Know which indicators suit different market states and Agents

Key Takeaways

  • Understand the essence of technical indicators: Mathematical transformations of price/volume, no new information created
  • Master usage of trend indicators (MACD) and oscillator indicators (RSI, Bollinger Bands)
  • Understand the principles and limitations of divergence analysis
  • Learn to use Sharpe Ratio and other metrics to evaluate strategy performance
  • Recognize limitations of single indicators; understand the value of indicator combinations as features

Extended Reading


Next Lesson Preview

Lesson 05: Classic Strategy Paradigms

Trend following, mean reversion, grid trading, pairs trading... What are the characteristics of these classic strategies? What markets are they suitable for? What are their pitfalls? Next lesson we break them down one by one.

Cite this chapter
Zhang, Wayland (2026). Lesson 04: The Real Role of Technical Indicators. In AI Quantitative Trading: From Zero to One. https://waylandz.com/quant-book-en/Lesson-04-The-Real-Role-of-Technical-Indicators
@incollection{zhang2026quant_Lesson_04_The_Real_Role_of_Technical_Indicators,
  author = {Zhang, Wayland},
  title = {Lesson 04: The Real Role of Technical Indicators},
  booktitle = {AI Quantitative Trading: From Zero to One},
  year = {2026},
  url = {https://waylandz.com/quant-book-en/Lesson-04-The-Real-Role-of-Technical-Indicators}
}