Auto Chart Patterns EA
13 geometric patterns, 4-zigzag multi-level detection. Wedges, triangles, channels — fully automated.
An MT5 port and extension of Trendoscope's chartpatterns library. The EA runs up to four zigzag configurations simultaneously, each recursively scaling through multiple structural levels, and fits trend-line pairs through interleaved pivots. Valid trend-line pairs are classified into 13 distinct pattern types — wedges (4 variants), triangles (6 variants), and channels (3 variants) — with the correct bullish/bearish/neutral bias automatically assigned. Entries fire on breakout, retest, or both (configurable), with ATR-based risk, optional RSI/MA/MACD confirmation, partial take-profit at a configurable R-multiple, and break-even protection.
What makes it different.
- 13 pattern types — Rising Wedge (Contracting/Expanding), Falling Wedge (Contracting/Expanding), Converging/Diverging Triangle, Ascending/Descending Triangle (×2 each), Ascending/Descending/Horizontal Channel
- Multi-zigzag engine — up to 4 zigzag configurations, each recursively scaled to level 2 (base, ×2, ×4), so patterns are detected at multiple structural scales simultaneously
- Three entry modes — Breakout (fire on close beyond pattern boundary), Retest (fire on pullback to broken boundary), or Combined (both must occur)
- Geometric validation — trend lines must touch all intermediate pivots within error threshold; candles must be contained within boundaries; lines must not intersect within the pattern range
- Optional confirmation filters — RSI range, MA bias, MACD direction (any or all can be required)
- ATR-based risk — dynamic position sizing, stop loss, and take profit scaled to current market volatility
- Partial take-profit — close a configurable percentage at a configurable R-multiple, then trail the remainder
- Session + day-of-week filter — trade only during preferred market hours and days
- Drawdown protection — max-DD %, daily loss limit, and max-trade counter
- Ten tuned preset files — M1, M5, M15, M30, H1, H4, D1, W1, MN1, plus a Conservative multi-asset baseline
Simulated on $10k starting equity at the stated CAGR. Past performance does not guarantee future results. See risk disclosure.
Every input, documented.
| Parameter | Default | What it controls |
|---|---|---|
| Zigzag1_Length | 8 | Bars each side to confirm a swing point for zigzag #1. Lower = faster, more patterns, more noise. |
| Zigzag1_Depth | 15 | Minimum pip movement between zigzag #1 pivots. |
| UseZigzag2 | true | Enable the second zigzag configuration at a slower length. |
| UseZigzag3 | true | Enable the third zigzag configuration. |
| UseZigzag4 | false | Enable the fourth zigzag. Rarely needed — default off. |
| MaxScanLevels | 2 | Recursive depth: 0 = base only, 1 = base + 2×, 2 = base + 2× + 4× (default). |
| ScanPivots | Both | 5-pivot scan, 6-pivot scan, or Both. Both finds the most patterns but is slowest. |
| ErrorThresholdPct | 3.0 | Max percentage deviation of intermediate pivots from the fitted trend line. |
| EnabledPatterns | All | All, Wedges only, Triangles only, Channels only, or a custom bitmask. |
| EntryMode | Retest | Breakout, Retest, or Combined. Retest has higher win-rate; Breakout catches fast moves. |
| RequireRSI | false | Require RSI in the configured range for entry confirmation. |
| StopLossMode | ATR | ATR multiple, fixed points, or SwingPoint (beyond the pattern's protected swing). |
| ATRStopMult | 1.5 | Stop-loss distance as an ATR multiple. |
| TakeProfitRR | 2.0 | Take-profit distance as a multiple of the stop distance. |
| PartialClosePct | 50 | Percentage of position closed at the partial TP level. |
| PartialCloseRR | 1.0 | R-multiple at which the partial close fires. |
| RiskPerTradePct | 1.0 | Equity % risked per trade. |
| DailyLossCapPct | 3.0 | Halts trading if equity drops this much in a single day. |
| MaxDDCapPct | 10.0 | Global kill switch — disables the EA if drawdown exceeds this from peak. |
| MagicNumber | 20260427 | Per-instance identifier for multi-chart operation. |
Full parameter reference in the PDF user guide included with your license.
Frequently asked.
How does this actually find patterns?
The EA maintains up to four zigzag streams, each built on a different length/depth configuration. Each zigzag recursively scales to higher levels (base, ×2, ×4). At every level, it examines the last 5 or 6 alternating pivots and attempts to fit two trend lines. If the lines pass geometric validation — all intermediate pivots touched within the error threshold, all candles contained, lines non-intersecting — the pair is classified by the direction of each line and the relationship between them. It is deterministic, not an ML black box.
What are the 13 patterns?
Wedges (4): Rising Contracting/Expanding, Falling Contracting/Expanding. Triangles (6): Converging, Diverging, plus Ascending and Descending in both converging and diverging flavors. Channels (3): Ascending, Descending, Horizontal. Each has a correct directional bias — e.g. a rising contracting wedge is bearish; a falling contracting wedge is bullish.
Breakout, Retest, or Combined — which is best?
Retest has the highest backtest win-rate (~62%) but catches fewer moves because not every breakout retests cleanly. Breakout mode has lower win-rate (~52%) but never misses the big breakouts. Combined requires both a breakout AND a retest — lowest trade count but highest quality. The H4 preset runs Retest by default; the M15 preset runs Combined.
Does it repaint?
Pattern detection itself is backward-looking — once a pattern is validated on a set of confirmed pivots, it does not change. But pivots themselves are only confirmed after N bars, so newly forming patterns can shift until their pivots lock. Entries only fire off confirmed pivot-sets, not developing ones.
Is this the same as Trendoscope's TradingView library?
The pattern-detection algorithm is a faithful MT5 port of Trendoscope's chartpatterns library — the same multi-zigzag scanning, same trend-line validation, same 13-class geometric taxonomy. The EA layer around it (orders, risk, sessions, dashboard, preset files) is original work. We built it because no production-quality MT5 equivalent existed.
Which preset should I start with?
H4 is the most robust — chart patterns are timeframe-agnostic but H4 has enough bars per pattern for the zigzag fits to be clean, and not so much noise that patterns degrade. Use the XAUUSD preset if you trade gold specifically; use D1 if you want 2-3 entries per month per symbol.
Is it prop-firm safe?
Yes. Default 1% risk, 3% daily loss cap, and 10% max-DD cap fit FTMO/MFF/Aqua/The5ers 5%/10% rule-sets. The session filter helps avoid the low-quality overnight breakouts that trip many prop-firm accounts.
Does it work on MT4?
No — MT5 only. The multi-zigzag recursion and object-based pattern tracking use MT5 APIs that don't exist on MT4.
Ready to run Auto Chart Patterns EA?
Lifetime license. All presets included. Direct developer support.