Market Structure Indicator for MT4: Fractals and 4 Longer Swings Tested, 34 of 120 Settings Made Money, 31 of Them on Gold

Key takeaways
- MT4 has no “market structure” indicator, but it has the piece structure is built from: Fractals, which marks a swing high or low with 2 bars on each side. I tested that default and four longer swing lengths (3, 5, 8 and 10 bars), three entries and two exits on EURUSD and gold, M5 and M15: 120 settings.
- 34 of 120 settings made money after cost, and 31 of them were on gold. On EURUSD M5, 0 of 30 did.
- 3 of 120 passed every check (profit, both halves, better than the best 5% of random entries). With 120 tries, luck alone can produce a few like that.
- The best single setting was a 3-bar swing with the higher low entry on gold M5: +$1.76 an ounce a trade over 539 trades, positive in both halves. Its 2-bar neighbour made $0.00 and its 5-bar neighbour +$0.52.
- Fractals arrows are final only 2 bars after the swing, and ZigZag can redraw its last leg. Both matter more for a backtest than the setting you pick.
Price action courses draw higher highs and higher lows by hand. In MetaTrader you can let the platform mark the swings for you, and the question every beginner then asks is how many bars a swing should need. Too few and every wiggle is a swing. Too many and the trend has changed before the platform notices.
In the market structure test I used 5 bars on each side and 0 of 32 runs passed. Here I tried the other common lengths to see whether the choice of swing was the problem.
How do you mark market structure in MT4?

- Fractals: Insert, Indicators, Bill Williams, Fractals. It puts an arrow above a bar whose high is higher than the 2 bars before and the 2 bars after it, and below a bar with the mirror low. That is a swing length of 2. It has no inputs, only colours.
- Read the trend from the arrows: compare the last two up arrows and the last two down arrows. Both rising is an uptrend, both falling a downtrend, mixed is no structure.
- Longer swings: MT4’s Fractals cannot be set to more bars. Use a custom fractal indicator with a period input, or keep the standard one and count by eye: a 5-bar swing is a fractal whose high also beats the 5 bars on each side.
- ZigZag: Insert, Indicators, Custom, ZigZag, defaults Depth 12, Deviation 5, Backstep 3. It joins the swings with lines, which is easier to read, but its last line moves while the swing is still forming. My repaint test of arrow indicators shows how much that flatters a chart you look at afterwards.
- Remember the delay. A Fractals arrow is only final when the second bar after the swing has closed; while that bar is still forming, the arrow can appear and disappear. On M5 that is 10 minutes late, on M15 30 minutes. My test uses the swing only from that closed bar on.
What did I test?

