25+ Indicators

Free Indicator Formula Reference

Your comprehensive guide to technical indicator formulas. Find exact calculations, parameters, and ready-to-use Pine Script code for TradingView.

25+ Indicators
Ready-to-Use Code
100% Free

Moving Averages

Simple Moving Average (SMA)

The unweighted mean of the previous n data points.

Parameters: n = period, P = price

Formula
SMA(n) = (P₁ + P₂ + ... + Pₙ) / n
Pine Script v5
//@version=5
indicator("Simple Moving Average", overlay=true)
smaValue = ta.sma(close, 20)
plot(smaValue)

Exponential Moving Average (EMA)

A weighted moving average that gives more importance to recent prices.

Parameters: k = 2/(n+1), Pₜ = current price, EMA(y) = previous EMA

Formula
EMA(t) = (Pₜ × k) + EMA(y) × (1 - k)
Pine Script v5
//@version=5
indicator("Exponential Moving Average", overlay=true)
emaValue = ta.ema(close, 20)
plot(emaValue)

Weighted Moving Average (WMA)

A moving average with linearly increasing weights.

Parameters: n = period, P = price

Formula
WMA = (n×Pₙ + (n-1)×Pₙ₋₁ + ... + 1×P₁) / (n + (n-1) + ... + 1)
Pine Script v5
//@version=5
indicator("Weighted Moving Average", overlay=true)
wmaValue = ta.wma(close, 20)
plot(wmaValue)

Double Exponential Moving Average (DEMA)

Reduces lag by removing the slow EMA from the fast EMA.

Parameters: n = period, EMA = exponential moving average

Formula
DEMA = 2 × EMA(n) - EMA(EMA(n), n)
Pine Script v5
//@version=5
indicator("Double Exponential Moving Average", overlay=true)
demaValue = ta.dema(close, 20)
plot(demaValue)

Triple Exponential Moving Average (TEMA)

Further reduces lag by applying EMA three times.

Parameters: n = period

Formula
TEMA = 3 × EMA(n) - 3 × EMA(EMA(n), n) + EMA(EMA(EMA(n), n), n)
Pine Script v5
//@version=5
indicator("Triple Exponential Moving Average", overlay=true)
temaValue = ta.tema(close, 20)
plot(temaValue)

Momentum Oscillators

Relative Strength Index (RSI)

Measures the speed and magnitude of price changes to identify overbought or oversold conditions.

Parameters: RS = Average Gain / Average Loss (14-period)

Formula
RSI = 100 - (100 / (1 + RS))
Pine Script v5
//@version=5
indicator("Relative Strength Index", overlay=false)
rsiValue = ta.rsi(close, 14)
plot(rsiValue, color=color.blue)
hline(70)
hline(30)

Stochastic Oscillator (%K)

Compares closing price to the price range over a given period.

Parameters: C = current close, Lₙ = lowest low n periods, Hₙ = highest high n periods

Formula
%K = 100 × (C - Lₙ) / (Hₙ - Lₙ)
Pine Script v5
//@version=5
indicator("Stochastic Oscillator", overlay=false)
k = ta.stoch(close, high, low, 14)
d = ta.sma(k, 3)
plot(k, color=color.blue)
plot(d, color=color.orange)
hline(80)
hline(20)

Williams %R

Inverted stochastic oscillator showing overbought/oversold levels.

Parameters: C = current close, Hₙ = highest high n periods, Lₙ = lowest low n periods

Formula
%R = -100 × (Hₙ - C) / (Hₙ - Lₙ)
Pine Script v5
//@version=5
indicator("Williams %R", overlay=false)
williamsR = ta.wpr(14)
plot(williamsR, color=color.purple)
hline(-20)
hline(-80)

Rate of Change (ROC)

Measures the percentage change in price over n periods.

Parameters: C = current close, Cₙ = close n periods ago

