OPEN-SOURCE SCRIPT

Market Regime Flip (Dunk)

54
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.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.