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 MACD

MetaTrader Experts, Indicators, Scripts and Libraries

Trading on a new bar only. Trading rules are simple — on the new bar, compare the value of the main line on bar (1) and bar (2):

If MAIN_LINE MACD (1) > MAIN_LINE MACD (2) -> Buy,

If MAIN_LINE MACD (1) < MAIN_LINE MACD (2) -> Sell.

When a signal opposite to open positions is received, close all positions.

The code can be seen as a test of the theory: if MACD is greater than the previous value, we can buy. As you can seen, the theory in this form is completely a failure. It requires additional filters and protection of positions. 

17425

Best MetaTrader Indicators + Profitable Expert Advisors