Formula
ROC = ((C - Cₙ) / Cₙ) × 100
Pine Script v5
//@version=5
indicator("Rate of Change", overlay=false)
roc = ta.roc(close, 14)
plot(roc, color=color.green)
hline(0)

Commodity Channel Index (CCI)

Identifies cyclical trends in commodities and other securities.

Parameters: TP = Typical Price, SMA = Simple Moving Average, MD = Mean Deviation

Formula
CCI = (TP - SMA(TP)) / (0.015 × MD)
Pine Script v5
//@version=5
indicator("Commodity Channel Index", overlay=false)
cci = ta.cci(close, 20)
plot(cci, color=color.orange)
hline(100)
hline(-100)

Momentum Indicator

Measures the rate of change in a securitys price.

Parameters: C = current close, Cₙ = close n periods ago

Formula
MOM = C - Cₙ
Pine Script v5
//@version=5
indicator("Momentum", overlay=false)
mom = ta.mom(close, 14)
plot(mom, color=color.blue)
hline(0)

Trend Indicators

Moving Average Convergence Divergence (MACD)

Shows the relationship between two moving averages of price.

Parameters: EMA = Exponential Moving Average

Formula
MACD = EMA(12) - EMA(26), Signal = EMA(9) of MACD, Histogram = MACD - Signal
Pine Script v5
//@version=5
indicator("MACD", overlay=false)
[macdLine, signalLine, hist] = ta.macd(close, 12, 26, 9)
plot(macdLine, color=color.blue)
plot(signalLine, color=color.orange)
plot(hist, color=hist >= 0 ? color.green : color.red, style=plot.style_histogram)

Average Directional Index (ADX)

Measures the strength of a trend, regardless of direction.

Parameters: +DI = Plus Directional Indicator, -DI = Minus Directional Indicator

Formula
ADX = (1/14) × Σ(|(+DI - -DI)| / (+DI + -DI)) × 100
Pine Script v5
//@version=5
indicator("Average Directional Index", overlay=false)
[adxValue, plusDi, minusDi] = ta.adx(high, low, close, 14)
plot(adxValue, color=color.red)
plot(plusDi, color=color.green)
plot(minusDi, color=color.blue)
hline(25)

Parabolic SAR

Indicates potential reversals in price direction.

Parameters: AF = Acceleration Factor, EP = Extreme Price

Formula
SAR(n+1) = SAR(n) + AF × (EP - SAR(n))
Pine Script v5
//@version=5
indicator("Parabolic SAR", overlay=true)
sarValue = ta.sar(0.02, 0.02, 0.2)
plot(sarValue, "Parabolic SAR", style=plot.style_cross, linewidth=2)

Ichimoku Cloud

Five line system that provides trading signals and trend identification.

Parameters: Multiple lines calculated from highs and lows over different periods

Formula
Tenkan-sen = (Highest High + Lowest Low) / 2 (9 periods)
Pine Script v5
//@version=5
indicator("Ichimoku Cloud", overlay=true)
[tenkan, kijun, senkouA, senkouB, chikou] = ta.ichimoku(9, 26, 52, 26)
plot(tenkan, color=color.red)
plot(kijun, color=color.blue)
plot(senkouA, color=color.lime, offset=26)
plot(senkouB, color=color.purple, offset=26)
plot(chikou, color=color.orange, offset=-26)

Volatility Indicators

Bollinger Bands

Band around a moving average representing standard deviation.

Parameters: σ = Standard Deviation of price over 20 periods

Formula
Upper = SMA(20) + 2×σ, Middle = SMA(20), Lower = SMA(20) - 2×σ
Pine Script v5
//@version=5
indicator("Bollinger Bands", overlay=true)
basis = ta.sma(close, 20)
dev = ta.stdev(close, 20)
upper = basis + dev * 2
lower = basis - dev * 2
plot(basis, color=color.orange)
plot(upper, color=color.red)
plot(lower, color=color.green)

Average True Range (ATR)

Measures market volatility by decomposing the range of price.

