“Which stocks to buy” and “when to buy and sell” are different questions. The indicators covered in previous posts — PER, ROE, momentum, dividend yield — answer the first. They evaluate a company’s value and quality. Answering the second requires reading price movements directly. Technical indicators serve that purpose.

Technical Indicators

RSI (Relative Strength Index)

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

Compares the magnitude of price gains versus losses over a period (typically 14 days). Produces a value between 0 and 100.

RSI < 30 indicates an oversold condition. The decline has been large enough that a rebound is possible. Read as a buy signal. RSI > 70 indicates an overbought condition. The rise has been large enough that a decline is possible. Read as a sell signal.

30/70 are not absolute thresholds. In strong uptrends, RSI can stay above 70 and keep rising. Adjusting to 20/80 or combining with other indicators helps reduce false signals.

SMA Cross (Moving Average Crossover)

SMA(N) = Average of closing prices over the last N days

The Simple Moving Average (SMA) is the arithmetic mean of closing prices over N days. Crossovers between short-term and long-term SMAs identify trend reversals.

Golden cross. The short-term SMA crosses above the long-term SMA. Signals an uptrend. Buy signal. Death cross. The opposite. The short-term crosses below the long-term. Signals a downtrend. Sell signal.

Common period combinations are 5/20 (short-term), 20/60 (medium-term), and 50/200 (long-term). Shorter periods produce faster signals but also more false ones.

MACD (Moving Average Convergence Divergence)

MACD Line = 12-day EMA - 26-day EMA
Signal Line = 9-day EMA of MACD Line
Histogram = MACD Line - Signal Line

Developed by Gerald Appel. Uses Exponential Moving Averages (EMA) to capture both trend direction and strength. EMA gives more weight to recent data than SMA.

When the MACD Line crosses above the Signal Line, it is a buy signal. Crosses below, a sell signal. The histogram visualizes the gap between the two lines. A transition from positive to negative (or vice versa) also signals a trend change.

Similar principle to SMA Cross, but responds more quickly to price changes because of EMA.

Bollinger Bands

Middle Band = 20-day SMA
Upper Band = Middle Band + (2 × Standard Deviation)
Lower Band = Middle Band - (2 × Standard Deviation)

Developed by John Bollinger. Expresses price volatility as bands around a moving average. Since standard deviation is used, bands widen when volatility is high and narrow when low.

Price breaks below the lower band — oversold. Buy signal. Breaks above the upper band — overbought. Sell signal. About 95% of price action stays within the bands statistically.

A narrowing band (squeeze) indicates low volatility. A significant price move may follow. Direction is unknown, so enter after confirming the breakout direction.

Composite Signals

Four indicators covered. They share a common limitation. Trading on any single indicator is vulnerable to false signals. RSI can drop below 30 and keep falling. A golden cross can quickly reverse into a death cross. Combining multiple indicators reduces these false signals.

Weighted Combination

Assign a weight to each indicator. When the sum of triggered weights meets a threshold relative to total weights, fire a composite signal.

Signal condition: sum of triggered weights / total weights ≥ threshold (e.g., 0.5)

Example: combining RSI (weight 0.3), SMA Cross (weight 0.3), and MACD (weight 0.4). If RSI and MACD both trigger buy signals, (0.3 + 0.4) / 1.0 = 0.7. Above the 0.5 threshold, so a composite buy signal fires.

Lower threshold means higher sensitivity. Higher threshold means more conservative. This tension is tuned through backtesting.

Cooldown

Prevents consecutive signals on the same ticker. Once a signal fires, signals for that ticker are ignored for a set period (e.g., 300 seconds).

Without cooldown, high-volatility periods generate repeated buy-sell signals. Unnecessary transaction costs accumulate.

Three Strategy Types

The technical indicators covered here belong to one of several strategy types in quantitative investing. The factor indicators from previous posts belong to another. Each type operates on a different time horizon.

Strategy TypeDecision BasisTime HorizonStock Selection
Signal (Technical)RSI, MACD, and other technical indicatorsSeconds/minutes (real-time)Fixed (user-specified)
Factor (Screening)PER, ROE, and other factor scoresMonthly/quarterly (rebalancing)Dynamic (rotated each rebalancing)
Asset AllocationDrift from target weightsWhen weight band is breachedFixed (asset class level)

Signal strategies receive real-time price data and determine buy/sell decisions using technical indicators. RSI, SMA Cross, MACD, and Bollinger Bands covered in this post belong here. Operates on the shortest time horizon.

Factor strategies score stocks using factors from previous posts (PER, ROE, momentum, etc.). Select the top N stocks at each rebalancing. Monthly or quarterly cycles.

Asset Allocation strategies set target weights per holding. Rebalance when current weights drift outside a band. Holdings remain fixed unless the target weights change.

The three are not mutually exclusive. Select stocks via Factor, manage asset class weights via Asset Allocation, time entries and exits via Signal.


Technical indicators are tools for reading buy/sell signals from price movements. But knowing the tools and designing a strategy are different things. Choosing which indicators to combine and which strategy type to use — that is the design work.

This series started from stock data basics, progressed through company evaluation indicators, market trend indicators, backtesting, portfolio construction, and price-based technical indicators. The next step is applying these to real data — building and validating strategies firsthand.

References