PROTECTED SOURCE SCRIPT
Updated Magic Candle [MMT]

The Magic Candle [MMT] indicator is a dynamic price-action tool that visually and intuitively tracks trend bias shifts, entry signals, stop levels, and reversal triggers based on a custom candle-state logic. It is designed for traders seeking to identify actionable shifts in market structure and trend momentum, blending key elements of trend-following and reversal anticipation into one system.
Core Functionality
1: Flip Candidate and Trigger Logic:
For both bullish and bearish trends, the indicator identifies "flip candidate" candles – the most extreme, recent candle in the direction of the current trend. A "flip trigger" level is set at the high (for bearish) or low (for bullish) of this candidate. If price breaks decisively past this level, it signals a potential trend reversal, switching the indicator's bias and updating the tracked ranges and stop-loss points.
2: Entry and Stop-Loss Visualization:
Before entries, the indicator highlights the tracked high and low as "Entry" levels. Upon bias confirmation (break of the tracked level), a stop-loss line is automatically plotted at the opposite extreme of the tracked move for real-time risk guidance.
3: State Table Panel:
A dedicated on-chart table summarizes, in real time: current state (trend bias), active stop-loss level, entry reference level, and the present flip trigger. This offers at-a-glance status updates for systematic trade management.
Practical Usage
Momentum Confirmation:
Stay synchronized with price momentum by entering long or short once tracked highs or lows are broken, aligning trades with confirmed directional moves. Best to use in a confirmed trend direction.
Reversal Alerts:
The flip trigger logic allows traders to anticipate potential reversals, with visual cues and optional labels that remove guesswork at possible shift points.
Risk Management:
Fully integrated stop-loss plotting supports disciplined trade management, setting stop points based on recent price extremes to correspond with current bias and volatility.
This indicator benefits traders looking to combine the clarity of structured price-action logic with robust automation, suitable for many timeframes and all liquid instruments.
Core Functionality
1: Flip Candidate and Trigger Logic:
For both bullish and bearish trends, the indicator identifies "flip candidate" candles – the most extreme, recent candle in the direction of the current trend. A "flip trigger" level is set at the high (for bearish) or low (for bullish) of this candidate. If price breaks decisively past this level, it signals a potential trend reversal, switching the indicator's bias and updating the tracked ranges and stop-loss points.
2: Entry and Stop-Loss Visualization:
Before entries, the indicator highlights the tracked high and low as "Entry" levels. Upon bias confirmation (break of the tracked level), a stop-loss line is automatically plotted at the opposite extreme of the tracked move for real-time risk guidance.
3: State Table Panel:
A dedicated on-chart table summarizes, in real time: current state (trend bias), active stop-loss level, entry reference level, and the present flip trigger. This offers at-a-glance status updates for systematic trade management.
Practical Usage
Momentum Confirmation:
Stay synchronized with price momentum by entering long or short once tracked highs or lows are broken, aligning trades with confirmed directional moves. Best to use in a confirmed trend direction.
Reversal Alerts:
The flip trigger logic allows traders to anticipate potential reversals, with visual cues and optional labels that remove guesswork at possible shift points.
Risk Management:
Fully integrated stop-loss plotting supports disciplined trade management, setting stop points based on recent price extremes to correspond with current bias and volatility.
This indicator benefits traders looking to combine the clarity of structured price-action logic with robust automation, suitable for many timeframes and all liquid instruments.
Release Notes
Bug fix: Missing an edge case where triggered candle is flipped back to backProtected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
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.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
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.