Skip to main content

Technical Indicators Theory

Understand the mathematical foundations and practical applications of technical indicators in quantitative finance.

Mathematical Precision

VectorAlpha implements over 50 technical indicators with rigorous mathematical accuracy. Our SIMD-optimized implementations process millions of data points per second while maintaining numerical precision required for quantitative finance.

Core Indicator Categories

Trend-Following Indicators

Trend indicators help identify the direction and strength of market movements by smoothing price data and reducing noise.

Simple Moving Average (SMA)

SMA = (P₁ + P₂ + ... + Pₙ) / n

Where P represents price values and n is the period length. SMA gives equal weight to all values in the period.

Momentum Oscillators

Oscillators measure the speed of price changes to identify overbought and oversold conditions.

Relative Strength Index (RSI)

RSI = 100 - (100 / (1 + RS))
RS = Average Gain / Average Loss

RSI ranges from 0 to 100. Values above 70 indicate overbought conditions, while values below 30 suggest oversold conditions.

Volatility Indicators

Volatility indicators measure the rate of price movement regardless of direction, helping assess risk and identify breakout opportunities.

Average True Range (ATR)

TR = max[(H - L), |H - PC|, |L - PC|]
ATR = MA(TR, n)

Where H = High, L = Low, PC = Previous Close. ATR provides a normalized measure of volatility.

Mathematical Deep Dive

Exponential Moving Average (EMA)

The EMA gives more weight to recent prices, making it more responsive to new information than the SMA.

EMAtoday = (Pricetoday × α) + (EMAyesterday × (1 - α))

Where α (alpha) = 2 / (n + 1)

Implementation in Rust

Code Example Coming Soon

Full code examples with syntax highlighting will be available in the next update.

MACD (Moving Average Convergence Divergence)

MACD is a trend-following momentum indicator showing relationships between moving averages.

MACD Line = EMA(12) - EMA(26)
Signal Line = EMA(9) of MACD Line
Histogram = MACD Line - Signal Line

Trading Signals

  • Bullish Signal: MACD crosses above signal line
  • Bearish Signal: MACD crosses below signal line
  • Divergence: Price makes new high/low but MACD doesn't confirm

Bollinger Bands

Bollinger Bands use standard deviation to create dynamic support and resistance levels.

Middle Band = SMA(20)
Upper Band = SMA(20) + (2 × σ)
Lower Band = SMA(20) - (2 × σ)

Where σ = Standard Deviation of price over 20 periods

Volatility Interpretation

  • Band Squeeze: Low volatility, potential breakout incoming
  • Band Expansion: High volatility, trend may be ending
  • Price at Bands: Potential reversal points

Stochastic Oscillator

The Stochastic compares current price to the price range over a period, identifying momentum shifts.

%K = ((Close - Low14) / (High14 - Low14)) × 100
%D = SMA(3) of %K

Where:
- Close = Current closing price
- Low14 = Lowest low over 14 periods
- High14 = Highest high over 14 periods

Advanced Concepts

Indicator Combinations

Professional traders rarely rely on single indicators. Effective strategies combine indicators from different categories to confirm signals.

Multi-Indicator Strategy Example

Code Example Coming Soon

Full code examples with syntax highlighting will be available in the next update.

Adaptive Indicators

Modern quantitative finance uses adaptive indicators that adjust parameters based on market conditions.

Code Example Coming Soon

Full code examples with syntax highlighting will be available in the next update.

Best Practices for Quantitative Finance

1. Statistical Validation

Always validate indicator effectiveness through rigorous backtesting and statistical analysis.

  • Use out-of-sample testing
  • Calculate Sharpe ratios and maximum drawdowns
  • Test across different market regimes
  • Apply Monte Carlo simulations for robustness

2. Avoid Common Pitfalls

  • Overfitting: Don't optimize parameters on limited data
  • Look-ahead bias: Ensure calculations only use past data
  • Survivorship bias: Include delisted securities in tests
  • Transaction costs: Account for spreads and commissions

3. Market Regime Awareness

Different indicators perform better in different market conditions:

Market Regime Effective Indicators
Trending Moving Averages, MACD, ADX
Range-bound RSI, Stochastic, Bollinger Bands
High Volatility ATR, Keltner Channels, Volatility Bands

Implementation Note

VectorAlpha's indicators are optimized for numerical stability and performance. We use Welford's algorithm for running statistics, Kahan summation for precision, and SIMD instructions for parallel processing. All implementations undergo extensive validation against reference implementations.

Educational Resources

Deepen your understanding of technical indicators with these resources:

Next Steps