Parameters: TR = True Range = max(High-Low, |High-PrevClose|, |Low-PrevClose|)

Formula
ATR = EMA(TR, n)
Pine Script v5
//@version=5
indicator("Average True Range", overlay=false)
atrValue = ta.atr(14)
plot(atrValue, color=color.blue)

True Range (TR)

The greatest of: current high-low, |high-prev close|, |low-prev close|.

Parameters: High, Low = current bar high and low

Formula
TR = max(High - Low, |High - Close₋₁|, |Low - Close₋₁|)
Pine Script v5
//@version=5
indicator("True Range", overlay=false)
tr = math.abs(high - low)
plot(tr, color=color.purple)

Keltner Channels

Volatility-based envelope around a moving average.

Parameters: EMA = Exponential Moving Average, ATR = Average True Range

Formula
Upper = EMA(20) + 2×ATR, Middle = EMA(20), Lower = EMA(20) - 2×ATR
Pine Script v5
//@version=5
indicator("Keltner Channels", overlay=true)
basis = ta.ema(close, 20)
atrVal = ta.atr(20)
upper = basis + atrVal * 2
lower = basis - atrVal * 2
plot(basis, color=color.orange)
plot(upper, color=color.red)
plot(lower, color=color.green)

Volume Indicators

On-Balance Volume (OBV)

Cumulative volume-based indicator that relates volume to price changes.

Parameters: Volume = trading volume

Formula
OBV = OBV₋₁ + Volume (if close > close₋₁), OBV₋₁ - Volume (if close < close₋₁)
Pine Script v5
//@version=5
indicator("On-Balance Volume", overlay=false)
obvValue = ta.obv
plot(obvValue, color=color.blue)

Volume Weighted Average Price (VWAP)

Measures the average price weighted by volume throughout the day.

Parameters: Price = typical price (H+L+C)/3

Formula
VWAP = Σ(Price × Volume) / Σ(Volume)
Pine Script v5
//@version=5
indicator("VWAP", overlay=true)
vwapValue = ta.vwap(high, low, close, open)
plot(vwapValue, color=color.yellow)

Accumulation/Distribution Line

Relates price and volume to determine if money is flowing in or out.

Parameters: High, Low, Close = price data, Volume = trading volume

Formula
A/D = A/D₋₁ + ((Close - Low) - (High - Close)) / (High - Low) × Volume
Pine Script v5
//@version=5
indicator("Accumulation/Distribution", overlay=false)
adValue = ta.acd(high, low, close, open, volume)
plot(adValue, color=color.orange)

Chaikin Money Flow (CMF)

Measures buying and selling pressure over a period.

Parameters: Flow = ((Close - Low) - (High - Close)) / (High - Low)

Formula
CMF = Σ(Flow × Volume) / Σ(Volume) over 21 periods
Pine Script v5
//@version=5
indicator("Chaikin Money Flow", overlay=false)
cmfValue = ta.cmf(high, low, close, open, volume, 21)
plot(cmfValue, color=color.blue)
hline(0)

Volume Rate of Change

Shows the percentage change in volume over n periods.

Parameters: Volume = current volume, Volumeₙ = volume n periods ago

Formula
VROC = ((Volume - Volumeₙ) / Volumeₙ) × 100
Pine Script v5
//@version=5
indicator("Volume Rate of Change", overlay=false)
vroc = ta.roc(volume, 14)
plot(vroc, color=color.green)
hline(0)

Support & Resistance

Pivot Points

Calculated support and resistance levels based on previous high, low, close.

Parameters: High, Low, Close = previous period data

Formula
PP = (High + Low + Close) / 3, R1 = 2×PP - Low, S1 = 2×PP - High
Pine Script v5
//@version=5
indicator("Pivot Points", overlay=true)
highPrev = request.security(syminfo.tickerid, "D", high[1])
lowPrev = request.security(syminfo.tickerid, "D", low[1])
closePrev = request.security(syminfo.tickerid, "D", close[1])
pp = (highPrev + lowPrev + closePrev) / 3
r1 = 2 * pp - lowPrev
s1 = 2 * pp - highPrev
plot(pp, "PP", color=color.blue)
plot(r1, "R1", color=color.red)
plot(s1, "S1", color=color.green)

