Mastering Moving Averages: A Guide for MetaTrader 4 Traders

Mike 2016.07.01 18:23 22 0 0
Attachments

Hey traders! Let’s talk about a system that’s been around for a while but still has some quirks that we need to iron out. I’ve been trying to get a certain feature working properly, and honestly, it’s been a bit of a headache. It seems like this feature would really shine in other trading systems too, but as it stands, it’s more suited for those with a hefty trading budget.

To break it down, I’ve struggled with implementing the position reversal correctly. Here’s what’s going on:

Here’s a Simple Example:

  • 1st Candle: The close price is above the Moving Average (MA) – this gives us a buy signal.
  • 2nd Candle: Close the short position at the open of the new candle; this is when you should open a long position.
  • 3rd Candle: Here’s where it gets tricky! The long position opens at the price of the third candle instead of the second.

This whole process is visualized in the image below (the “BUY” scenario is depicted, but the “SELL” situation follows a similar pattern).

![MA Price Illustration](https://dailyforexmap.s3.ap-northeast-1.amazonaws.com/forum/202511/1762759139183-MA_price.webp "MA Price Illustration" loading="lazy" class="img-fluid">

I’d really appreciate it if some of you seasoned pros could lend a hand in solving this issue. If you can, please take a look at the attached code. I’d be super grateful for any simple tips too! Just a heads-up, though—I’m still learning the ropes with coding, so I might need a little extra guidance. :)

Happy trading, everyone!

List
Comments 0