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


Idea from: Dmitry
mq5 code: Barabashkakon
The Expert Advisor uses the iMA indicator (Moving Average, MA). 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 ;
Example of how this works, where only one position of parameters is false and true:

The next sample has only one position - true, withdrawn - false, and the opposite one - true: a buy position is opened, and then a signal is received to open a sell position. Since the opposite is immediately - true, the buy position is closed first (since it is opposite to the signal), and only then the sell position is opened.

Attachment download
📎 ma_trend.mq5 (76.74 KB)
Source: MQL5 #23589
MA Trend - MetaTrader 5 Expert | Forex Indicator Download - MT4/MT5 Resource Usage and Screening Suggestions
MA Trend - 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 only on titles or short-term profit descriptions.
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •