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 | iMA iSAR EA

Idea by: Yuri

mq5 code by: barabashkakvn

The EA only operates when a new bar emerges. Trading signals are generated based on the values of three indicators iMA (Moving Average, MA), two indicators iRSI (Relative Strength Index, RSI), and the value of close (all balues are taken for bar #1). 

Block for decision making:

   if(ma_fast[1]>ma_normal[1] && ma_fast[1]>ma_slow[1] && sar_fast[1]<close[1] && sar_normal[1]<close[1])        m_need_open_buy=true;     else if(ma_fast[1]<ma_normal[1] && ma_fast[1]<ma_slow[1] && sar_fast[1]>close[1] && sar_normal[1]>close[1])        m_need_open_sell=true;  

Example of opening a BUY position:

MetaTrader Experts, Indicators, Scripts and Libraries

Trailing is applied to the open position. A BUY opening signal is also a SELL closing signal (first, SELL is closed, and then BUY is opened). We act similarly with the SELL opening signal.

23383