Welcome to my latest exploration of trading tools! Today, I'm excited to share a really straightforward Expert Advisor (EA) that’s as simple as it gets. This little gem consists of just 20 lines of code and executes trades in only two lines! Honestly, if anyone finds a simpler EA, I’d love to check it out!
This EA doesn’t rely on any indicators. Instead, it operates on a very basic principle: it opens two opposing positions at the start of a new bar. Once these positions are active, it waits until either one hits its stop-loss or take-profit level before opening up the next pair of positions.
After optimizing, remember to select the best result where the stop-loss is lower than the take-profit level. Each trade pair can yield one of three results:
- Both positions win (hooray!)
- One wins and one loses (the winner covers the loser's losses)
- Both positions lose (not ideal!)
It's perfectly fine to optimize this EA using "Open prices only" since it only trades at the opening of a new bar. In my tests, trading EURGBP on a 5-minute chart has provided the best results, but I've also seen promising outcomes with EURUSD, GBPUSD, and EURCHF.
Feel free to tweak the code however you like! Happy trading!
| Symbol | EURGBP (Euro vs Great British Pound) | ||||
| Period | 5 Minutes (M5) 2009.10.01 00:00 - 2010.01.31 23:55 | ||||
| Model | Every tick (the most precise method based on all available timeframes) | ||||
| Parameters | lots=1; stop_loss=76; take_profit=750; | ||||
| Bars in test | 25154 | Ticks modeled | 3758809 | Modeling quality | 90.00% |
| Mismatched charts errors | 0 | ||||
| Initial deposit | 10,000.00 | ||||
| Total net profit | 7,842.50 | Gross profit | 27,413.50 | Gross loss | -19,571.00 |
| Profit factor | 1.40 | Expected payoff | 76.89 | ||
| Absolute drawdown | 792.50 | Maximal drawdown | 3,539.00 (23.17%) | Relative drawdown | 23.17% (3,539.00) |
| Total trades | 102 | Short positions (won %) | 51 (56.86%) | Long positions (won %) | 51 (19.61%) |
| Profit trades (% of total) | 39 (38.24%) | Loss trades (% of total) | 63 (61.76%) | ||
| Largest | profit trade | 727.00 | loss trade | -750.00 | |
| Average | profit trade | 702.91 | loss trade | -310.65 | |
| Maximum | consecutive wins (profit in money) | 1 (727.00) | consecutive losses (loss in money) | 7 (-2,543.50) | |
| Maximal | consecutive profit (count of wins) | 727.00 (1) | consecutive loss (count of losses) | -2,543.50 (7) | |
| Average | consecutive wins | 1 | consecutive losses | 2 | |

| # | Time | Type | Order | Size | Price | S / L | T / P | Profit | Balance |
Related Posts
- Mastering the Moving Average EA for MetaTrader 5: A Trader's Guide
- Mastering Trading Signals with MQL5 Wizard: Bullish and Bearish Engulfing Strategies
- Mastering Trading Signals: EMA Crossover Strategy with Intraday Filters in MT5
- Harnessing MQL5 Wizard for Trading Signals: 3 Black Crows & 3 White Soldiers with MFI
- Download All Tick Data for Symbols in MetaTrader 5