Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @author LazyBear
- // @credits Thomas Stridsman
- //
- //@version=5
- indicator("Volatility Quality Index", "c.VQI_LB", overlay=false, precision=0, explicit_plot_zorder=true)
- length_slow = input(9, title="Fast EMA Length")
- length_fast = input(200, title="Slow EMA Length")
- vqi_t = ((high - low) != 0) ? (((close - close[1]) / ta.tr(false)) + ((close - open) / (high - low))) * 0.5 : na
- vqi = math.abs(vqi_t) * ((close - close[1] + (close - open)) * 0.5)
- vqi_sum = ta.cum(vqi)
- plot(vqi_sum, color= color.new(#ff0000,0))
- plot(ta.sma(vqi_sum,length_slow), color=color.new(#008000,0))
- plot(ta.sma(vqi_sum,length_fast),color=color.new(#FF7F00,35))
Add Comment
Please, Sign In to add comment