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 | Currencyprofits 01.1

Author of the idea — John Smith, author of the MQL5 code — barabashkakvn.

Condition to open Buy: if the value of the first MA is greater than the second MA on the first bar, and the current price has broken the Low of the last six bars:

      //--- Buy
      if(iMAGet(handle_iMA_first,1)>iMAGet(handle_iMA_second,1) &&  
         m_symbol.Bid()<=iLowest(m_symbol.Name(),Period(),MODE_LOW,6,1))

Condition to open Buy: if the value of the first MA is lower than the second MA on the first bar, and the current price has broken the High of the last six bars:

      //--- Sell
      if(iMAGet(handle_iMA_first,1)<iMAGet(handle_iMA_second,1) &&  
         m_symbol.Bid()>=iHighest(m_symbol.Name(),Period(),MODE_HIGH,6,1))

MetaTrader Experts, Indicators, Scripts and Libraries

17641

Best MetaTrader Indicators + Profitable Expert Advisors