ZigZag EA
This EA uses the ZigZag indicator to identify trend reversal points and opens trades in the direction of the newly formed trend. It enters positions when a new ZigZag leg is confirmed and exits based on opposite signals or fixed take-profit/stop-loss levels. The strategy aims to capture medium-to-long-term trend swings by following the ZigZag pivot points.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
The core strategy of this EA is based on the ZigZag indicator to identify market swing highs and lows, entering trades after trend direction confirmation. Entry conditions trigger when the ZigZag indicator confirms a new peak or trough formation — going long after a trough and short after a peak. Exit conditions typically include fixed take-profit and stop-loss levels, as well as closing positions when the ZigZag forms an opposite pivot point. Position sizing may support fixed lots or dynamic lot calculation based on account equity percentage. Money management relies on stop-loss distance and account balance to determine risk exposure per trade. The strategy assumes ZigZag pivot points mark genuine trend reversals, but it is important to note that the ZigZag indicator has repainting characteristics, meaning confirmed pivots may shift as price evolves, introducing uncertainty in live trading.
Strengths
- ZigZag indicator effectively identifies key market pivot points with clear and intuitive entry logic
- Strategy logic is simple and easy to understand, allowing traders to easily adjust parameters
- Trades in trend direction, carrying potential for positive expectancy
Weaknesses
- ZigZag indicator has repainting characteristics — historical signals may change as price evolves, raising reliability concerns for live signals
- Lacks filtering mechanism for ranging markets, potentially causing frequent stop-outs in sideways conditions
- Fixed take-profit and stop-loss do not account for market volatility changes, leading to inconsistent performance across varying volatility environments
Possible improvements
- Add a trend filter indicator (e.g., ADX or moving average direction) to avoid frequent trades in ranging markets
- Introduce ATR-based dynamic stop-loss and take-profit to adapt to market volatility changes
- Add a ZigZag signal confirmation mechanism (e.g., wait N bars to confirm the pivot does not repaint before entering)
Risk assessment
Overall risk: Medium
- ZigZag repainting issue may produce false entry signals
- Lack of ranging market filter may cause consecutive losses in sideways markets
- Fixed stop-loss does not account for spread and slippage impact
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
ZigZag_Depth | 12 | ZigZag depth; controls turning point sensitivity |
ZigZag_Deviation | 5 | ZigZag deviation; minimum turning point spacing % |
ZigZag_Backstep | 3 | ZigZag backstep; prevents close turning points |
StopLoss | 500 | Fixed stop loss in points |
TakeProfit | 1000 | Fixed take profit in points |
LotSize | 0.1 | Fixed lot size per trade |
MagicNumber | 12345 | EA magic number; 0 manages all positions |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.