Fibonacci Retracement

Support and resistance levels at Fibonacci ratios of the range.

Parameters: Fibonacci % = 23.6%, 38.2%, 50%, 61.8%, 78.6%

Formula
Level = High - (High - Low) × Fibonacci %
Pine Script v5
//@version=5
indicator("Fibonacci Retracement", overlay=true)
flo = ta.lowest(low, 20)
fhi = ta.highest(high, 20)
diff = fhi - flo
plot(fhi, color=color.red)
plot(flo, color=color.green)
// Manual plotting of levels
plot(fhi - diff * 0.236, color=color.gray)
plot(fhi - diff * 0.382, color=color.gray)
plot(fhi - diff * 0.5, color=color.gray)
plot(fhi - diff * 0.618, color=color.gray)

What Are Technical Indicators?

Technical indicators are mathematical calculations based on historical price, volume, or open interest data that traders use to forecast future market movements. These powerful tools transform raw price data into actionable insights, helping traders identify trends, measure momentum, assess volatility, and spot potential entry and exit points. Whether you are a day trader analyzing minute-by-minute price action or a long-term investor evaluating multi-year trends, technical indicators provide a systematic framework for market analysis.

Our comprehensive indicator formula reference includes all the most widely-used technical indicators, from basic moving averages to advanced volatility measures. Each indicator includes the exact mathematical formula, parameter explanations, and ready-to-use Pine Script code for TradingView. This makes it easy to implement these indicators in your own trading strategies or verify calculations from other sources.

Types of Technical Indicators

Technical indicators are typically categorized into four main types, each serving a distinct purpose in market analysis. Understanding these categories helps traders select the right tools for their strategy and avoid the common mistake of using multiple indicators of the same type, which can lead to redundant signals.

Trend Indicators

Identify the direction and strength of market trends. Examples include Moving Averages, MACD, ADX, and Ichimoku Cloud. These indicators lag behind price but provide clear trend identification.

Momentum Oscillators

Measure the speed and strength of price changes. RSI, Stochastic Oscillator, and Williams %R fall into this category. Best used in range-bound markets to identify overbought and oversold conditions.

Volatility Indicators

Quantify the rate of price movement regardless of direction. Bollinger Bands, ATR, and Keltner Channels help traders understand market turbulence and set appropriate stop-loss levels.

Volume Indicators

Analyze trading volume to confirm price movements or detect divergences. OBV, VWAP, and Accumulation/Distribution help validate trends and identify potential reversals.

How to Use This Reference

  1. 1

    Browse by Category

    Use the category dropdown to filter indicators by type. Each category groups related indicators together for easy comparison.

  2. 2

    Search for Specific Indicators

    Type any indicator name or keyword in the search box to find what you need instantly.

  3. 3

    Copy Pine Script Code

    Each indicator includes ready-to-use Pine Script v5 code. Copy it directly into TradingView to add the indicator to your charts.

  4. 4

    Understand the Math

    Review the mathematical formulas to understand exactly how each indicator is calculated. This knowledge helps you interpret signals correctly.

Why Use Our Indicator Formula Reference?

Comprehensive Coverage

Over 25 indicators covering all major categories from trend analysis to volume measurement.

Ready-to-Use Code

Every formula includes Pine Script v5 code tested and ready for TradingView. Just copy and paste.

Always Free

No subscriptions, no paywalls, no registration required. Access all formulas and code examples completely free.

Frequently Asked Questions

Build Custom Indicators with AI

Now that you understand indicator formulas, let Pineify's AI generate custom Pine Script indicators for your unique trading strategy. No coding required.