Smart Chandelier Exit
- Indicators
- Version: 1.4
- Updated: 13 August 2026
Smart Chandelier Exit
Smart Chandelier Exit is an adaptive trailing-stop and trend-direction indicator. It plots a multi-layer ratchet stop line that follows price: green below price in an uptrend, red above price in a downtrend. The line only ever ratchets in the trend's favor, never against it, so it doubles as a mechanical trailing stop and a clear trend-state signal.
What makes it smart is the built-in Pearson R trend-quality filter. A raw stop line tells you where the stop is; the Pearson R engine tells you how strong the current trend actually is (strong, moderate, weak, or ranging noise). Both are shown together on a compact on-chart panel, along with rolling statistics that separate genuine trend flips from short-lived fake flips.
The indicator is non-repainting: the stop line is computed on closed bars with a one-directional ratchet, alerts fire only on a closed bar, and flip arrows are confirmed after a fixed number of bars so an arrow never appears and then disappears. What you see in history is what you would have seen live.
Release notes, chart examples and new product announcements are posted on the TrendTower channel: https://www.mql5.com/en/channels/trendtower
What You See on the Chart
Layered Glow Stop Lines
The active stop direction is rendered using layered glow rendering consisting of an outer background halo, an inner mid corona, and a sharp core line marking the precise stop level. Line colors shift automatically across six market regimes based on Pearson R trend quality: Bright Emerald for Strong UP, Soft Green for Moderate UP, Amber for Weak trends, Cool Gray for RANGING markets, Soft Red for Moderate DOWN, and Bright Crimson for Strong DOWN. Only the active stop direction is drawn, leaving the inactive side hidden to keep the chart clean.
Fill Band Shadow Zone
A subtle shaded volatility band approximately 0.4 × ATR wide hugs the active stop line. A dark green shadow appears below the bullish stop line and a dark red shadow appears above the bearish stop line, providing an instant visual cue of the danger zone relative to price.
Why the Halo Starts One Bar Late
The two glow layers and the fill band begin on the second bar of a direction run, while the sharp core line is drawn from the first bar. This is deliberate. Price sometimes closes a hair past the stop and recovers on the very next bar: that is a genuine one-bar stop-out, and the core line still marks it. Without this rule the same single bar would also paint a wide halo and a band of the opposite colour across the chart, which reads as a rendering glitch rather than as information. The test looks only one bar backwards, so no closed bar ever changes afterwards and the non-repainting guarantee is unaffected. On a normal trend the only visible effect is that the halo begins one bar after the core line.
Confirmed Flip Arrows
Confirmed direction flips can be marked on the chart with green up-arrows below bullish flip bars and red down-arrows above bearish flip bars. Arrows are rendered only after a flip maintains its direction continuously for Fake Flip Bars, guaranteeing non-repainting behavior. Arrow width encodes trend quality at the flip moment, with a small numerical Pearson R label printed next to each arrow.
Arrows always alternate between bullish and bearish. When an opposite flip in between was tagged FAKE and therefore never drawn, the confirmed direction never visibly left the previous side, so the next same-way flip is a duplicate rather than a new signal and no second arrow appears. Nothing is lost by this: the flip remains in the Direction buffer that EAs read, and it still counts towards the Fake Flips percentage on the panel.
Info Dashboard Panel
An optional Bloomberg-style on-chart panel is displayed in the selected chart corner. It provides section header accents, a two-column grid layout, and a live calculation indicator.
Placing the Panel
Pick a starting corner with Panel Corner and nudge it with the X / Y offsets. All four corners render the same layout; the panel keeps itself inside the chart and follows its corner when the window is resized.
You can also drag it. Press the left mouse button anywhere on the panel body and move: the whole panel follows the cursor and the chart does not scroll while you drag. The position you release it at is remembered per symbol and timeframe, so it survives removing and re-adding the indicator and restarting the terminal. To send the panel back to a corner, change the Panel Corner input; that clears the stored manual position. Set Panel Draggable to false to lock it in place. The panel is never selectable, so it cannot be nudged with the arrow keys or deleted from the object list by accident.
Panel and Indicator Readouts
Setup Section
Pearson R measures the correlation coefficient between price and time over the last R Period bars on a scale of −1.0 to +1.0. Strength Bar displays absolute correlation magnitude across 10 segments. Regime converts correlation into plain-language classifications (Strong, Moderate, Weak, RANGING). ATR Base echoes the active ATR period and multiplier settings.
Execution Section
Direction shows current active status (BULLISH or BEARISH). Stop Level shows the exact price of the active stop line at full symbol precision. Distance displays the gap between price and stop in price units and ATR multiples.
Insights Section
Fake Flips shows the share of recent flips that reversed within the confirmation window over a 50-flip sample. Risk Thermometer converts this percentage into a 10-segment risk gauge (LOW below 20%, MED 20–40%, HIGH above 40%). Bars Since tracks how many bars have passed since the active direction began.
Panel Footer
The bottom line of the panel prints the running version and brand, currently "v1.4 • algoteknik". Use it to confirm at a glance which build is attached to the chart.
Calculation Mechanics & EA Integration
Long stops sit at highest-high minus ATR multiplied by Multiplier, while short stops sit at lowest-low plus ATR multiplied by Multiplier. The indicator exposes two hidden data buffers for EA developers via iCustom: Buffer 10 returns direction (+1 for Bullish, −1 for Bearish), and Buffer 11 returns the raw Pearson R correlation coefficient.
Input Parameters Reference
CE Parameters
InpATRPeriod: Default 22. ATR period used to size the stop distance.
InpLookback: Default 22. Bars used for highest-high / lowest-low calculation.
InpMultiplier: Default 3.0. ATR multiplier; larger values produce wider stops and fewer flips.
Pearson R (Trend Quality)
InpRPeriod: Default 22. Lookback period for price-versus-time correlation.
InpRStrongLevel: Default 0.7. Correlation threshold at or above which regime reads Strong.
InpRModerateLevel: Default 0.5. Correlation threshold at or above which regime reads Moderate.
Fake Flip Detection
InpFakeFlipBars: Default 5. Window length in bars within which a flip reversal is tagged fake.
Performance & Limits
InpMaxBars: Default 5000. Maximum historical bars processed (0 = all history).
InpMaxArrows: Default 100. Maximum flip arrows retained on chart (0 = unlimited).
Visual & Panel
InpShowPanel: Default true. Toggles info dashboard display.
InpShowFlips: Default true. Toggles confirmed flip arrows.
InpPanelDraggable: Default true. Allows the panel to be dragged with the mouse and remembers where you drop it. Set to false to lock the panel to its corner.
InpPanelCorner: Default Top Left. Starting corner for the info panel. Changing it also clears any manually dragged position.
InpPanelTheme: Default Dark Obsidian. Visual color theme.
InpCornerX / InpCornerY: Default 20 / 20. Panel pixel offset from the selected corner.
InpUnitMode: Default Auto. Units for the Distance readout. Auto uses pips on Forex symbols and the raw price difference on indices, crypto and shares, because MT5 points are misleading on those instruments. Can be forced to Pip or Point.
Alerts
These fire on the raw direction flip, on the close of the bar where direction changed. They do not wait for the Fake Flip Bars confirmation, so an alert can arrive for a flip that is later tagged FAKE. Treat them as an early warning, and read the Regime row and Fake Flips gauge before acting.
InpAlertOnFlip: Default false. Terminal pop-up alert on a raw flip.
InpPushOnFlip: Default false. Mobile push notification. Requires a MetaQuotes ID configured in the terminal (Tools > Options > Notifications). Can be enabled independently of the pop-up.
InpMailOnFlip: Default false. Email alert. Requires SMTP settings configured in the terminal (Tools > Options > Email).
Confirmed Arrow Alerts
These fire at the moment a confirmed arrow is actually drawn, which is the filtered event: the flip has held its direction for Fake Flip Bars and it alternates with the previous arrow. They arrive later than the raw flip alerts above but carry no FAKE flips. The two sets are independent — enable either, both, or neither. Nothing fires while history is being drawn, so adding the indicator to a chart is silent no matter how many past arrows appear.
InpAlertOnArrow: Default false. Terminal pop-up when a confirmed arrow is drawn.
InpPushOnArrow: Default false. Mobile push notification on a confirmed arrow.
InpMailOnArrow: Default false. Email alert on a confirmed arrow.
Suggested Use & Disclaimer
- Trade in the direction of the active glow line: green for longs, red for shorts.
- Confirm signal quality when the panel displays Strong or Moderate regime status.
- Use the ratchet stop line as a mechanical trailing stop that never loosens.
- Evaluate Fake Flips risk gauge before entering fresh flips.
Questions, bug reports and feature requests are welcome on the TrendTower channel: https://www.mql5.com/en/channels/trendtower
This is an indicator for analysis and decision support. It does not place trades. Always test thoroughly before using any tool in live trading. Trading involves risk.


Really liking this MT5 indicator so far. It’s clean, easy to read, and gives a lot of useful information without making the chart too cluttered. The trend direction, fake flips, ATR, and execution levels are especially helpful. The recent panel positioning fix is also a nice improvement. Overall, a really solid indicator!