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
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.