Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

Classic 2 Moving Averages crossover EA - expert for MetaTrader 5

Andrey Barinov
Andrey Barinov
4.5 (719)
==============================================================
Where Experience meets Knowledge
==============================================================
Views:
42736
Rating:
(63)
Published:
Updated:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

This is a classic trading strategy based on two Moving Averages crossover. Buys when fast MA crosses slow MA from below and sells when fast MA crosses slow MA from above.


This code can be used in both MetaTrader5 and MetaTrader4. Just change the file extension from .mq5 to .mq4 and compile the file in MetaEditor.

This expert advisor is designed with visual strategy builder - Mission Automate. Code is generated automatically. More info: /en/articles/4951

This EA is available as a template in a free demo version, so you can easily modify / customise it without programming.


Parameters

inputs


Examples

    Last comments | Go to discussion (38)
    Ishe Pangidzayi
    Ishe Pangidzayi | 29 Sep 2021 at 07:57
    Andrey Barinov #:

    Recently they have changed Market rules, forcing everyone to remove all demo versions. Currently there is no demo version, so you can only check the software if you either rent it or buy it.

    understood - thanks
    Wai Leong Wong
    Wai Leong Wong | 24 Feb 2022 at 10:15

    The BE and TSL does not work if the open trade goes into negative value before turning positive..

    Any ways to ratified this error?

    Andrey Barinov
    Andrey Barinov | 24 Feb 2022 at 10:23
    madt wong #:

    The BE and TSL does not work if the open trade goes into negative value before turning positive..

    Any ways to ratified this error?

    It is not an error. BE and TSL can not work while the trade is in negative

    Gabriel BM
    Gabriel BM | 5 Jul 2024 at 16:26

    Hello everyone,

    I'm reaching out for assistance to implement a specific feature: "Close on opposite signal - True." However, I would like trades to close on an opposite signal only if they result in a profit. If a trade is currently at a loss, I prefer it to remain open.

    Additionally, I am interested in limiting the number of trades open in the same direction with an option such as "just let X trades remain open in the same direction." This means that X trades would be opened in both directions and would only be closed if they are profitable.

    Is it possible to achieve these functionalities? Any guidance or suggestions on how to effectively implement these features would be highly appreciated.

    Thank you all in advance for your assistance!

    Saki3d
    Saki3d | 1 May 2025 at 14:46
    Hi, i was trading manually basic MA strategy when i saw this EA, input my MA settings and result was good. Now i am using this EA my live account it gives good results, can u please say What is TSL settings for, thank you for this EA.
    dTrends dTrends

    Arrow trends by iBearsPower and iBullsPower indicator for MT5

    Utility to view the statistics for a Single Bar of any time frame Utility to view the statistics for a Single Bar of any time frame

    The utility will display the high, low, open, close and time statistics for any user selected bar of any timeframe for the symbol of the chart the utility resides on.

    Bars and Rates Information Utility, displays how many bars there are in all timeframes for any user selected symbol, and shows the 'CopyRates' information availablity for any bar Bars and Rates Information Utility, displays how many bars there are in all timeframes for any user selected symbol, and shows the 'CopyRates' information availablity for any bar

    This utility is not a trading or market information utility. This will likely only interest those writing (or debugging) indicators using multiple timeframes and collecting information using Bars (or iBars) and CopyRates. The utility creates a list showing the number of Bars reported by the "Bars" function and shows the success of CopyRates for any selected bar by displaying that bar's time from the collected data (or, it shows the error).

    RSI Levels Expert Advisor RSI Levels Expert Advisor

    Classic trading strategy based on RSI levels. Buys when RSI is oversold and sells when RSI is overbought. This expert advisor is designed with visual strategy builder - Mission Automate. Code is generated automatically. More info: /en/articles/4951