Polarity Flip
Free Polarity Flip indicator for MT5: draws S/R zones and arrows when a broken level is retested. Lab: 0 of 206 arrows repainted on EURUSD M15.

- Repainted
- 0 / 206
- Signals / week
- ≈ 16.2
- Tested on
- EURUSD M15
- Tested
- 2026-10-04
Overview
For breakout traders who would rather enter on the pullback to a level than chase the breakout bar: Polarity Flip is a free MT5 indicator that draws support and resistance zones on the main chart. It places an arrow on the closed bar where price comes back to a broken level and holds on the other side. In the Lab's repaint test on EURUSD M15, 0 of 206 arrows changed after they appeared, and no arrow printed late (0 bars delay).
What a polarity flip is
A polarity flip (also called a support and resistance flip) happens when old resistance is broken and then acts as support, or when old support breaks and turns into resistance. This tool finds that retest for you on every level it tracks. It does not try to teach the concept.
What it draws on your chart
- SR Flip Levels: rectangles built from swing highs and lows. If you set ShowZones to false, each level becomes a single line. Swings that land close together merge into one level, and each merged swing counts as an extra touch.
- Bullish Flip arrow (buffer 0) and Bearish Flip arrow (buffer 1): a broken level that has been retested and confirmed.
- Flip Stats panel: the last confirmed flip, the active levels and the levels still waiting for a retest, the panel's own flip success rate (the tool's own tally, not the Lab's 46.1% result), and the nearest levels above and below price.
A level is removed when no closed bar touches it for LevelExpiryBars bars. It is also hidden when it falls outside the top MaxLevelsShown levels. Levels are ranked by touch count first, then by most recent break.
How the Lab tested it
The Lab ran version 1.00 on MT5 build 6230. The test used EURUSD M15 from 2026-07-06 to 2026-10-02 with Raw Trading Ltd real ticks. Every arrow was logged as it appeared and then compared with the finished history, which is how the Lab got the repaint result above. For each arrow the Lab then checked which happened first: price moving 1 ATR in the arrow's direction, or 1 ATR against it.
What the numbers mean for you
- 46.1% of arrows reached 1 ATR in their direction before 1 ATR against. That is slightly worse than a coin flip. On its own, the arrow is not an edge.
- Bullish flips did better than bearish ones on this sample (see the chart below).
- The median arrow hit one side or the other within 2 bars. Only 0.5% hit neither side within 20 bars. On M15, half of the arrows are decided within about 30 minutes (2 bars).
- The Lab counted 16.2 arrows a week on one pair, roughly three per trading day: 7.4 bullish and 8.8 bearish.
Here is the 1-ATR-first result split by arrow direction:
Scale zoomed in to show the difference (bars do not start at zero).
How it works
- 1
- 2Pivots close to an existing level merge into it, averaging the price and adding a touch.
Merge if abs(pivot - level) <= MergeATRMult x ATRInputs: MergeATRMult - 3A level breaks when a bar closes beyond it by a buffer measured in ATR.
Break: Close > level + BreakBufferATR x ATR (resistance)Inputs: BreakBufferATR - 4In the retest window, touching the level and closing on the new side confirms the flip. Closing back across fails.Inputs: RetestWindowBars
- 5Levels with no touch for the expiry number of bars are removed.Inputs: LevelExpiryBars, MaxLevelsShown
Specifications
- Platform
- MetaTrader 5
- Version
- 1.00
- Type
- Indicator
- Window
- Main chart
- Draws
- 2 arrows, 1 zone, 1 panel
- Alerts
- popup, push, sound
- Repaints
- No (0 of 206 signals changed)
- Inputs
- 15
- Tested on
- MT5 build 6230 · 2026-10-04
Repaint test
No repaint detected. In a 6 Jul 2026 – 2 Oct 2026 test on EURUSD M15 (Raw Trading Ltd real ticks), 206 signals were logged at bar close and re-read at the end of the test: 0 changed. Arrows print on the bar that closes the signal, with no delay.
IndicatorFree — tested 2026-10-04 · MT5 build 6230 · Raw Trading Ltd real ticks. Results come from historical data, not live trading, and do not guarantee future results.
Signal statistics
Over 6 Jul 2026 – 2 Oct 2026 on EURUSD M15, the indicator printed 206 arrows. After 46.1% of them, price moved 1×ATR(14) in the arrow's direction before moving 1×ATR against it (median 2 bars). 0.5% reached neither level within 20 bars.
This measures price movement after the arrow, not a trading result. It includes no spread, commission, stop loss or position sizing.
What it draws
- Arrows (Bullish Flip) from buffer 0, drawn on the closed bar.
- Arrows (Bearish Flip) from buffer 1, drawn on the closed bar.
- Rectangles (SR Flip Levels) drawn as chart objects, not buffers — they are not readable by iCustom() in an EA.
- An on-chart panel (Flip Stats); values shown in the panel are not exposed as buffers.
Inputs
| Input | Default | What it does |
|---|---|---|
| LeftBars | 5 | Bars on the left to confirm a swing high/low (2-15) |
| RightBars | 5 | Bars on the right to confirm a swing (2-15), also the pivot delay |
| ATRPeriod | 14 | ATR period used as the tolerance yardstick (5-50) |
| MergeATRMult | 0.25 | ATR multiple to merge nearby pivots into one level and size the retest zone |
| BreakBufferATR | 0.15 | ATR multiple a close must clear beyond the level to count as a break |
| RetestWindowBars | 20 | Bars after a break to wait for the retest (5-100) |
| LevelExpiryBars | 150 | Remove a level after this many bars without any touch (30-500) |
| MaxLevelsShown | 6 | Max levels drawn (priority: touch count, then most recent break) |
| ShowZones | true | Draw a zone rectangle around each level (false = a single line) |
| EnableAlertPopup | true | Popup alert when a level breaks and when a flip is confirmed |
| EnableAlertPush | false | Push notification when a flip is confirmed |
| EnableAlertSound | true | Play a sound when a flip is confirmed |
| PanelScale | 1 | Panel size multiplier (DPI is applied automatically) |
| Theme | Dark | Chart color theme |
| RestoreTheme | true | Restore the original chart colors when removed |
How to read it
Install: copy the 137.1 KB .ex5 file into MQL5 > Indicators (File > Open Data Folder), refresh the Navigator and drag Polarity Flip onto a chart.
How a level is built
The tool marks swing highs as resistance and swing lows as support. A swing needs LeftBars bars on its left and RightBars bars on its right. Because the right-side bars must close first, a new level appears RightBars bars after the swing, which is 5 bars on the defaults. This is a built-in delay, not repainting.
A new swing within MergeATRMult × ATR of an existing level joins that level. The level price is averaged with the new swing, and the level gets one more touch. The same multiple sets how tall the retest zone is.
How one flip forms
- Break: a bar closes beyond the level by more than BreakBufferATR × ATR: above resistance for a bullish break, below support for a bearish one. You get a popup here, but no arrow.
- Retest window: the tool now watches the next RetestWindowBars bars.
- Confirmed flip: for a bullish flip, a later closed bar's low touches the level zone and the bar closes above the level. The arrow prints on that bar. A bearish flip is the mirror image: the high touches the zone and the bar closes below.
- Failed or unconfirmed: if a bar closes back across the level, the flip fails. If no bar qualifies inside the window, no arrow appears.
The picture below shows a bullish flip step by step:
A common misread
If a candle spikes above a level and then closes back below it, that is not a break. The close has to clear the level by the full ATR buffer. Traders who see price trade through a line and expect an arrow are reading the wick, not the close. A second trap is a level that broke a long time ago. Once RetestWindowBars bars have passed, a later touch of that zone will not produce an arrow.
Inputs to change first
- RetestWindowBars (default 20, range 5-100): this input has the biggest effect on how many arrows you see. A lower value keeps only quick retests and gives fewer arrows. A higher value also confirms retests of older breaks.
- LeftBars / RightBars (default 5 each, range 2-15): higher values find fewer, larger swings. A higher RightBars also makes each new level appear later.
- BreakBufferATR (default 0.15): raise it to ignore marginal closes through a level. Lower it to count smaller breaks.
- MergeATRMult (default 0.25): higher values merge more swings into each level and make the retest zone taller.
- LevelExpiryBars (default 150, range 30-500) and MaxLevelsShown (default 6): use these to control clutter. Fewer bars or fewer levels give a cleaner chart.
- ATRPeriod (default 14, range 5-50): the ATR length that sets the size of every buffer and zone.
- ShowZones, PanelScale, Theme and RestoreTheme change only how the tool looks.
Alerts
- EnableAlertPopup (on): a popup in the MT5 Alert window when a level breaks and when a flip is confirmed.
- EnableAlertSound (on): a sound when a flip is confirmed.
- EnableAlertPush (off): a push notification to your phone when a flip is confirmed.
Only the confirmed flip means the setup is ready to judge.
A decision rule to start from
This rule has not been tested by the Lab. Use it as a starting point:
- Take a Bullish Flip only if the arrow bar has closed, your own read of the trend points up, and the panel's nearest level above is at least 1 ATR away.
- Skip arrows that fire straight into another zone.
- Treat a close back below the level as the trade being wrong. That is the same condition the tool uses to mark a flip as failed.
- Use the mirror rule for a Bearish Flip.
Installation
- 1Download SR_Flip.ex5 from the button above (Google Drive).
- 2In MetaTrader 5: File → Open Data Folder → MQL5 → Indicators. Copy SR_Flip.ex5 there.
- 3Restart MT5 or right-click Indicators in Navigator → Refresh.
- 4Drag Polarity Flip onto a chart. For push alerts, enable "Allow push notifications" under Tools → Options → Notifications.
- Tested on MT5 build 6230.
Key terms and guides
- Average True Range
- Average True Range (ATR) is a volatility indicator that shows how far price typically moves per candle, gaps included, averaged over a set number of candles. It measures the size of moves, not their direction.
- Indicator buffer
- An indicator buffer is the list of numbers an indicator stores, one value per candle, for each line, histogram or arrow it draws. Expert Advisors and alerts read these buffers to get the indicator's values.
- Every tick based on real ticks
- Every tick based on real ticks is the MT5 Strategy Tester mode that replays the actual bid and ask ticks your broker recorded, with the real changing spread, instead of ticks the tester invents from 1-minute bars.
- Pullback
- A pullback is a short, temporary move against the main trend: price dips during an uptrend or rallies during a downtrend, then turns back the trend's way. Traders use it to enter a trend at a better price.
- Win rate
- Win rate is the share of your closed trades that ended in profit: winning trades divided by total trades, times 100. On its own it does not show whether a strategy makes money, because it ignores how big the wins and losses are.
- Support
- Support is a price zone where a falling market has stopped and turned higher more than once because buyers stepped in there. Traders use it to choose where to buy, and they put the stop loss just below the zone so a clean break ends the trade.
More on this subject: Supply, demand & key levels guide, terms and tools
User reviews
No reviews yet. Members who download the tool can review it here.
Sign in and download the tool to review it.
Build a checklist with it
Polarity Flip does one job on the chart: zone / level. Put it on the same chart as the tools below and the IndicatorFree panels merge into one checklist card, ordered trend, zone, signal, risk.
- Trend / contextMoving Average FlowAdds the trend side: which way the market leans before you act on Polarity Flip.
- Entry signalInside Bar BreakoutAdds the entry signal: the moment to act once Polarity Flip has set the scene.
The Lab has not tested these combinations. Each tool is tested on its own; the card only lines up what each one says. Free members get 2 new tools a day. If one has to wait until tomorrow, install BlackBox to raise the limit to 5 a day (20 on a live account).
FAQ
Does Polarity Flip repaint?
No repaint detected. In a 6 Jul 2026 – 2 Oct 2026 test on EURUSD M15 (Raw Trading Ltd real ticks), 206 signals were logged at bar close and re-read at the end of the test: 0 changed. Arrows print on the bar that closes the signal, with no delay.
Can I use Polarity Flip in an EA?
Yes. Read buffer 0 (Bullish Flip) with iCustom() on bar 1 — the last closed bar.
Why can’t my EA read the zones?
Zones and the panel are chart objects, not indicator buffers, so iCustom() does not return them.
How do I get alerts on my phone?
Enter your MetaQuotes ID under Tools → Options → Notifications, tick "Enable push notifications", and keep the push alert input on.
Does it work on other pairs?
Tested on EURUSD only; other symbols not tested.
Why did I get a popup but no arrow?
The popup also fires when a level first breaks. The arrow appears only after a later closed bar retests the zone and closes on the new side within RetestWindowBars. If price never comes back, or closes back across the level, there is no arrow.
Which pairs and timeframes does Polarity Flip work on?
It attaches to any MT5 symbol and timeframe, and the Lab's screenshots show it on M5 and H4 as well as M15. The Lab's statistics cover only EURUSD M15, so treat every other market as untested until you have checked it on your own charts.
How do I get flip alerts on my phone?
Set EnableAlertPush to true. MT5 also needs your MetaQuotes ID entered under Tools > Options > Notifications. Push alerts are sent only for confirmed flips, not for breaks.
Can an Expert Advisor read the arrows?
Bullish Flip arrows sit in buffer 0 and Bearish Flip arrows in buffer 1, and both print only on closed bars. The Lab has not tested the tool inside an Expert Advisor.
Will it leave my chart colors changed after I remove it?
No, not on the default setting. With RestoreTheme set to true, your original chart colors come back when you remove the indicator. Set it to false if you want to keep the theme set by the Theme input.
Changelog
- 1.00Initial release: swing pivot detection, ATR-tolerance level merging, Active -> Broken -> Flip Confirmed/Failed/Unconfirmed state machine, closed-bar retest confirmation arrows, two-tier alerts (break + confirmed flip),. · 2026-10-09
Final verdict
The Lab's verdict
Polarity Flip does the job it is built for. It turns a vague chart idea, "broken resistance becomes support," into a fixed rule: break by a set ATR buffer, retest inside a set window, closed-bar confirmation. Its arrows held up in the repaint test, and results come quickly: half of the arrows had hit 1 ATR one way or the other within 2 bars, and only 0.5% hit neither side within 20 bars.
The arrows are not a stand-alone entry. On EURUSD M15, fewer than half reached 1 ATR in their direction first. Bearish arrows were the weaker side on that sample. Use the tool to decide where to trade, and use something else to decide whether to trade.
Limits you should know
- Only EURUSD M15 was measured. The tool runs on other pairs and timeframes, but the Lab has no numbers for them.
- There is no trend filter inside the tool. In a choppy range, expect levels to break and fail repeatedly; the Lab did not measure this separately.
- It does not set stops or targets, and it does not combine timeframes.
- –You already have a direction bias and want a rule for the pullback entry
- –You want arrows that do not move or vanish after the bar closes
- –You can watch the next few bars, because half of the arrows were decided within 2 bars
- –You trade a pair and timeframe where clear swings form
- –You want a buy/sell system to follow without any other filter
- –Price is chopping sideways and levels keep breaking and failing
- –You expect the Lab's EURUSD M15 numbers to hold on every market
Settings to start with
On M15, keep the defaults. That is the setup the Lab measured.
The ideas below are untested starting points, not Lab results. Compare each one with the default on your own chart:
- On H4, try RetestWindowBars 10 and LevelExpiryBars 60 so old breaks and stale levels drop off sooner.
- On M5, try LeftBars 8 and RightBars 8 for fewer, stronger levels. The trade-off is that each level appears 8 bars after its swing.
- If your chart is crowded, lower MaxLevelsShown before you change anything else.





















