tradingview/inverse_vix_term_structure.pine

14 lines
369 B
Plaintext
Raw Normal View History

// Credit to @keberos007.
//@version=5
indicator("Inverse VIX Term Structure", shorttitle = "Inverse VIX", overlay = false)
vix = request.security("VIX", "D", close)
vix6m = request.security("VIX6M", "D", close)
vix_ratio = vix6m / vix
fastEMA = ta.ema(vix_ratio, 7)
slowEMA = ta.ema(vix_ratio, 12)
plot(fastEMA, color = color.blue)
plot(slowEMA, color = color.red)