From f23c0e47c394e76145bd1db0d1346cdf044f254c Mon Sep 17 00:00:00 2001 From: moshferatu Date: Tue, 31 Oct 2023 09:55:36 -0700 Subject: [PATCH] Add inverse VIX term structure indicator --- inverse_vix_term_structure.pine | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 inverse_vix_term_structure.pine diff --git a/inverse_vix_term_structure.pine b/inverse_vix_term_structure.pine new file mode 100644 index 0000000..0e01773 --- /dev/null +++ b/inverse_vix_term_structure.pine @@ -0,0 +1,14 @@ +// 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) \ No newline at end of file