MQ L5 Wizard - Trade Signals Based on Reversal Candlestick Patterns
This is a powerful addition to your MetaTrader 5 toolkit designed to optimize market analysis and performance. 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 Reversal Candlestick Patterns
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
provides the automatic creation of Expert Advisors (see ).
The CSignalCandles class provides trade signals, based on reversal candlestick patterns. The strategy called
"Signals based on reversal candlestick patterns"
(when creating EA automatically in MQL5 Wizard).
The idea of the system is to indentify the reversal patterns using the calculation of the composite candle. The reversal patterns is similar to the "Hammer" and "Hanging Man" patterns in Japanese candlestick analysis. But it uses the composite candle instead the single candle and doesn't need the small body of the composite candle to confirm the reversal.
Input parameters:
Range - maximal number of bars, used in the calculation of the composite candle.
Minimum - minimal size of the composite candle (in conventional points).
ShadowBig and ShadowSmall - shadows (in composite candle units).
Limit, StopLoss and TakeProfit - open price, SL and TP levels, the values defined relative to the close price of the composite candle(composite candle units).
Expiration - order expiration time (in bars), used in trading with pending orders (Limit!=0.0).
The reversal candlestick patterns are determined as follows.
It calculates the composite candle parameters starting from the recent completed bar (with index 1) to the number of bars, defined by Range input parameter. If the composite candle size is greater than value, specified by Minimum input parameter, it checks the reversal conditions of the composite candle by analysis of its shadows.
The bears power is characterized by size of the upper shadow of the composite candle, the bulls power is characterized by size of the lower shadow.
To confirm the reversal of the bearish trend (and start of the bullish) it is needed the following: the size of the lower shadow (bulls power) must be greater than value, defined by ShadowBig input parameter. The size of the upper shadow (bears power) must be less than value, defined by ShadowSmall input parameter.
To confirm the reversal of the bullish trend (and start of the bearish) it is needed the following: the size of the upper shadow (bears power) must be greater than value, defined by ShadowBig input parameter. The size of the lower shadow (bulls power) must be less than value, defined by ShadowSmall input parameter.
In addition to the reversal strategy, it's possible to use the breakdown strategies by specifying the negative value of Limit input parameter (see ).
Depending on Limit, three different ways of market entry are used:
Limit>0. It will enter on back movement on the price, better than market price (The Buy Limit or Sell Limit pending orders will be placed depending on trade signal)
Limit<0. It will enter in price movement direction (The Buy Stop or Sell Stop pending orders will be used depending on trade signal).
Limit=0. It will trade using the market prices.
This strategy is implemented in CSignalCandles class.
Figure 1. Trade signals, based on reversal candlestick patterns
Trade signals
The trade signals are implemented in CSignalCandles class, there is a Candle() function, used for the analysis:
Several candles (bar) can be used in construction of the composite candle. The minimal number of bars is defined by Range parameter. In some cases, the composite candle can be formed with candles, less than Range (when the size/shadows conditions are satisfied). The Candle function returns 0 if the composite candle cannot be formed.
1. Open long position
To open long position, the bullish composite candle is needed. The function checks it and return if the the composite candle is not formed yet or the composite candle is bearish. Overwise, it calculates the composite candle size (needed for calculation of price, SL and TP levels) and calculates the price levels for pending order.
Note, that pending order type (Buy Limit or Buy Stop) is dependent on sign of Limit input parameter (if Limit=0 or |price-ask|<stops level, it will place market buy order, if Limit>0, it will place the Buy Limit pending order, if Limit<0, the Buy Stop pending order will be placed).
2. Close long position
If the bearish composite candle has formed, the long position is closed.
3. Open short position
The bearish composite candle must be formed to open short position. If the composite candle isn't formed, or it's not bearish, return. Overwise we determine its size and calculate price levels of pending order
(the order type depends on sign of the Limit input parameter, see "Open long position").
4. Close short position
If the bullish composite candle has formed, the short position is closed.
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 reversal candlestick patterns
" in "Creating Ready-Made Expert Advisors" option of :
Figure 2. Select "Signals based on reversal candlestick patterns 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 M15, testing period: 1.1.2010-05.01.2011, Range=3, Minimum=50, ShadowBig=0.5, ShadowSmall=0.2, Limit=0, StopLoss=2.0, TakeProfit=1.0, Expiration=4).
In creation of Expert Advisor we used the fixed volume (, 0.1), Trailing Stop algorithm is not used ().
Figure 3. Testing Results of the Expert Advisor with trading signals, based on reversal candlestick patterns
Attachments:
The SignalCandles.mqh with CSignalCandles class must be placed to terminal_data_folder\MQL5\Include\Expert\Signal folder.
The expert_candles.mq5 contains the code of the Expert Advisor, created using MQL5 Wizard.