OPEN-SOURCE SCRIPT
Market Regime Flip (Dunk)

This indicator is a trend regime flip tool built on top of MACD. Instead of reacting to every little wiggle, it waits for several bars in a row where the MACD stays either above or below zero (by default, 3 consecutive bars). When the MACD has been above zero for 3 bars, it declares a bull regime and marks that bar on the price chart with a green “BULL” triangle above the candle. When the MACD has been below zero for 3 bars, it declares a bear regime and marks that bar with a red “BEAR” triangle below the candle. It also lightly colors the chart background green in bull regimes and red in bear regimes, so you can see at a glance which side of the market you’re in.
In other words, it turns the MACD’s usual “above/below zero” behavior into a clean, slower-changing on/off regime switch. Instead of giving you constant signals, it focuses on the moments where momentum truly shifts and sticks around for a few bars, helping you avoid getting faked out by single-bar noise. The alerts are wired to those flip moments, so you can get notified when the market transitions from bearish to bullish (or vice versa) according to this MACD-based regime logic.
In other words, it turns the MACD’s usual “above/below zero” behavior into a clean, slower-changing on/off regime switch. Instead of giving you constant signals, it focuses on the moments where momentum truly shifts and sticks around for a few bars, helping you avoid getting faked out by single-bar noise. The alerts are wired to those flip moments, so you can get notified when the market transitions from bearish to bullish (or vice versa) according to this MACD-based regime logic.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.