Barry-style levels come from swings that price keeps returning to. This support resistance barry indicator finds swing highs and lows over the last 200 bars, groups swings that sit close together, and draws only the levels touched at least twice. Separately, it marks the bar that closes through the most recent swing.
This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.
| Platforms | MT4 (.ex4) + MT5 (.ex5) |
|---|---|
| Chart window | Main price chart |
| Plots | 2: SR Barry Break Up, SR Barry Break Down |
| Alerts | popup, push notification, email, sound |
| Inputs | 17 |
What each plot looks like
Horizontal levels plus two marks on price.
`ResColor` `clrTomato` draws resistance levels.
`SupColor` `clrMediumSeaGreen` draws support levels.
`SR Barry Break Up` prints lime with arrow 233.
`SR Barry Break Down` prints red with arrow 234.
A comment line shows the nearest levels and last break.
- SR Barry Break Up: arrow, lime, width 2, arrow code 233
- SR Barry Break Down: arrow, red, width 2, arrow code 234

What the code actually computes
Finding swings
`SwingBars` `5` bars on each side must sit lower for a swing high. The scan covers the last `Lookback` `200` bars.
Grouping them
Swings within `ClusterATR` `0.55` of a 14-bar range merge into one level. A level needs `MinStrength` `2` swings before its line appears.
The break
A mark prints when a close crosses the latest confirmed swing high or low. `BreakCooldown` `5` spaces the marks.
How to work with it
Lines show where swings have gathered.
Stronger levels collect more touches.
A lime mark means a close above the last swing high.
A red mark means a close below the last swing low.
`MaxLevels` `14` caps how many lines appear.
The forming bar never gets a mark.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
Each close through the last swing sends one message per bar. `EnableAlerts` controls it, and only the popup starts on; phone, email and speaker stay off until you switch them.
Every Support Resistance Barry Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
Lookback |
Bars scanned for swing structure. Bars scanned for swings, `200`. | 200 |
SwingBars |
Fractal half-width (bars each side of pivot). Bars on each side of a swing, `5`. | 5 |
MinStrength |
Minimum touches for a level to plot. Touches a level needs, `2`. | 2 |
ClusterATR |
Cluster width tolerance (x ATR). Merge distance as a range share, `0.55`. | 0.55 |
AtrPeriod |
ATR period (offset + tolerance). Range window, `14`. | 14 |
MaxLevels |
Max S/R lines drawn. Lines drawn at most, `14`. | 14 |
BreakCooldown |
Min bars between breakout signals. Bars between break marks, `5`. | 5 |
Display settings
| Setting | What it does | Default |
|---|---|---|
ArrowOffsetATR |
Arrow distance from bar (x ATR). Mark gap as a range share, `0.60`. | 0.60 |
ShowLevels |
Draw the S/R lines. Draw the lines, `true`. | on |
ResColor |
(see inputs panel) | tomato |
SupColor |
(see inputs panel) | medium sea green |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
Switch for break messages, `true`. | on |
EnablePopup |
(see inputs panel) | on |
EnablePushNotify |
(see inputs panel) | off |
EnableEmail |
(see inputs panel) | off |
EnableSound |
(see inputs panel) | off |
SoundFile |
(see inputs panel) | alert.wav |

Timeframes worth trying
Five-bar swings need a chart with some room to breathe. EURUSD H1 is the reference chart, where levels hold for days. On M15 the lines change often. On D1 they become the levels most traders watch anyway.
The rough edges
A close through a swing can reverse at once.
Levels built from past swings carry no promise.
Merged levels can hide two separate prices.
Only a popup reports by default.
Copy the compiled Support Resistance Barry Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.
Related on forexmt4systems.com: Support and Resistance Strategy.
Download the Support Resistance Barry Indicator for MT4 and MT5
The zip holds the compiled Support Resistance Barry Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.
Download this indicator free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
FAQ
What does MinStrength 2 keep off the chart?
Levels built from a single swing. A price has to attract at least two swings inside the cluster distance before its line appears, which removes one-off turns from the picture.
How close must swings be for ClusterATR 0.55 to merge them?
Within about half of the 14-bar average range. Two highs that close together count as one level, and the line sits at the average price of the group.
Is SR Barry Break Up tied to the drawn lines?
No. It watches the most recent confirmed swing high, whether or not that swing belongs to a drawn level. A close above it, after a close at or below it, prints the lime mark.
Why does SwingBars 5 make marks appear late?
A swing needs five closed bars on its right before it counts. The break test then uses that swing, so every mark rests on structure at least five bars old.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Support Resistance Barry Indicator as one input. Always backtest before trading live.
Category: this is part of our Support and Resistance collection. Browse more Support and Resistance for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- For background on this concept, see Three white soldiers on Wikipedia.
- For broader market context, see Ask at Investopedia.
