MQL5 Wizard: Trading Signals with Bullish/Bearish Meeting Lines and Stochastic Confirmation
Info
The MQL5 Wizard: Trading Signals with Bullish/Bearish Meeting Lines and Stochastic Confirmation is a Expert Advisor for MetaTrader 5 that this tool allows the creation of ready-made expert advisors based on provided classes. It enables quick testing of trading ideas by creating custom trading signal classes.
Usage
This tool is typically used for automated trading on major forex pairs and gold.
Platform
This Expert Advisor works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Experts folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use MQL5 Wizard: Trading Signals with Bullish/Bearish Meeting Lines and Stochastic Confirmation
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.
What this tool does
This tool allows the creation of ready-made Expert Advisors based on provided classes.
Typical Use Case
This Expert Advisor excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Expert Advisor works on MetaTrader 5. Place the file in the MQL5/Experts folder and restart the terminal.
Description & Settings
Related: automated trading with mq l5 wizard: crossover of two exponentially smoothed moving averages - another powerful expert for MetaTrader 5 traders.
This tool allows the creation of ready-made Expert Advisors based on provided classes. It enables quick testing of trading ideas by creating custom trading signal classes. Detailed instructions and examples are available in the accompanying documentation. The core concept involves deriving a trading signal class from a base class and overriding specific virtual methods with custom logic. A comprehensive guide, "Trading Strategies Using MQL5" (available in Russian), explores various trading strategies. This discussion focuses on reversal candlestick patterns, confirmed by the Stochastic indicator. It is recommended to create a separate class for detecting candlestick patterns and another class, derived from CCandlestickPattern, to implement custom features like oscillator confirmation for trading signals. This article specifically details trading signals based on the "Bullish/Bearish Meeting Lines" reversal candlestick patterns, confirmed by the Stochastic indicator.Also recommended: trade signals using reversal candlestick patterns in mql5 - similar expert with strong performance on MetaTrader 5.
Meeting Lines Reversal Candlestick Patterns
Bullish Meeting Lines
This pattern consists of two candlesticks, a bearish followed by a bullish, with nearly equal closing prices. The body of both candlesticks should be larger than the average body length. The "Bullish Meeting Lines" pattern typically signals a reversal of a downtrend. Visual representation of the "Bullish Meeting Lines" pattern can be found in Figure 1. Pattern recognition is handled by the checkpatternbullishmeetinglines() method within the relevant class.
Bearish Meeting Lines
This pattern comprises two candlesticks, a bullish followed by a bearish, with very close closing prices. The body of these candlesticks should exceed the average body length. The "Bearish Meeting Lines" pattern suggests a potential reversal of an uptrend. Visual representation of the "Bearish Meeting Lines" pattern can be found in Figure 2. Pattern recognition is implemented in the checkpatternbearishmeetinglines() method of the corresponding class.
Trading Signals Confirmed by Stochastic Indicator
Trading signals for opening long or short positions require confirmation from the Stochastic oscillator. The signal line should be above 30 for a long signal and below 70 for a short signal. Position closing is triggered by Stochastic indicator values in two scenarios: - When the signal line reaches the opposite critical level (80 for long positions, 20 for short positions). - When a reverse signal is not confirmed (signal line reaches 20 for long positions, 80 for short positions). Figure 3 illustrates the "Bearish Meeting Lines" pattern confirmed by the Stochastic indicator. The CML_Stoch::LongCondition() method checks conditions for opening a long position (returns 80) and closing a short position (returns 40). The CML_Stoch::ShortCondition() method checks conditions for opening a short position (returns 80) and closing a long position (returns 40).
Open Long Position / Close Short Position
The formation of a "Bullish Meeting Lines" pattern must be confirmed by the Stochastic indicator, specifically stochsignal(1) < 30 (the signal line of the last completed bar must be less than 30). A short position should be closed if the indicator's signal line crosses above the 20 or 80 levels.
Open Short Position / Close Long Position
The formation of a "Bearish Meeting Lines" pattern must be confirmed by the Stochastic indicator, specifically stochsignal(1) > 70 (the signal line of the last completed bar must be greater than 70). A long position should be closed if the indicator's signal line crosses below the 80 or 20 levels.
Creating an Expert Advisor Using the MQL5 Wizard
The CML_Stoch class is not part of the standard library. To use it, download the acml_stoch.mqh file and the candlepatterns.mqh file. Save them in the \MQL5\Include\Expert\Signal\MySignals folder within your client terminal's data directory. After restarting MetaEditor, these files will be available in the MQL5 Wizard. To create an Expert Advisor, launch the MQL5 Wizard (Figure 4). Specify the Expert Advisor's name (Figure 5). Next, select the trading signal modules to be used (Figure 6). In this case, we are using a single trading signal module. Add the "Signals based on Bullish/Bearish Meeting Lines Confirmed by Stochastic" trading signal module (Figure 7). The trading signal module has been added (Figure 8). Choose any trailing stop properties; for this example, we will use "Trailing stop not used" (Figure 9). For money management, select "Trading with fixed trade volume" (Figure 10). Clicking the "Finish" button will generate the Expert Advisor code, saved as expert_aml_stoch.mq5 in the \MQL5\Experts\ directory of your terminal's data folder. The default input parameters for the generated Expert Advisor require adjustment. The signal_thresholdopen and signal_thresholdclose input parameters control the threshold levels for opening and closing positions. The longcondition() and shortcondition() methods within the trade signal class specify fixed threshold values: - Open position: 80 - Close position: 40 The Expert Advisor generated by the MQL5 Wizard uses "votes" from trading signal modules to open and close positions. The main module's vote is also considered, although its longcondition() and shortcondition() methods return 0. The main module's vote results are used in averaging "votes." With one additional trade signal module, the thresholdopen and thresholdclose parameters should be set to 40 ( (0+80)/2 ) and 20 ( (0+40)/2 ) respectively, to account for the main module's zero vote. The signal_stoplevel and signal_takelevel input parameters are set to 0, indicating that positions will only close based on explicit closing conditions.
History Backtesting Results
Backtesting was performed on historical data (EURUSD H1, testing period: 2005.01.01-2026.03.16, PeriodK=6, PeriodD=3, SlowPeriod=36, MA_Period=3). Fixed volume (0.1) was used for Expert Advisor creation, and no trailing stop algorithm was employed. Figure 11 displays the testing results of the Expert Advisor based on Bullish/Bearish Meeting Lines and Stochastic confirmation. The optimal set of input parameters can be identified using the Strategy Tester in the MetaTrader 5 client terminal. The code for the Expert Advisor generated by the MQL5 Wizard is attached as expert_aml_stoch.mq5.
You may also like: mql5 wizard: trade signals with dark cloud cover/piercing line and rsi confirmation - excellent alternative for expert users on MetaTrader 5.
Source Code
#property copyright "robotfx"
#property link "https://robotfx.org"
#property version "1.00"
#include <expert\expert.mqh>
#include <expert\signal\mysignals\acml_stoch.mqh>
#include <expert\trailing\trailingnone.mqh>
#include <expert\money\moneyfixedlot.mqh>
input string expert_title ="expert_aml_stoch"; // document name
ulong expert_magicnumber =3765; //
bool expert_everytick =false; //
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.