Home System Trading Post

The Easiest Hedging System for MetaTrader 4: A Simple EA Guide

Attachments
9610.zip (559 bytes, Download 0 times)

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!




SymbolEURGBP (Euro vs Great British Pound)
Period5 Minutes (M5) 2009.10.01 00:00 - 2010.01.31 23:55
ModelEvery tick (the most precise method based on all available timeframes)
Parameterslots=1; stop_loss=76; take_profit=750;

Bars in test25154Ticks modeled3758809Modeling quality90.00%
Mismatched charts errors0




Initial deposit10,000.00



Total net profit7,842.50Gross profit27,413.50Gross loss-19,571.00
Profit factor1.40Expected payoff76.89

Absolute drawdown792.50Maximal drawdown3,539.00 (23.17%)Relative drawdown23.17% (3,539.00)

Total trades102Short 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%)
Largestprofit trade727.00loss trade-750.00
Averageprofit trade702.91loss trade-310.65
Maximumconsecutive wins (profit in money)1 (727.00)consecutive losses (loss in money)7 (-2,543.50)
Maximalconsecutive profit (count of wins)727.00 (1)consecutive loss (count of losses)-2,543.50 (7)
Averageconsecutive wins1consecutive losses2

#TimeTypeOrderSizePriceS / LT / PProfitBalance

Related Posts

Comments (0)