Chart Pattern Indicator for MT4: 30 of 109 Settings Made Money, 23 on Gold M15, and the Best One Lost 3.54 Pips a Trade on EURUSD

Key takeaways
- MT4 has no built-in chart pattern indicator, but every auto pattern tool has the same three inputs: how many bars to look back, how close a touch must be, and how many touches a line needs. I tested 4 lookbacks, 2 tolerances, 2 touch counts and 2 exits on EURUSD and gold, M5 and M15: 128 settings, 109 with at least 30 trades.
- 30 of 109 settings made money after cost, and 23 of them were on gold M15. On EURUSD, 0 of 53 did, on either timeframe.
- The strictest setting passed every check on gold M15: 30-bar lookback, touches within 0.1 ATR, 3 touches per line, textbook exit. +$12.37 an ounce a trade over 32 trades, positive in both halves, above the best 5% of random entries.
- The same setting lost 3.54 pips a trade on EURUSD M15. On gold M5, asking for 3 touches made 0 of 16 settings profitable.
- With 128 tries, a few good rows come from luck. Treat the gold M15 result as a lead to re-check on new bars, not a system.
Search MetaTrader’s market for “chart pattern” and you get dozens of indicators that draw triangles, wedges and channels for you. They all ask the same questions in their inputs, under different names: how far back to look, how exact a touch has to be, how many touches make a line. The defaults are rarely explained.
In the chart pattern test I used one middle setting and 0 of 30 runs passed. Here I changed each input to see whether the setting was the problem, and how to set up the same rules in MT4 by hand.
How do you draw chart patterns in MT4?

- Mark the swings: Insert, Indicators, Bill Williams, Fractals. It puts an arrow over a high that beats the 2 bars on each side, and under the mirror low. My test used 3 bars on each side, a little stricter; a custom fractal indicator with a period input can do that. Swing marking is covered in detail in the support and resistance indicator guide.
- Draw the lines: Insert, Lines, Trendline. Join the last two up fractals for the upper line and the last two down fractals for the lower line. In the line’s properties, tick “Ray” so it projects to the right. For a channel, Insert, Channels, Equidistant Channel draws two parallel lines at once.
- Name the shape: compare the gap between the lines at the first swing with the gap at the last bar. Down to 60% or less: a triangle if one line is flat or they point toward each other, a wedge if both point the same way. Between 80% and 125%: a channel if it slopes, a rectangle if flat.
- Measure the touch tolerance in ATR: Insert, Indicators, Oscillators, Average True Range, period 14. On these bars the median ATR was 1.96 pips on EURUSD M5, 3.95 pips on M15, $4.62 on gold M5 and $8.52 on gold M15. A 0.1 ATR tolerance is 0.4 pips on EURUSD M15 and about $0.85 on gold M15.
- Wait for the close. The breakout is a candle that closes beyond the projected line. A wick through it is not a breakout. Set any alert to fire on the closed bar.
Auto pattern indicators redraw their lines when a new swing forms, and the swing itself is only final a few bars later. In the repaint test of arrow indicators the same effect made indicators look much better on a finished chart than in real time. Check a pattern indicator in the Strategy Tester in visual mode before you trust its history.
What did I test?

