YazanPro Pattern Matcher
- Indicators
-
Yazan Adnan Ramadan Ibrahim
Algorithmic trader and MQL5 developer based in Jordan. I build Expert Advisors for MetaTrader 5 focused on gold (XAUUSD) and major FX pairs: multi-module confluence systems, short-hold scalping tools and manual trade panels. Each product is tested in the Strategy Tester on real ticks with - Version: 1.0
- Activations: 10
YazanPro Pattern Matcher is an indicator for MetaTrader 5. It answers three questions on any symbol and on whatever timeframe the chart shows, from M1 to MN1:
- When did price last look like this, and what happened next?
- Is there a chart pattern here, and has it formed, broken out, retested, been confirmed or failed?
- Where are the nearest support and resistance levels?
It works on closed bars only, so nothing repaints. It places no orders.
Similar past situations
On every closed bar it compares the last 24 bars with every window of the chart's own last 40,000 bars. Choose how it compares them with the "Match by" input:
- Close path: the shape of the closes.
- Candle shapes: the body, upper wick and lower wick of each bar, bar by bar.
- Close path + candles: both together.
- Full situation (the default): the path and the candles, plus the context at the end of each window. The context is the trend before it, the volatility, where price sits in its recent range, the tick volume and the hour of day.
It keeps the 20 closest matches that do not overlap and shows:
- Similarity % in large type, with its parts: close path %, candles % and situation %.
- The situation now in plain words, for example "downtrend · high volatility · bottom of its range (6%) · high volume · 21:00".
- UP and DOWN scores (0 to 100) with battery bars: the similarity-weighted share of matches that ended higher or lower after 12 bars.
- Strength (0 to 100): how close the matches are and how much they agree.
- Went up after: the % of matches that closed higher after 6, 12 and 24 bars, plus the median and mean move and the average best and worst point (in ATR units).
- The 5 closest matches with date, similarity and what followed. Click one to scroll the chart there.
- A picture: the current candles, the closest match laid over them, and the paths of all matches after it with their average.
- On the chart: a box around the current bars, the average path of the matches projected forward with the middle half dotted, and gold boxes on the 5 closest past matches.
Chart pattern status
A structural pattern detector reads swing points on the chart's timeframe. It finds:
- double and triple tops and bottoms
- head and shoulders and its inverse
- ascending, descending and symmetrical triangles
- rising and falling wedges
- bull and bear flags
- rectangles, channels and cup and handle
A status box shows the pattern, its direction and a step strip: Formed ✓ › Broke out ✓ › Retested ✓ › Confirmed ✓. A failed breakout shows as "Fake breakout ✗" and an old one as "Expired". The Pattern tab adds:
- the broken line and its distance in ATR
- the target and the invalidation level
- the "fake if" level while it is waiting for a retest
- the bar times of the break, the retest and the confirmation
On the chart the pattern is drawn with numbered points, the breakout, the retest and confirmation marks and target / stop guides.
Support and resistance
The nearest resistance and support are shown with their strength (how many levels merged into the zone) and their distance in ATR. The Levels tab also shows:
- the 5 strongest zones
- the support and resistance trendlines
- the pivots for the timeframe
- whether price just broke out of or bounced off a level
Only the nearest and strongest zones are drawn, so the chart stays readable.
Textbook pattern match
The last 24, 48 and 96 bars are also compared with 14 drawn textbook outlines. The best one is shown with its match % and a thumbnail, and its outline is drawn over the price. The indicator then lists every past moment on the same chart that matched that outline at least as well, and what followed. You see how that pattern actually behaved on your symbol.
Self-check on your chart
On start the indicator replays the same search on 200 past bars of your chart, each using only the bars before it. It shows:
- how often the side with the larger score was right
- how often price simply rose, so you can compare the two
- how usual today's similarity is on that chart
So you see, for your own symbol and timeframe, how much the reading is worth.
Panel and languages
- Header: a language button with 12 panel languages: English, Arabic, Russian, Chinese, Spanish, Portuguese, Japanese, German, Korean, French, Italian and Turkish.
- Timeframe buttons: M1 to MN1, to switch the chart.
- Tabs: Twins, Pattern, Levels, Textbook and Self-check.
- Fold button: shrinks the panel to its tiles and the pattern status.
- Alerts: pop-up and push notifications, once per bar, for a strong match or a textbook pattern match of 90% or more.
Please read this first
This is a context tool, not a trading system. In the developer's tests, similar past situations were followed by rises and falls about equally often. That was true even when candles, trend, volatility and volume were matched too, and trading every strong match did not beat a random entry after costs (Section 3). The self-check shows the same kind of number for your own chart. Use the indicator to see what similar situations, patterns and levels looked like, never as an entry signal on its own.
3. What the tests found
Every test replays the search with only the data that was available at each bar. Spreads are the recorded values. An extra cost was added where stated.
Does history repeat? (8 markets: EURUSD, GBPUSD, USDJPY, XAUUSD, USDCAD and US500 on H1, plus EURUSD and XAUUSD on M15)
All four "Match by" modes were tested on the direction 12 bars later. The best mode was chosen on the older data, then run once on 2024-2026 data it had never seen.
Match by | Side right | Always the main direction
Close path | 50.5% | 52.3%
Candle shapes | 50.2% | 52.2%
Close path + candles | 50.6% | 52.3%
Full situation | 51.2% | 52.7%
- The "always the main direction" column uses each period's main direction, known afterwards. Against a plain 50% coin, only the full situation was slightly better (+1.2 points).
- An independent re-implementation of the whole test gave the same matches and numbers.
Trading every strong match (larger score 75 or more), H1, the same 6 markets
The rule: stop loss 1.5 x ATR(14), take profit 1.3 x the stop, break-even, recorded spread plus an extra cost per round trip.
- 2024-2026: 328 trades, profit factor 0.98, about zero per trade.
- A random side on the same entries did the same.
Trading every match of 90% or more on EURUSD (close path mode)
- H1, 2017-2026: 14,222 trades, profit factor 0.97.
- M5, 2026: 14,472 trades, profit factor 0.33 (stop 0.8 x ATR, target 1.2 x the stop, 30-minute exit).
Inputs
Search
- Match by: Full situation (Close path only / Candle shapes only / Close path + candle shapes / Full situation)
- Pattern length, bars (10..120): 24
- Bars after a match read as its outcome (1..48): 12
- Closest matches kept (5..50): 20
- History bars searched (1000..200000): 40000. The chart must have this many bars, or the indicator uses what it has. Raise "Max bars in chart" under Tools > Options > Charts for more.
- Also match textbook chart patterns: true
- Textbook pattern: past cases need a match >= this %: 80
- Self-check: replay the search on past bars of this chart: true
- Self-check: number of past tests (50..500): 200
Display
- Tab shown first: Similar past situations
- Panel language: English (12 languages; also switchable on the panel)
- Panel X / Y, pixels from the top-left corner: 10 / 30
- Draw on the chart (window box, expected path, pattern outline): true
- Mark the 5 closest past matches on the chart: true
Alerts
- Alert on a strong match (once per bar): true
- ... similarity >= this %: 85
- ... and the UP or DOWN score >= this: 75
- ... and the median move >= this (x ATR): 0.3
- Alert when a textbook pattern match >= this % (0 = off): 90
- Also send a push notification: false
Chart patterns and levels
- Chart patterns (stage, levels, drawing): true
- Support / resistance levels: true
Quick start
- Attach the indicator to any chart and any timeframe. It works on forex, metals, indices, stocks and crypto.
- Pick your language with the button at the top right.
- Read the two large tiles and the pattern status box first. Then open the tabs: Twins, Pattern, Levels, Textbook, Self-check.
- Use the timeframe buttons to look at the same symbol on another timeframe.
- Rest the mouse on any row for an explanation.
FAQ
Does it repaint?
No. It uses closed bars only, and each search sees only the bars before it.
Does it trade or give buy / sell signals?
No. It places no orders and has no buffers. Section 3 shows that the direction of similar past situations did not predict the next move.
Which timeframes?
Any timeframe from M1 to MN1. Everything is computed on the chart's own timeframe. On MN1 or short histories some parts may say "not enough history".
Is it heavy for the terminal?
One search takes a few milliseconds per new bar. The self-check runs in small steps in the background.
Trading carries a high risk of loss. This indicator does not predict prices and does not guarantee any result. The numbers above are past tests on the developer's broker data and may differ on yours.
