What is the Force Index?
The Force Index (FI), developed by Alexander Elder, is a unique oscillator that measures the strength of buying and selling pressure by combining price movement and volume. Unlike pure momentum indicators that only consider price, Force Index gives greater significance to large price changes that occur on high volume, indicating a strong force pushing the market. It can be positive (bullish force) or negative (bearish force) and oscillates around a zero line.
In Pine Script, Force Index is a powerful tool for confirming trend strength, spotting potential reversals through divergence, and identifying when strong money is entering or leaving the market.
Components and Calculation
The core calculation of the Force Index for a single period is quite simple:
- Single Period Force Index:
`Force Index = Volume * (Current Close - Previous Close)`
A positive value indicates that buyers are in control (price went up on volume), while a negative value indicates sellers are in control (price went down on volume). - Smoothed Force Index: To make the indicator more useful and reduce noise, the single-period Force Index is usually smoothed using an Exponential Moving Average (EMA) over a specified `length`.
`Smoothed Force Index = EMA(Force Index, length)`
Common lengths for smoothing are 1 (raw), 2 (short-term), or 13 (long-term).
This smoothing helps to identify the underlying trend of buying/selling pressure more clearly.
Basic Force Index Implementation in Pine Script
Pine Script v5 provides a straightforward built-in function `ta.fi()` for calculating the Force Index.
//@version=5
indicator("My Force Index Indicator", overlay=false) // overlay=false to plot in a separate pane
// Input for Force Index length (smoothing period for the raw FI)
length = input.int(13, title="FI Length (EMA Smoothing)", minval=1)
// Calculate Force Index using the built-in function
// ta.fi takes the source (usually close) and the length for EMA smoothing
fiValue = ta.fi(close, length)
// Plot the Force Index line
plot(fiValue, title="Force Index", color=color.blue, linewidth=2)
// Plot the Zero Line
hline(0, "Zero Line", color.gray, linestyle=hline.style_dotted)
Practical Force Index Trading Strategies
1. Trend Confirmation
Force Index is excellent for confirming the strength and direction of a trend, especially when smoothed over a longer period (e.g., 13 periods).
- Bullish Trend Confirmation: Force Index is consistently above the zero line and rising. Higher highs in price should be confirmed by higher highs in Force Index.
- Bearish Trend Confirmation: Force Index is consistently below the zero line and falling. Lower lows in price should be confirmed by lower lows in Force Index.
//@version=5
strategy("Force Index Trend Confirmation Strategy", overlay=true)
// Input for Force Index length
length = input.int(13, title="FI Length (EMA Smoothing)", minval=1)
// Calculate Force Index
fiValue = ta.fi(close, length)
// Plot the Force Index line in a separate pane
plot(fiValue, title="Force Index", color.blue, display=display.pane_only)
hline(0, "Zero Line", color.gray, linestyle=hline.style_dotted, display=display.pane_only)
// Define conditions for entries based on consistent FI direction
// Long when FI is positive and rising
longCondition = fiValue > 0 and fiValue > fiValue[1]
// Short when FI is negative and falling
shortCondition = fiValue < 0 and fiValue < fiValue[1]
// Strategy entries/exits
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
2. Zero Line Crossover (Momentum Shift)
Crossovers of the zero line can signal a shift in the dominant force in the market. This is often used for shorter-term signals, especially with a shorter FI length (e.g., 2 periods).
- Buy Signal: Force Index crosses above the zero line. This indicates buying pressure is taking over.
- Sell Signal: Force Index crosses below the zero line. This indicates selling pressure is taking over.
//@version=5
strategy("Force Index Zero Line Crossover Strategy", overlay=true)
// Input for Force Index length (often shorter for crossover signals)
length = input.int(2, title="FI Length (EMA Smoothing)", minval=1)
// Calculate Force Index
fiValue = ta.fi(close, length)
// Plot the Force Index line in a separate pane
plot(fiValue, title="Force Index", color.blue, display=display.pane_only)
hline(0, "Zero Line", color.gray, linestyle=hline.style_dotted, display=display.pane_only)
// Define conditions for entries
longSignal = ta.crossover(fiValue, 0)
shortSignal = ta.crossunder(fiValue, 0)
// Strategy entries/exits
if (longSignal)
strategy.entry("Long", strategy.long)
if (shortSignal)
strategy.entry("Short", strategy.short)
3. Force Index Divergence Strategy
Divergence between price and Force Index is a powerful signal, as it suggests a breakdown in the underlying strength of the trend, confirmed by volume. This is often used with the longer-term FI (e.g., 13 periods).
- Bullish Divergence: Price makes a lower low, but Force Index makes a higher low. This indicates weakening bearish force, suggesting a potential upward reversal.
- Bearish Divergence: Price makes a higher high, but Force Index makes a lower high. This indicates weakening bullish force, suggesting a potential downward reversal.
//@version=5
indicator("Force Index Divergence Scanner", overlay=true)
// Input for Force Index length
length = input.int(13, title="FI Length (EMA Smoothing)", minval=1)
// Calculate Force Index
fiValue = ta.fi(close, length)
// Plot Force Index in a separate pane
plot(fiValue, "Force Index", color.blue)
hline(0, "Zero Line", color.gray, linestyle=hline.style_dotted)
// Simple divergence detection (conceptual, robust detection requires advanced pivot logic)
// This is a simplified example focusing on price vs FI divergence.
// Bullish Divergence (Price lower low, FI higher low)
bullishDivergence = close[2] > close[1] and close[1] > close and fiValue[2] < fiValue[1] and fiValue[1] < fiValue
// Bearish Divergence (Price higher high, FI lower high)
bearishDivergence = close[2] < close[1] and close[1] < close and fiValue[2] > fiValue[1] and fiValue[1] > fiValue
plotshape(bullishDivergence, title="Bullish Divergence", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(bearishDivergence, title="Bearish Divergence", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
alertcondition(bullishDivergence, "Bullish FI Divergence", "Potential bullish reversal based on Force Index divergence.")
alertcondition(bearishDivergence, "Bearish FI Divergence", "Potential bearish reversal based on Force Index divergence.")
Optimizing Force Index Performance
To get the most from the Force Index in Pine Script:
- Parameter Tuning: The `length` parameter is crucial.
- Short Lengths (e.g., 1 or 2 periods): Used for short-term signals and quick reactions to price/volume surges. Excellent for confirming individual bar strength.
- Medium/Long Lengths (e.g., 13 periods): Used for identifying the dominant trend and more reliable divergence signals. This smoothed version helps filter out noise.
- Combine with Price Action: Force Index is powerful because it integrates volume. Look for FI signals that are confirmed by significant price action, such as breaks of support/resistance, candlestick patterns, or large volume spikes on the price chart.
- Multi-Timeframe Analysis: Use a longer-term Force Index on a higher timeframe to confirm the overall trend, then look for entry/exit signals from a shorter-term Force Index on a lower timeframe.
- Use with Trend-Following Indicators: Since Force Index helps confirm trend strength, it's often best used in conjunction with a trend-following indicator (like a moving average or ADX) to ensure you are trading in the direction of the larger trend.
Common Force Index Pitfalls
- Requires Volume Data: Force Index relies heavily on accurate volume data. For assets or exchanges where volume data is unreliable or unavailable, Force Index will not be effective.
- Lag (especially with longer lengths): Like all smoothed indicators, the Force Index will have some lag, especially when using longer lengths. Short lengths can be noisy.
- False Signals in Ranging Markets: In non-trending or highly choppy markets, Force Index can oscillate around the zero line, generating frequent and often unreliable signals.
- Divergence Can Be Early: While divergence is a strong signal, it can appear early, and the trend might continue for some time after the divergence appears, requiring patience and additional confirmation.
- Not a Standalone Indicator: Force Index should always be used as part of a broader trading system, combined with other indicators and price action analysis for confirmation.
Conclusion
The Force Index is a unique and highly insightful technical indicator in Pine Script for TradingView. Its integration of both price change and volume provides a powerful measure of the underlying buying and selling pressure in the market. Whether used for confirming trend strength, identifying momentum shifts through zero-line crossovers, or spotting potential reversals via divergence, the Force Index offers valuable insights. By understanding its calculation, thoughtfully tuning its parameters, and integrating it strategically with other technical analysis tools, you can leverage the Force Index to gain a deeper, volume-confirmed perspective on market dynamics and enhance your trading decisions.