Pattern123
- Uzmanlar
- Sürüm: 1.0
Introduction
The "1-2-3" pattern is one of the oldest and most reliable reversal formations in technical analysis: it marks the point where an existing trend runs out of steam and a new one begins. Pattern123 EA automates the detection of this formation and manages the full trade lifecycle around it — from signal recognition to entry, stop-loss placement, take-profit, and an optional loss-recovery mechanism for advanced traders.
This EA does not rely on any external indicator file. The ZigZag detection logic (Depth / Deviation / Backstep) is fully embedded in the single .ex5 file, so there is nothing extra to install.
How the pattern is detected
Using an internal, non-repainting ZigZag (Depth, Deviation and Backstep — the same three parameters traders already know from the standard ZigZag indicator), the EA looks for three consecutive swing points:
- Point #1 — the extreme of the prior move (the low of a downtrend for a bullish setup, the high of an uptrend for a bearish setup).
- Point #2 — the retracement swing. At this stage the outcome is still open: continuation or reversal.
- Point #3 — confirmation that price has turned back, without breaking beyond Point #1.
Once the three points are in place, the EA places a pending stop order at the level of Point #2:
- If price breaks through Point #2, the pending order is triggered and becomes a market position — the pattern has "played out."
- If price instead breaks back through Point #1 first, the setup is invalidated and the pending order is cancelled automatically.
Stop Loss and Take Profit
- Stop Loss can be placed beyond Point #1, beyond Point #3, or at a fixed distance — your choice via input. When Point #3 is selected, the EA temporarily anchors the stop at Point #1 (since Point #3 can still shift while the order is pending) and moves it to the final Point #3 level only once the order is actually triggered.
- Take Profit for the first order can be a fixed distance or a Fibonacci extension of the Point #1→#2 leg.
- An optional trailing stop, expressed as a ratio of the take-profit distance, manages the first order once it is in profit.
Stop'n'Reverse (SnR) recovery orders — optional, advanced
For traders willing to accept higher risk in exchange for a loss-recovery mechanism, the EA can place a pending order in the opposite direction, right at the stop-loss level of the current trade, with its lot size optionally scaled up by a Martingale coefficient.
- If the first trade is stopped out, the opposite SnR order triggers automatically, and a new same-direction order (with an increased lot) is placed back at the level of the position that just closed.
- The take-profit of each SnR order is set a configurable distance above the breakeven point of the whole set (i.e., the level needed to recover the running loss).
- As soon as any order in the set closes in profit, the lot multiplier resets to 1 and the set starts over from a clean signal.
- This feature is disabled by default and is only recommended on high-volatility instruments such as gold, with disciplined money management.
Buy-sets and Sell-sets are tracked separately (via two internally-generated Magic numbers), so the EA can manage a bullish and a bearish 1-2-3 setup on the same chart independently.
Additional features
- Trading-time window: restrict the first order to a chosen session. Signals that form outside the window are still tracked, and if still valid once the window opens, the pending order is placed then — useful for catching a pattern that built up overnight.
- "No more trades after today's profit" filter, with two modes: stop for the day after any profit, or stop only once the account balance is also at a new high.
- Automatic 4/5-digit (and 2/3-digit) quote handling — all pip-based inputs are entered in standard 4-digit format and rescaled internally.
- Optional on-chart drawing of the detected ZigZag and the three pattern points, for visual confirmation.
- A one-time cooldown/retry guard prevents order-send spam if trading is temporarily blocked (e.g., AutoTrading disabled, account without trading rights) — the EA logs the exact cause once and waits quietly instead of resending every tick.
Recommended use
This EA can run fully automatically, but — as with any reversal-based system — its best results come from combining automated signal execution with a trader's own read of higher-timeframe support/resistance levels. A common workflow: mark key H1/H4 levels at the start of the session, and let the EA watch for a 1-2-3 formation only as price approaches one of them.
A note on risk: the Stop'n'Reverse mechanism increases both potential recovery and potential drawdown. Test thoroughly on a demo account, and size positions conservatively before considering live use with real funds. Past backtest performance does not guarantee future results.
Key inputs at a glance
| Group | Parameter | Purpose |
|---|---|---|
| General | Magic, No-trade-if-profit-today, Final grid date | Order tagging and daily/session-level trading controls |
| Trading | Fixed Lot / Risk % | Position sizing for the first order |
| Stop Loss | Calculation mode (Point1 / Point3 / Fixed), Max/Min SL filter | Stop placement and signal filtering by stop distance |
| Take Profit | Fixed / Fibonacci extension, Trailing ratio | Exit management for the first order |
| Reversal (SnR) | Number of orders in a set, Martingale coefficient, TP from breakeven | Optional loss-recovery chain |
| Time | Trading hours (start/end) | Session restriction for new signals |
| ZigZag | Depth, Deviation, Backstep | Pattern-detection sensitivity |
| Misc | Draw on chart, retry cooldown | Visualization and order-send safety |
This product is an independent implementation of the well-known 1-2-3 reversal concept and Stop'n'Reverse recovery mechanism. It is not affiliated with, and does not reuse code from, any other vendor's product.
