Mastering Simple EA: MA & MACD Strategy for MetaTrader 5

Mike 2018.11.20 21:48 21 0 0
Attachments

Author of the Idea: Vladimir Khlystov

MQ5 Code Author: barabashkakvn

Welcome, fellow traders! Today, I’m excited to share a straightforward Expert Advisor (EA) that effectively utilizes two popular indicators: the Moving Average (MA) and the Moving Average Convergence Divergence (MACD). This EA is designed to open only one position at a time, making it compatible with both hedging and netting accounts.

So, how does it work? The EA begins by identifying a signal bar. When a new bar (#0) forms, it checks if the MACD indicator from the previous bar (#1) crosses the zero line. A crossover indicates that we have our signal bar. Here’s an example of a signal SELL bar:

Signal SELL Bar

Once a signal bar is identified, the EA will record the High and Low prices of that bar and wait for the price to break through one of these levels. For a SELL signal, if the price breaks below the Low of the bar, the EA will open a SELL position.

Open SELL

Conversely, if the price breaks above the High, it resets the SELL signal. This simple yet effective strategy can help you navigate the markets with confidence.

List
Comments 0