Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Expert Advisor | Simple EA MA plus MACD

Author of the idea - Vladimir Khlystov

mq5 code author - barabashkakvn

This is a simple Expert Advisor using two indicators: iMA (Moving Average, MA) and iMACD (Moving Average Convergence/Divergence, MACD). The EA opens only one position at a time, therefore it is able to work both on hedging and netting accounts.

First, the indicator looks for a signal bar: when a new bar (#0) appears, check if MACD indicator in bar #1 crosses the zero line. A crossing means a signal bar has been found. Sample signal SELL bar:

MetaTrader Experts, Indicators, Scripts and Libraries

As soon as a signal bar is found, remember High and Low prices of a signal bar and wait till the price breaks through one of the prices. In case of a SELL bar: if the price breaks through Low, open SELL,

MetaTrader Experts, Indicators, Scripts and Libraries

if the price breaks through High, reset the SELL signal.

23040