// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © goodgains
//@version=5
indicator("EFI Normalized", timeframe="", timeframe_gaps=true)
// @keywords: elder-force-index, force-index, volume-weighted, normalized-oscillator, ema-smoothing, histogram, zero-line, price-change, volume-multiplier, column-plot, oscillator-pane, lookback-range, percent-scale, momentum-force, elder-indicator, volume-validation, normalized-range, force-momentum, price-volume, elder-efi
var cumVol = 0.
cumVol += nz(volume)
if barstate.islast and cumVol == 0
runtime.error("No volume is provided by the data vendor.")
length = input.int(13, minval=1)
efi = ta.ema(ta.change(close[1]) * volume[1], length)
xMax = ta.highest(efi, 2000)
xMin = ta.lowest(efi, 2000)
xrange = xMax - xMin
y = 100 * efi / xrange
plot(efi, color=#F44336, title="Elder Force Index", style = plot.style_columns)
hline(0, color=#787B86, title="Zero")