Troubleshooting Your Intraday EA for MetaTrader 4: Tips and Insights

Mike 2011.07.15 22:15 27 0 0
Attachments

Hey fellow traders!

I’ve been diving into the world of trading automation and recently put together an EA for MetaTrader 4. Now, I don’t have a coding background, but I’ve been learning MQL4 over the last two weeks and managed to create the backbone of my EA using an MQL4 code builder that I then tweaked manually.

I’ve run some backtests with this EA, but I’m hitting a wall when it comes to getting the logic to enter and exit trades at the right moments.

Understanding the Strategy

My strategy is based on a Bollinger Bands system, utilizing a standard setup of 20,2,2 on a 15-minute chart. Here’s the lowdown:

  • Buy Signal: A buy is triggered when the price dips below the upper band (20,2.4,2.4) and then retraces back to the middle band (20,1,1). The take profit should be set, and I’m considering a stop loss (SL) at around 100 pips, but I’d like to experiment with a tighter 50 pips too.
  • Sell Signal: Conversely, a sell is triggered when the price rises above the lower band (20,2.4,2.4) and then retraces back to the middle band (20,1,1). Again, I’m thinking of setting a take profit with the same SL considerations.

The Challenge

The question: When I run the attached EA, I’ve noticed that sometimes there’s a delay of one bar or more for the entry point, and at times, the code completely misses the entry. It’s been quite frustrating!

Is there anyone out there with more experience who can lend a hand with this? Any feedback or insights would be hugely appreciated!

Thanks a ton,

Steve

List
Comments 0