mql5 wizard: expert advisors for bullish/bearish engulfing with rsi confirmation
Info
The mql5 wizard: expert advisors for bullish/bearish engulfing with rsi confirmation is a Expert Advisor for MetaTrader 5 that this tool enables the creation of ready-made expert advisors by leveraging the classes provided with the client terminal. it facilitates the rapid testing of trading ideas; all that is required is to create a custom trading signals class.
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: expert advisors for bullish/bearish engulfing with rsi 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 enables the creation of ready-made expert advisors by leveraging the classes provided with the client terminal.
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 enables the creation of ready-made expert advisors by leveraging the classes provided with the client terminal.Also recommended: trade signals using reversal candlestick patterns in mql5 - similar expert with strong performance on MetaTrader 5.
it facilitates the rapid testing of trading ideas; all that is required is to create a custom trading signals class.the structure of this class and an example can be found in the provided resources.
the core concept involves deriving a trading signals class from the base class, and then overriding the virtual methods with custom implementations.
a book titled "trading strategies" (available in russian) explores numerous trading strategies. this guide focuses on reversal candlestick patterns, specifically confirmed by rsi and other oscillators.
it is recommended to create a separate class derived from the base pattern checking class to identify candlestick patterns.
to confirm trade signals generated by these patterns, a class derived from the candlestick pattern class can be created, incorporating additional features such as oscillator confirmations.
this guide details signals based on the "bullish engulfing/bearish engulfing" reversal candlestick pattern, confirmed by the rsi indicator.
the trade signal module is built upon a specific class, providing a simple example for creating trade signals using candlestick patterns.
1. "bullish engulfing" and "bearish engulfing" patterns
1.1. bullish engulfing
the "bullish engulfing" reversal pattern emerges during a downtrend. it is characterized by a small black candlestick followed by a large white candlestick that completely engulfs the previous day's candlestick.
the shadows (wicks) of the small candlestick are short, allowing the body of the large candlestick to fully cover the prior day's candle.
the recognition of the "bullish engulfing" pattern is implemented within the checkpatternbullishengulfing() method.
the checkcandlestickpattern(candle_pattern_bullish_engulfing) method is utilized to detect the formation of this pattern.
1.2. bearish engulfing
the "bearish engulfing" reversal pattern appears in an uptrend. it consists of a small white candlestick followed by a large black candlestick that completely engulfs the previous day's candlestick.
similar to the bullish pattern, the shadows of the small candlestick are short, enabling the body of the large candlestick to entirely cover the prior day's candle.
the identification of the "bearish engulfing" pattern is handled by the checkpatternbearishengulfing() method.
the checkcandlestickpattern(candle_pattern_bearish_engulfing) method is used to verify the occurrence of this pattern.
2. trade signals confirmed by rsi indicator
trade signals for opening long or short positions require confirmation from the rsi indicator.
the rsi value must be below a critical level for long positions (e.g., 40) and above a critical level for short positions (e.g., 60).
the closure of open positions depends on the rsi values.
positions can be closed in two scenarios:
- when the rsi reaches the opposite critical level (e.g., 70 for long positions, 30 for short positions).
- when a reverse signal is not confirmed (e.g., rsi reaches 30 for long positions, 70 for short positions).
the cbe_be_rsi::longcondition() method checks the conditions for opening a long position (returns 80) and closing a short position (returns 40).
the cbe_be_rsi::shortcondition() method checks the conditions for opening a short position (returns 80) and closing a long position (returns 40).
2.1. open long position / close short position
the formation of a "bullish engulfing" pattern must be confirmed by the rsi indicator, with rsi(1) < 40 (the rsi value of the last completed bar must be less than 40).
a short position should be closed if the rsi has crossed upward past the critical levels of 70 or 30.
2.2. open short position / close long position
the formation of a "bearish engulfing" pattern must be confirmed by the rsi indicator, with rsi(1) > 60 (the rsi value of the last completed bar must be greater than 60).
a long position should be closed if the rsi has crossed downward past the critical levels of 70 or 30.
2.3. creating an expert advisor using mql5 wizard
the cbe_be_rsi class is not part of the standard library. to use it, download the acml_rsi.mqh file and save it to the client_terminal_data_folder\mql5\include\expert\signal\mysignals.
similarly, save the acandlepatterns.mqh file to the same directory.
after restarting the metaeditor, these files can be used in the mql5 wizard.
to create an expert advisor, launch the mql5 wizard.
specify the desired name for the expert advisor.
next, select the trade signal modules to be used.
in this case, only one trade signal module is utilized.
add the "signals based on bullish engulfing/bearish engulfing confirmed by rsi" module.
the trade signal module has been added.
trailing stop properties can be selected as desired; however, "trailing stop not used" will be employed here.
regarding money management properties, "trading with fixed trade volume" will be used.
upon clicking the "finish" button, the expert advisor code will be generated and saved as expert_abe_be_rsi.mq5 in the terminal_data_folder\mql5\experts\ directory.
the default input parameters of the generated expert advisor should be adjusted.
the signal_thresholdopen and signal_thresholdclose input parameters allow for the specification of threshold levels for opening and closing positions.
within the longcondition() and shortcondition() methods of the trade signals class, fixed threshold values have been set:
- open position: 80
- close position: 40
the expert advisor, generated by the mql5 wizard, opens and closes positions based on "votes" from the trade signal modules.
the vote from the main module (which acts as a container for all added modules) is also considered. its longcondition() and shortcondition() methods consistently return 0.
the vote results of the main module are factored into the averaging of votes.
in this configuration, with the main module plus one trade signal module, this needs to be accounted for when setting threshold values.
consequently, thresholdopen should be set to 40 (calculated as (0+80)/2) and thresholdclose to 20 (calculated as (0+40)/2).
the signal_stoplevel and signal_takelevel input parameters are set to 0, indicating that position closures will occur solely based on the defined closing conditions.
2.4. history backtesting results
the backtesting of the expert advisor on historical data (eurusd h1, testing period: 2010.01.01-2011.03.04, periodrsi=11, ma_period=5) is examined.
a fixed volume (0.1) was used in the expert advisor's creation, and no trailing stop algorithm was applied.
the optimal set of input parameters can be determined using the strategy tester within the metatrader 5 client terminal.
the code for the expert advisor generated by the mql5 wizard is attached as expert_abe_be_rsi.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\acbe_be_rsi.mqh>
#include <expert\trailing\trailingnone.mqh>
#include <expert\money\moneyfixedlot.mqh>
input string expert_title ="expert_abe_be_rsi"; // document name
ulong expert_magicnumber =17008; //
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.