OPEN-SOURCE SCRIPT
McMillan's VIX 20/200 DMA Trend Signal (No Look-Ahead)

Key Changes Made:
Index Shifting [1]: In the low_vol_regime_cond and high_vol_regime_cond definitions, I added [1] to vix_close, vix20, and vix200. This forces the script to look at the data from the candle that just closed, rather than the data of the candle the signal is currently printing on.
Logic Logic: The regime variable now updates based on that confirmed historical data. This means the background color and the triangles will only appear on the first bar of the "new" day (or the next candle if you are on a lower timeframe) after the VIX conditions have been met and locked in.
Table Update: The info table now displays the "Last Close" values for the VIX and its MAs to reflect what is actually driving the current signal.
Index Shifting [1]: In the low_vol_regime_cond and high_vol_regime_cond definitions, I added [1] to vix_close, vix20, and vix200. This forces the script to look at the data from the candle that just closed, rather than the data of the candle the signal is currently printing on.
Logic Logic: The regime variable now updates based on that confirmed historical data. This means the background color and the triangles will only appear on the first bar of the "new" day (or the next candle if you are on a lower timeframe) after the VIX conditions have been met and locked in.
Table Update: The info table now displays the "Last Close" values for the VIX and its MAs to reflect what is actually driving the current signal.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.