cnws02

c.VQI_LB

Oct 7th, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. // @author LazyBear
  2. // @credits Thomas Stridsman
  3. //
  4. //@version=5
  5. indicator("Volatility Quality Index", "c.VQI_LB", overlay=false, precision=0, explicit_plot_zorder=true)
  6.  
  7. length_slow = input(9, title="Fast EMA Length")
  8. length_fast = input(200, title="Slow EMA Length")
  9.  
  10. vqi_t = ((high - low) != 0) ? (((close - close[1]) / ta.tr(false)) + ((close - open) / (high - low))) * 0.5 : na
  11. vqi = math.abs(vqi_t) * ((close - close[1] + (close - open)) * 0.5)
  12.  
  13. vqi_sum = ta.cum(vqi)
  14.  
  15. plot(vqi_sum, color= color.new(#ff0000,0))
  16. plot(ta.sma(vqi_sum,length_slow), color=color.new(#008000,0))
  17. plot(ta.sma(vqi_sum,length_fast),color=color.new(#FF7F00,35))
  18.  
Add Comment
Please, Sign In to add comment