Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

MA Trend 2 - MetaTrader 5 Expert | Forex Indicator Download - MT4/MT5 Resources

author EAcpu | 3 reads | 0 comments |

MA Trend 2 - expert for MetaTrader 5

MA Trend 2 - expert for MetaTrader 5

Developed first version Moving Average Trend - added type training limit parameter :

  • Buying only - only open buying is allowed
  • Only SELL - Only SELL positions are allowed to be opened
  • Buy and Sell - allows simultaneous opening of buy and sell positions.

The Expert Advisor operates according to the iMA (Moving Average, MA) indicator. It has many settings:

The current selling price is higher than the indicator value on bar 1 -> signal to open a buy position

The current bid price is below the indicator value on bar #1 -> signal to open a sell position.

And how it looks like in MQL5 code:

 if ( m_symbol.ask ()>horse[ 1 ])
        m_need_open_buy= true ;
else if ( m_symbol.bid ()  1])
        m_need_open_sell= true ;


The operation example has only one position parameter, false and true:

MA Trend 2 - expert for MetaTrader 5

The following example has only one position - true, revocation - false and the opposite immediately - true: a buy position is opened and after some time a signal to open a sell position is received. Since the opposite is true, first the buy position is closed (since it is opposite to the signal), and only then the sell position is opened.

MA Trend 2 - expert for MetaTrader 5


Attachment download

📎 ma_trend_2.mq5 (78.03 KB)

Source: MQL5 #23632

MA Trend 2 - MetaTrader 5 Expert | Forex Indicator Download - MT4/MT5 Resource Usage and Screening Suggestions

MA Trend 2 - MetaTrader 5 Expert | Foreign Exchange Indicator Download - MT4/MT5 resources are foreign exchange indicator related resources. Before downloading or referencing, it is recommended to confirm the platform version, transaction type, time period, whether DLL is required, whether source code is included, parameter description and historical update records.

Both automated trading tools and foreign exchange indicators should first undergo backtesting, simulated account observation, and small capital verification. Pay special attention to spreads, slippages, maximum drawdowns, position opening frequency, stop loss methods, trading periods and broker rules, and avoid direct real-time execution based on titles or short-term profit descriptions.

Verification code Refresh