TradingView indicator guides

Elder Force Index on TradingView: Formula and Limits

The Force Index indicator multiplies each close-to-close price change by that bar's volume. Elder Force Index (EFI) usually smooths this raw series with an exponential moving average. TradingView defaults to 13 bars. Use the raw value to inspect a single bar and the EMA to inspect its weighted history.

Raw force = (close − previous close) × volume

EFI(N) = EMA(raw force, N)

EFI(1) = raw force

A positive smoothed EFI does not require the latest close to rise. The calculation below shows why. Alexander Elder introduced the indicator in his 1993 book Trading for a Living, as documented by TradingView.

A six-bar calculation you can check

These are hypothetical closes and volume units, not market data or a backtest. A is the start of the dataset, so it has no previous close. Seed the EMA with the first available raw force at B. For N = 13, alpha = 2 / (13 + 1) = 1 / 7. Each later value is raw force / 7 + previous EMA × 6 / 7. Calculations retain full precision; the table rounds to two decimals.

Hypothetical raw Force Index and EMA 13 values
BarCloseVolumeClose changeRaw / EFI(1)EFI(13)
A100.00100UnavailableUnavailableUnavailable
B101.00200+1.00+200.00+200.00 (seed)
C100.50300-0.50-150.00+150.00
D100.504000.000.00+128.57
E99.501,000-1.00-1,000.00-32.65
F100.00200+0.50+100.00-13.70
Hypothetical example: raw force is negative at C while EMA 13 stays positive; EMA turns negative at E and stays negative at F

At C, (-150 + 6 × 200) / 7 = 150: a down close leaves EFI positive. At D, an unchanged close gives zero raw force despite 400 volume units, while the EMA decays. At F, the up close produces +100 raw force but the previous negative EMA keeps EFI below zero. The two series can disagree without a calculation error.

Initial history matters. Seeding B with zero instead of its raw force would produce 28.57 at B, changing every later value. Compare implementations with the same loaded history and initialization policy; a 13-period EMA is a recursive average, not a window that discards everything older than 13 bars.

Copy the Pine Script v6 indicator

Paste the complete source into Pine Editor and add it to a standard candlestick chart. The blue line is EFI; optional gray columns show raw force. The script uses the current chart's close and volume and has no orders or automatic divergence detection.

Pine Script v6 · indicator
// This source code is subject to the Mozilla Public License 2.0.
// https://mozilla.org/MPL/2.0/
// © Pineify
//@version=6
indicator("Elder Force Index: raw and EMA", overlay=false)

length = input.int(13, "EMA length", minval=1)
showRaw = input.bool(false, "Show raw force")

// Strict data policy: missing volume is not zero volume.
if na(volume)
    runtime.error("Volume is missing on this feed. Select a feed with volume.")
var float totalVolume = 0.0
totalVolume += nz(volume)
if barstate.islast and totalVolume == 0
    runtime.error("No nonzero volume is available in this dataset.")

rawForce = (close - close[1]) * volume
smoothedForce = ta.ema(rawForce, length)
efi = length == 1 ? rawForce : smoothedForce

plot(efi, "EFI", color=color.blue, linewidth=2)
plot(showRaw ? rawForce : na, "Raw force", color=color.new(color.gray, 40), style=plot.style_columns)
hline(0, "Zero", color=color.gray)

crossUp = ta.crossover(efi, 0)
crossDown = ta.crossunder(efi, 0)
alertcondition(crossUp and barstate.isconfirmed, "EFI above zero at close", "EFI crossed above zero on a closed bar.")
alertcondition(crossDown and barstate.isconfirmed, "EFI below zero at close", "EFI crossed below zero on a closed bar.")

The first raw value is unavailable because close[1] does not exist at the dataset's first bar. The EMA starts when a valid raw value is available. Missing volume stops this example instead of being replaced with zero. An isolated reported zero is allowed; an entirely zero-volume dataset is rejected.

The plotted value updates while a bar is open. The two alert conditions require barstate.isconfirmed. Create the alert in TradingView and select Once Per Bar Close. This confirms the bar's calculation; it does not establish that the following price move will agree with the signal.

InputDefaultEffect
EMA length13, minimum 11 exposes raw force. Higher values give each new bar less weight.
Show raw forceOffAdds columns for auditing; a large spike can compress the visible EMA scale.

Separate trend confirmation from a pullback trigger

A filter decides which conditions qualify for further review. A trigger identifies a particular bar. Keeping those roles separate makes the rules testable. The examples here are candidate research rules, with no claimed trading performance.

Trend filter

Require EFI(13) > 0 on a closed bar for a positive-force filter. Add a separately specified price-trend rule if needed. This condition can remain true across many bars and is not itself a fresh entry event.

Pullback trigger

One testable long-side candidate is EFI(13) > 0 while raw force crosses from at or below zero to above zero at the close. It asks whether a short negative contribution has ended inside a positive smoothed regime. It can repeatedly trigger in a range, and a pullback may become a full reversal.

Divergence review

