JPM VIX Signal - Non Overlay
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TsangYouJun, Richard
//@version=5

// Note:
// The buy signal is triggered when the Cboe Volatility Index (VIX) rises by more than 50% of its 1-month moving average.
// Use on SPY, Daily only

indicator("JPM VIX Signal - Non Overlay", overlay = false)

close_vs_1month_ma = (close / ta.sma(close, 30))
vix_close_vs_1month_ma = request.security("CBOE:VIX", "D", close_vs_1month_ma)
plot(vix_close_vs_1month_ma, title='JPM VIX Buy Signal', color=color.new(#00ffaa, 70), linewidth=2, style=plot.style_area)
hline(1.5, title='150%', color=color.blue, linestyle=hline.style_dotted, linewidth=2)