Two pending orders 2
This EA places two pending orders (a Buy Stop and a Sell Stop) at a configurable distance from the current price at the start of each new bar. It uses an OCO (One-Cancels-the-Other) logic where once one pending order is triggered, the opposite pending order is deleted, capturing breakout moves in either direction.
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 | -5.73% | -5.00% | 6.83% | 144 | 42.00% | -1.13 | -0.84 | 6 | −$4.24 | Reliable |
| GBPUSD | -10.62% | -9.29% | 11.75% | 144 | 45.50% | -1.74 | -0.90 | 11 | −$7.59 | Reliable |
| USDJPY | -11.02% | -9.64% | 12.68% | 144 | 43.40% | -2.06 | -0.87 | 11 | −$7.59 | Reliable |
| XAUUSD | +36.95% | +29.67% | 42.62% | 152 | 51.00% | 0.91 | 0.87 | 7 | +$22.84 | Reliable |
Profitable on 1 of 4 markets with reliable results.
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.
Against the other Breakout EAs with a reliable result on the same market: EURUSD: better than 0% of 18 · GBPUSD: better than 0% of 18 · USDJPY: better than 0% of 17 · XAUUSD: better than 58% of 19
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 23% | +5.33% 2026-03 | -3.56% 2026-02 |
| GBPUSD | 8% | +7.20% 2026-03 | -5.79% 2026-02 |
| USDJPY | 23% | +1.12% 2026-08 | -4.72% 2025-12 |
| XAUUSD | 46% | +34.86% 2026-01 | -18.53% 2026-07 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: No blow-up pattern found
- Can hold up to 2 positions at once
On its own this is not a typical blow-up pattern, 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
This EA implements a dual-direction breakout strategy by placing a Buy Stop and a Sell Stop order at a configurable distance above and below the current price at the start of each new bar. Entry conditions are based on price breaking through a predefined distance from the current price level, which is a classic breakout approach. Exit conditions rely on stop-loss and take-profit parameters, along with the OCO (One-Cancels-the-Other) mechanism where the opposite pending order is deleted once one side is triggered, preventing opposing positions. Position sizing uses a fixed lot size determined by the user through input parameters, with no dynamic position sizing or risk-based lot calculation. Money management is minimal, lacking maximum position limits, drawdown protection, or percentage-of-balance sizing, leaving risk control entirely to the user's manual configuration of stop-loss and take-profit values. The strategy is well-suited for volatile market conditions but may suffer frequent stop-outs during ranging or choppy markets.
Strengths
- OCO mechanism ensures only one directional position is held, avoiding hedging risk
- Dual pending order design captures breakouts in either direction without missing major moves
- Strategy logic is simple and clear, easy to understand and optimize
- Pending orders are re-placed at each new bar, dynamically adapting to price changes
- Customizable stop-loss and take-profit provide transparent and controllable risk parameters
Weaknesses
- Lacks dynamic position sizing; fixed lot size ignores account equity changes
- No ranging market filter, leading to frequent stop-outs during sideways markets
- Missing money management features like max position count and drawdown protection
- No spread filter, making stop-loss and take-profit potentially unreasonable during high-spread conditions
- Deleting and re-placing pending orders every bar may increase trading costs and slippage risk
Possible improvements
- Add ATR or volatility-based dynamic adjustment for pending order distance and stop-loss/take-profit to adapt to varying market volatility
- Incorporate a trend filter (e.g., moving average direction) or oscillator to avoid frequent entries during ranging markets
- Implement equity-proportional dynamic position sizing to improve capital efficiency and safety
Risk assessment
Overall risk: Medium
- Fixed lot size without equity-proportional sizing can lead to significant losses with oversized positions
- Lack of ranging market filter may cause cumulative losses from frequent stop-outs during choppy conditions
- OCO mechanism may fail to delete the opposite pending order in extreme market conditions such as price gaps
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
LotSize | 0.1 | Lot size per order |
PendingDistance | 20 | Pending order distance from current price in points |
StopLoss | 30 | Stop loss in points |
TakeProfit | 50 | Take profit in points |
MagicNumber | 123456 | Unique EA magic number identifier |
Timeframe | H1 | Trading timeframe |
Similar Breakout EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.