Choose raw or smoothed force before comparing swings. Pair EFI values at two defined price-pivot bars. A lower price low with a higher EFI reading is a bullish divergence. With three right-hand bars required, the second pivot is only known three bars later. A zero cross after that is an additional event, not proof of a reversal.

Before testing trades, define exits, position size, fill timing, commission and slippage. This page provides indicator calculations and research examples, not investment advice or a validated strategy.

Volume units, missing data and unusual bars

EFI has units of price change multiplied by the feed's volume unit. It is not a percentage or a direct cash-flow total. Stock volume can be shares, futures volume contracts and crypto volume base-asset units; check the specific provider rather than assuming every chart reports the same quantity.

  • Scale: doubling every volume value doubles raw force and the identically seeded EMA. Converting volume to thousands divides both by 1,000. Zero-cross timing is unchanged by a constant positive scale factor, but fixed numeric thresholds must change.
  • Missing versus zero: no available volume is na in Pine. A reported zero gives zero raw force when closes exist. Do not quietly substitute one for the other. This example deliberately stops on any missing volume in the loaded history.
  • A volume outlier: check the source bar before removing it. A genuine news bar belongs in the original formula. Capping volume creates a modified indicator. With EMA 13, an added raw-force shock of 700 adds 100 to that bar's EMA and about 85.71 to the next, if every later input is unchanged.
  • Feed and session changes: keep the exchange, contract, adjustment and session choices fixed during comparison. A broker's tick-count feed is not equivalent to exchange trade volume. Contract rolls and price adjustments can alter close-to-close changes.
  • Chart type: synthetic closes on Heikin Ashi or Renko charts change the input. Audit on standard candles first. Open-bar close and accumulated volume can both change until the bar ends.

TradingView's chart-information documentation describes volume units, unavailable values and synthetic prices. The scaling and outlier examples are direct calculations from this page's formula.

Turn the calculation into an explicit script request

Use Pineify's Pine Script AI Coding Agent to adapt the inputs and confirmation rules. Give it a specification that can be checked against the table, then review the generated source on the intended TradingView feed.

  1. Open the Pine Script AI Coding Agent and supply the source on this page.
  2. Specify close-to-close change, the feed's volume unit and the EMA length.
  3. State whether missing volume should stop execution, and require alerts only at bar close.
  4. Compare raw force and EMA values bar by bar before adding pivot or trend rules.
  5. Define strategy exits, costs and fills separately if converting the indicator into a backtest.
Customize EFI in Pineify

Force Index questions

It measures closing-price change multiplied by the volume reported for that bar. Raw force changes sign with the close-to-close move when volume is positive. The smoothed Elder Force Index applies an EMA to that series. Its sign describes the weighted history of raw force, so a positive EFI can coexist with a falling close. It does not measure buyer-initiated order flow or prove that a move will continue.

Search for Elder Force Index in the Indicators menu, or paste this page's complete Pine Script v6 example into Pine Editor and add it to the chart. Start with length 13 and enable Show raw force to compare the two series. Use standard candles, the same symbol feed, session, timeframe and history when comparing implementations. The example stops with an error if a loaded bar has missing volume.

Length 1 gives the unsmoothed price-change-times-volume series. Length 13 applies EMA weighting with alpha equal to 2 / 14, or 1 / 7. The latest valid observation receives one-seventh of the updated value; the previous EMA receives six-sevenths. A period is a chart bar, not necessarily a day. Thirteen is TradingView's default, not evidence of an optimal trading parameter.

EMA smoothing carries previous positive force into the current value. In the hypothetical table, a raw force of -150 follows a seeded EFI of 200. The 13-period update is (-150 / 7) + (200 × 6 / 7) = 150. The close fell, but the smoothed series is still positive. Read raw force when checking the current bar's signed price-volume contribution.

The original formula requires volume. Missing volume and a reported zero are different inputs: replacing missing values with zero invents a zero-force observation and changes the EMA. This example rejects missing volume and an entirely zero-volume dataset. An isolated reported zero is accepted and produces zero raw force when both closes exist. A price-only fallback would be a different indicator and should be named accordingly.

No. A lower price low paired with a higher EFI low describes a bullish divergence; the inverse describes a bearish divergence. Either can persist while price continues in the existing direction. A script must define how it pairs swings and when a pivot becomes known. Requiring three bars to the right of a pivot delays confirmation by three bars. A marker drawn back on the pivot must not be treated as an earlier tradable signal.

Its absolute values are not directly comparable across instruments. Price units, contract conventions, volume units, exchange feeds and bar durations affect the scale. Even on one instrument, changing volume from units to thousands divides every EFI value by 1,000. Keep the feed and units fixed when testing thresholds. For a crypto pair, identify whether the feed reports base-asset or quote-currency volume before interpreting its magnitude.

Force Index multiplies the size of each close-to-close change by volume and can smooth the result. OBV accumulates positive volume on up closes and negative volume on down closes, without weighting by the size of the price change. With the same 200 units of volume, price rises of 1 and 5 contribute 200 and 1,000 to raw force; both add 200 to OBV. The scales answer different questions.