- Swing length: 2 (the MT4 Fractals default), 3, 5, 8 and 10 bars on each side.
- Three entries: any break: a close beyond the last swing high or low, in the direction of the break; BOS: the same, only in the direction of the trend; HL entry: in an uptrend, buy the bar that confirms a new higher low (sell a new lower high in a downtrend).
- Two exits: stop 1.5 ATR, target 3 ATR, 48 bars at most; or a plain close after 12 bars. One trade at a time.
- Data and cost: EURUSD, June 3 to August 26, 2026, 16,926 M5 bars and 5,642 M15 bars; gold over the same weeks, 13,736 M5 bars and 4,577 M15 bars. 1 pip per EURUSD trade and $0.30 an ounce per gold trade from my spread and swap measurement.
- 5 lengths × 3 entries × 2 exits × 4 charts = 120 settings. Every setting had at least 30 trades.
Which swing length did best?
| Median result of the 6 settings at each length | 2 (Fractals) | 3 | 5 | 8 | 10 |
|---|---|---|---|---|---|
| EURUSD M5 (pips) | -1.41 | -1.25 | -1.41 | -1.49 | -1.51 |
| EURUSD M15 (pips) | -1.21 | -1.17 | -1.04 | -0.95 | -0.92 |
| Gold M5 ($ an ounce) | -0.25 | -0.07 | +0.15 | -0.35 | -0.41 |
| Gold M15 ($ an ounce) | +0.06 | +0.03 | -0.36 | +0.61 | +1.18 |
After cost per trade. Each cell is the median of 3 entries × 2 exits.
No length won everywhere. On EURUSD M5 every length lost about the spread and a bit more, from -1.25 to -1.51 pips. On M15 the longer swings lost a little less on both markets, and on gold M15 the 10-bar swing had the best median of the whole table, +$1.18 an ounce. On gold M5 the middle length, 5 bars, was the only one above zero.
The Fractals default was never the best length. It was not the worst either: on gold M15 it sat in the middle. A shorter swing simply gives more signals: on EURUSD M5 the any-break entry fired 961 times with a 2-bar swing and 656 with a 5-bar one, with almost the same loss per trade.
Which entry and exit worked best?
| Median of the 10 settings for each entry | Any break | BOS with trend | HL entry |
|---|---|---|---|
| EURUSD M5 (pips) | -1.62 | -1.64 | -0.63 |
| EURUSD M15 (pips) | -1.09 | -0.86 | -1.02 |
| Gold M5 ($ an ounce) | -0.24 | -0.96 | +0.17 |
| Gold M15 ($ an ounce) | +1.14 | +0.23 | -0.46 |
The higher low entry lost the least on EURUSD M5 and was the only positive median on gold M5. The plain break of any swing led on gold M15. The BOS with the trend, the entry most courses teach first, led nowhere except, narrowly, EURUSD M15.
On gold the exit mattered almost as much as the entry. With the 12-bar exit the median gold M5 setting made +$0.09 an ounce, with the ATR stop and target it lost $0.63. On gold M15: +$0.83 against +$0.06. On EURUSD the two exits were within 0.3 pips of each other.
Which settings passed every check?
| Setting | Trades | After cost | Won | 1st half | 2nd half | Coin, best 5% |
|---|---|---|---|---|---|---|
| Gold M5, swing 3, HL entry, 12-bar exit ($) | 539 | +1.76 | 52.3% | +2.64 | +1.26 | +0.66 |
| Gold M15, swing 3, any break, 12-bar exit ($) | 189 | +2.24 | 55.0% | +3.18 | +1.74 | +2.19 |
| EURUSD M15, swing 2, HL entry, 12-bar exit (pips) | 245 | +0.45 | 50.6% | +0.52 | +0.38 | +0.37 |
Coin = random direction on random bars, same exit, same number of trades, 300 runs; the column is the result only 5% of coin runs beat. 13 of the 120 settings made money in both halves; these 3 also beat the coin.
Only the first one cleared the coin by a wide margin. The other two beat it by $0.05 an ounce and 0.08 pips. And look at the neighbours of the gold M5 winner: the same entry and exit made $0.00 with a 2-bar swing and +$0.52 with a 5-bar swing, and with the ATR exit it fell to +$0.21 with a losing first half. A real edge in the higher low would not vanish when the swing changes by one bar.
The honest summary: when you try 120 settings, a handful will look good in any sample. Three passing settings, scattered over three different charts, lengths and entries, is close to what luck delivers. I would not put money on any of them without a second sample, the same conclusion as the trading systems test.
How should you set up structure in MT4?
- Use Fractals to see swings, not as a signal. Once the second bar after the swing has closed, the arrow stays put, and the 2-bar delay is honest.
- On M15 lean towards longer swings. 8 and 10 bars had the best medians on both markets; 2 and 3 bars mostly add noise trades.
- If you trade structure, trade the higher low, not the break. It lost the least on EURUSD M5 and led on gold M5.
- Test your exit before your swing length. On gold M5 the exit changed the median result more than the swing length did. The trailing stop settings showed the same.
- Keep ZigZag for drawing, not for backtests. Its last leg can still move.
How structure compares with a plain 200 EMA as a trend tool is in market structure vs moving average. Swing levels used as support and resistance are measured in the support and resistance indicator guide for MT4.
Frequently asked questions
Is there a market structure indicator in MT4?
Not by that name. Fractals (Insert, Indicators, Bill Williams) marks swing highs and lows with 2 bars on each side, and ZigZag joins them with lines. Higher highs and higher lows are read from those marks.
What is the best swing length for market structure?
No length won on every chart. On M15 the 8 and 10-bar swings had the best median results on both EURUSD and gold; on gold M5 the 5-bar swing was the only one above zero; on EURUSD M5 every length lost.
Does the Fractals indicator repaint?
Only briefly. An arrow can flicker while the second bar to the right of the swing is still forming; once that bar closes, it stays. So it is late by 2 bars rather than repainting. ZigZag can redraw its whole last leg.
How many market structure settings made money?
34 of 120 after cost, 31 of them on gold. 13 made money in both halves of the data and 3 also beat the best 5% of random entries.
Which market structure setting did best?
A 3-bar swing with the higher low entry and a 12-bar exit on gold M5: +$1.76 an ounce a trade over 539 trades, +$2.64 in the first half and +$1.26 in the second. With a 2-bar swing the same rule made $0.00.
Want a clean indicator to install right now?
It is my own enhanced DeMARK Trend Line indicator for MetaTrader 4 and 5. Non repaint, clean, and free.

