MQ L5 Wizard - Trade Signals Based on Price Crossover with Moving Average Indicator
This professional-grade solution for MetaTrader 5 helps traders achieve greater efficiency in their daily workflow. This Expert Advisor serves as automated trading software. It is utilized to monitor financial markets and execute trades based on predefined algorithmic rules, enabling precise position management without the need for constant manual oversight.
How to Setup and Use MQ L5 Wizard - Trade Signals Based on Price Crossover with Moving Average Indicator
1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.
2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.
3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.
4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.
Frequently Asked Questions
Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.
Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.
Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.
Description & Settings
allows to create the code of Expert Advisors automatically. See for the details.
Here we will consider the strategy based on price crossover with Moving Average indicator. The strategy called
"Signals based on price crossover with MA"
(when creating EA automatically in MQL5 Wizard).
The trade signals:
Buy: upward crossover of price with Moving Average.
Sell: downward crossover of price with Moving Average.
The checking of MA increase/decrease is used to filter false signals.
This strategy is implemented in class of the of MQL5 Standard Library (located in MQL5\Include\Expert\Signal\SignalMA.mqh).
Figure 1. Trade signals based on price crossover with Moving Average
Trade Signals
The trading strategy is implemented in class, it has some protected methods to simplify access to indicators and price values:
The price and indicator values of the 0th (uncompleted) bar may change, so it's necessary to perform the checking of trade conditions using the completed (formed) bars data.
1. Open long position
Conditions to open long position (price crossover with MA and checking of MA increase):
Open(1)<MA(1): opening price is lower than moving average;
Close(1)>MA(1): closing price is higher than moving average;
MA(1)>MA(2): check increase of moving average (to filter false signals).
2. Close long position
Conditions to close long position (price crossover with MA and checking of MA decrease):
Open(1)>MA(1): opening price is higher than moving average;
Close(1)<MA(1): closing price is lower than moving average;
MA(1)<MA(2): check decrease of moving average (to filter false signals).
3. Open short position
The conditions to open short position are the same as long position closing conditions.
4. Close short position
The conditions to close short position are the same as long position opening conditions.
Creating Expert Advisor using MQL5 Wizard
To create a trading robot based on the strategy you need to choose the signal properties as "
Signals based on price crossover with MA
" in "Creating Ready-Made Expert Advisors" option of :
Figure 2. Choose "Signals based on price crossover with MA" in MQL5 Wizard
The next you have to specify the needed algorithm and system. The code of Expert Advisor will be created automatically, you can compile it and test in of MetaTrader 5 client terminal.
Testing Results
Let's consider backtesting of the Expert Advisor on historical data (EURUSD H1, custom period: 1.1.2010-05.01.2011, MA_period=12, MA_Shift=0).
In creation of Expert Advisor we used the fixed volume (, 0.1), Trailing Stop algorithm is not used ().
Figure 3. Historical backtesting results of the Expert Advisor, based on price crossover with MA
Attachments:
The SignalMA.mqh with class (included in ) is located at MQL5\Include\Expert\Signal folder. The file crossoverma.mq5 contains the code of the Expert Advisor, created using MQL5 Wizard.