- Lookback: 20, 30, 50 and 80 bars. The lines run through the last two swing highs and swing lows inside that window.
- Touch tolerance: 0.1 or 0.25 ATR. A bar within that distance of a line counts as a touch, and no close may sit further than that outside a line before the breakout.
- Touches: at least 2 per line (the two swings) or at least 3.
- Exits: stop 1.5 ATR, target 3 ATR, 48 bars at most; or the textbook exit, stop beyond the opposite line and target the height of the pattern, 96 bars at most. 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 on gold from my spread and swap measurement.
- 4 × 2 × 2 × 2 × 4 charts = 128 settings. 109 had at least 30 trades and are counted below; the 20-bar lookback on M15 found too few patterns.
How many settings made money?
| Chart | Settings with 30+ trades | Made money | In both halves | Median per trade |
|---|---|---|---|---|
| EURUSD M5 | 30 | 0 | 0 | -1.47 pips |
| EURUSD M15 | 23 | 0 | 0 | -3.26 pips |
| Gold M5 | 32 | 7 | 0 | -$0.92 |
| Gold M15 | 24 | 23 | 11 | +$1.65 |
| All | 109 | 30 | 11 |
The chart decided the result, not the setting. Every EURUSD setting lost money, the best of them 0.74 pips a trade on M5 (30-bar lookback, 0.1 ATR, 2 touches, textbook exit). On gold M15 almost every setting made money. Gold fell about 10% to late June, ranged in July and rallied in August, and on M15 a breakout rule had room to catch those swings.
Which lookback should you use?
| Median per trade (settings in profit) | 20 bars | 30 bars | 50 bars | 80 bars |
|---|---|---|---|---|
| EURUSD M5 (pips) | -1.94 (0 of 6) | -1.33 (0 of 8) | -1.64 (0 of 8) | -1.47 (0 of 8) |
| Gold M5 ($) | -3.59 (0 of 8) | -1.44 (0 of 8) | -0.12 (3 of 8) | +0.10 (4 of 8) |
| EURUSD M15 (pips) | too few | -2.59 (0 of 7) | -3.31 (0 of 8) | -3.37 (0 of 8) |
| Gold M15 ($) | too few | +1.60 (8 of 8) | +0.79 (7 of 8) | +1.81 (8 of 8) |
On M5 a 20-bar lookback was the worst choice on both markets. On gold M5 it cost $3.59 an ounce a trade at the median, and the longer the window, the better: 50 and 80 bars were the only lookbacks with profitable settings there. A short window turns every small wiggle into a triangle. On M15 the lookback mattered less than the market.
Strict or loose touches?
| Median per trade (settings in profit) | Tolerance 0.1 ATR | 0.25 ATR | 2 touches | 3 touches |
|---|---|---|---|---|
| EURUSD M5 (pips) | -1.26 (0 of 14) | -1.67 (0 of 16) | -1.46 (0 of 16) | -1.50 (0 of 14) |
| Gold M5 ($) | -1.04 (4 of 16) | -0.87 (3 of 16) | -0.23 (7 of 16) | -1.30 (0 of 16) |
| EURUSD M15 (pips) | -3.26 (0 of 11) | -2.90 (0 of 12) | -2.53 (0 of 12) | -3.38 (0 of 11) |
| Gold M15 ($) | +3.79 (12 of 12) | +0.58 (11 of 12) | +1.33 (12 of 12) | +5.19 (11 of 12) |
Asking for a third touch is the advice in every pattern book: more touches, a stronger line. On gold M15 it raised the median from +$1.33 to +$5.19 an ounce a trade. On gold M5 it did the opposite: 0 of 16 settings with 3 touches made money, against 7 of 16 with 2. On EURUSD it made no difference worth having. A tighter 0.1 ATR tolerance helped on gold M15 and changed little elsewhere.
Which setting passed every check?
| Lookback 30, tolerance 0.1 ATR, 3 touches | Trades | After cost | Won | 1st half | 2nd half | Random, best 5% |
|---|---|---|---|---|---|---|
| Gold M15, textbook exit ($) | 32 | +12.37 | 56.2% | +11.89 | +12.70 | +8.99 |
| Gold M15, ATR exit ($) | 32 | +7.56 | 56.2% | +15.23 | +2.95 | +5.36 |
| EURUSD M15, textbook exit (pips) | 29 | -3.54 | 34.5% | -5.41 | -1.54 | +3.38 |
| EURUSD M15, ATR exit (pips) | 31 | -3.71 | 22.6% | -6.39 | -0.85 | +1.69 |
On gold M15 this setting made money in both halves of the data and beat the best 5% of 300 runs of random entries with the same exit and number of trades. Its profit factor was 3.01. The 50-bar and 80-bar lookbacks with the same tolerance and touches also passed, with +$8.98 and +$9.26 a trade over 35 trades, but they caught almost the same patterns, so this is one finding, not three. Of the 32 trades, 18 were triangles, 11 wedges, 6 channels and 1 a rectangle.
On EURUSD M15 the identical setting lost on both exits and in both halves. One market and 32 trades is a thin base, and 128 settings give luck plenty of chances. The honest reading is that strict lines on gold M15 are worth re-testing on fresh bars, and nothing here is worth trading on EURUSD.
What settings to start with
- Lookback: not under 30 bars on M5. 20 bars was the worst choice on both markets.
- Tolerance: about 0.1 ATR. Loose lines turn noise into shapes.
- Touches: 3 on M15, but do not expect the same on M5: there it removed every profitable gold setting.
- Market: on EURUSD M5 and M15, 0 of 53 settings made money. Do not expect an indicator default to change that.
- Always on the closed bar, and check that the indicator does not redraw past lines.
Whether a pattern does any better than a plain break of the 30-bar high or low is in chart patterns vs range breakout. The stop distance logic behind the ATR exit is in the stop loss distance test, and ATR settings in MT4 are in the ATR settings guide.
Frequently asked questions
Is there a chart pattern indicator in MT4?
Not built in. MT4 has Fractals to mark swings and trendline and channel tools to join them. Auto pattern indicators are custom downloads, and their inputs are lookback, swing strength, touch tolerance and minimum touches.
What is the best lookback for a chart pattern indicator?
On M5, 50 or 80 bars did better than 20 or 30: on gold M5 the 20-bar lookback lost $3.59 an ounce a trade at the median. On M15 the lookback mattered less than the market.
Do more touches make a better trendline?
It depended on the chart. On gold M15, 3 touches lifted the median from +$1.33 to +$5.19 a trade. On gold M5, 0 of 16 settings with 3 touches made money.
Do chart pattern indicators work on EURUSD?
Not on M5 or M15 in this test: 0 of 53 EURUSD settings made money after a 1-pip cost.
What setting worked on gold?
A 30-bar lookback, 0.1 ATR tolerance and 3 touches with the textbook exit made +$12.37 an ounce a trade over 32 trades on gold M15, positive in both halves and above random entries. The same setting lost 3.54 pips a trade on EURUSD M15.
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.

