Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // ©aeromircorp
- // VIX % Contango - VIX CBOE-VX1!
- //@version=5
- indicator("VIX % Contango", overlay=false)
- threshold = input.float(3.0, "Threshold")
- inp = input(close)
- VIX1 = request.security("VX1!", "", inp)
- VIX2 = request.security("VX2!", "", inp)
- oscillator = 100*(VIX2-VIX1)/VIX1
- var plotcolor = color.green
- if (oscillator > 3.0)
- plotcolor := color.green
- else if (oscillator >= 0.0)
- plotcolor := color.orange
- else
- plotcolor := color.red
- plot(oscillator, title="VIX % Contango", color=plotcolor, linewidth=2)
- hline(0, "Center", color=color.gray, linestyle=hline.style_dotted)
- hline(threshold, "", color=color.orange, linestyle=hline.style_dashed)
Add Comment
Please, Sign In to add comment