OPEN-SOURCE SCRIPT

EMV

25
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
//version=5
indicator("EMV", overlay=false)

N = input.int(14, "N")
M = input.int(9, "M")

// ==== VOLUME ====
maVol = ta.sma(volume, N)
VOLUME = maVol / volume

// ==== MID ====
hl = high + low
MID = 100 * (hl - hl[1]) / hl

// ==== HL_RANGE ====
HL_RANGE = ta.sma(high - low, N)

// ==== EMV ====
EMV_raw = MID * VOLUME * (high - low) / HL_RANGE
EMV = ta.sma(EMV_raw, N)

// ==== MAEMV ====
MAEMV = ta.sma(EMV, M)


plot(EMV, color=color.blue, title="EMV")
plot(MAEMV, color=color.orange, title="MAEMV")

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.