Technical indicator formulas
The maths behind every indicator, on one page. Each row links to a full explainer that defines every variable and walks through the calculation.
Indicator Formulas: This reference lists the mathematical formula for every technical indicator on the site — RSI, MACD, ATR, ADX, Bollinger Bands, moving averages and more — each linking to a full explainer that defines the variables.
| Indicator | Formula |
|---|---|
| Relative Strength Index | RSI = 100 − 100 / (1 + RS), RS = Average Gain / Average Loss |
| Moving Average Convergence Divergence | MACD = EMA₁₂(close) − EMA₂₆(close); Signal = EMA₉(MACD); Histogram = MACD − Signal |
| Stochastic Oscillator | %K = 100 × (Close − Lowₙ) / (Highₙ − Lowₙ); %D = SMA₃(%K) |
| Stochastic RSI | StochRSI = (RSI − Lowest RSIₙ) / (Highest RSIₙ − Lowest RSIₙ) |
| Commodity Channel Index | CCI = (TP − SMAₙ(TP)) / (0.015 × Mean Deviation) |
| Williams %R | %R = (Highestₙ − Close) / (Highestₙ − Lowestₙ) × −100 |
| Momentum Indicator | Momentum = Close − Close₍ₙ ago₎ |
| Rate of Change | ROC = (Close − Close₍ₙ ago₎) / Close₍ₙ ago₎ × 100 |
| True Strength Index | TSI = 100 × EMA₁₃(EMA₂₅(ΔC)) / EMA₁₃(EMA₂₅(|ΔC|)) |
| Moving Average | MA = weighted average of the last N closing prices |
| Simple Moving Average | SMA = (P₁ + P₂ + … + Pₙ) / N |
| Exponential Moving Average | EMAₜ = α × Priceₜ + (1 − α) × EMAₜ₋₁, α = 2 / (N + 1) |
| Weighted Moving Average | WMA = (N×Pₜ + (N−1)×Pₜ₋₁ + … + 1×Pₜ₋ₙ₊₁) / (N + (N−1) + … + 1) |
| Hull Moving Average | HMA = WMA( 2×WMA(N/2) − WMA(N) ), smoothed over √N |
| Volume Weighted Moving Average | VWMA = Σ(Pᵢ × Vᵢ) / Σ(Vᵢ), over the last N bars |
| Kaufman Adaptive Moving Average | KAMAₜ = KAMAₜ₋₁ + SC × (Priceₜ − KAMAₜ₋₁); SC = [ER × (fast − slow) + slow]² |
| Supertrend | Upper/Lower Band = (High+Low)/2 ± Multiplier × ATR; Supertrend follows the band in the trend's direction |
| Ichimoku Cloud | Tenkan=(9-high+9-low)/2; Kijun=(26-high+26-low)/2; SpanA=(Tenkan+Kijun)/2 (fwd 26); SpanB=(52-high+52-low)/2 (fwd 26); Chikou=close (back 26) |
| Parabolic SAR | SARₜ₊₁ = SARₜ + AF × (EP − SARₜ) |
| Average True Range | TR = max(High − Low, |High − prevClose|, |Low − prevClose|); ATR = Wilder-smoothed average of TR over N |
| Bollinger Bands | Middle = SMA₂₀(close); Upper = Middle + 2σ; Lower = Middle − 2σ |
| Keltner Channel | Middle = EMA₂₀(close); Upper = Middle + (2 × ATR); Lower = Middle − (2 × ATR) |
| Donchian Channel | Upper = Highest High over N; Lower = Lowest Low over N; Middle = (Upper + Lower) / 2 |
| Standard Deviation | σ = √( Σ(close − mean)² / N ) |
| Historical Volatility | HV = StdDev(daily log returns) × √(trading days per year) |
| On-Balance Volume | OBV = Previous OBV + Volume (if Close > Prev Close), − Volume (if Close < Prev Close), + 0 (if unchanged) |
| Volume Profile | For each price bucket: Volume(price) = Σ traded volume at that price; POC = price with max Volume; Value Area = smallest price range around POC containing ≈70% of total volume |
| Volume Weighted Average Price | VWAP = Σ(Typical Price × Volume) / Σ(Volume), where Typical Price = (High + Low + Close) / 3 |
| Money Flow Index | MFI = 100 − 100 / (1 + Money Flow Ratio); Money Flow Ratio = Positive Money Flow / Negative Money Flow |
| Chaikin Money Flow | CMF = Σₙ(Money Flow Volume) / Σₙ(Volume); Money Flow Volume = [((Close − Low) − (High − Close)) / (High − Low)] × Volume |
| Accumulation/Distribution Line | A/D = Previous A/D + Money Flow Volume; Money Flow Volume = [((Close − Low) − (High − Close)) / (High − Low)] × Volume |
| Ease of Movement | EOM = ((High + Low)/2 − (Prior High + Prior Low)/2) / [ Volume / (High − Low) ]; usually smoothed with a 14-period SMA |
| Average Directional Index | ADX = 100 × Wilder-EMA of |(+DI) − (−DI)| / ((+DI) + (−DI)) |
| Directional Movement Index | +DI = 100 × Smoothed(+DM) / ATR; −DI = 100 × Smoothed(−DM) / ATR |
| Aroon Indicator | Aroon Up = 100 × (N − periods since highest high) / N; Aroon Down = 100 × (N − periods since lowest low) / N |
| Vortex Indicator | VI+ = Σ|Highₜ − Lowₜ₋₁| / ΣTR; VI− = Σ|Lowₜ − Highₜ₋₁| / ΣTR |
| Advance/Decline Line | A/D Line = Previous A/D Line + (Advancing stocks − Declining stocks) |
| McClellan Oscillator | McClellan Oscillator = EMA₁₉(Net Advances) − EMA₃₉(Net Advances) |
| TRIN (Arms Index) | TRIN = (Advancing stocks / Declining stocks) / (Advancing volume / Declining volume) |
| Awesome Oscillator | AO = SMA₅((H+L)/2) − SMA₃₄((H+L)/2) |
| Accelerator Oscillator | AC = AO − SMA₅(AO), where AO = SMA₅((H+L)/2) − SMA₃₄((H+L)/2) |
| Percentage Price Oscillator | PPO = (EMA₁₂ − EMA₂₆) / EMA₂₆ × 100; Signal = EMA₉(PPO); Histogram = PPO − Signal |
| Detrended Price Oscillator | DPO = Price₍(N/2 + 1) bars ago₎ − SMAₙ displaced back by (N/2 + 1) bars |
| Fisher Transform | Fisher = 0.5 × ln((1 + X) / (1 − X)), X = normalised median price in [−1, +1] |
Every formula links to a full page that defines each variable and shows the calculation step by step. Try them in the calculators.
Frequently asked questions
What is the RSI formula?
RSI = 100 − 100 / (1 + RS), where RS = average gain over N periods ÷ average loss over N periods, with N usually 14. Gains and losses are averaged with Wilder's smoothing.
Last reviewed 8 July 2026. Educational content only — not investment advice.