MQL5 Wizard: Trading Signals with Morning/Evening Stars and RSI Confirmation

MQL5 Wizard: Trading Signals with Morning/Evening Stars and RSI Confirmation
Download ALL MT5 experts (1593)
YouTube Video Thumbnail



Similar MetaTrader Tools

MQL5 Wizard: Trading Signals with Morning/Evening Stars and RSI Confirmation

Info

The MQL5 Wizard: Trading Signals with Morning/Evening Stars and RSI Confirmation is a Expert Advisor for MetaTrader 5 that this tool enables the creation of ready-made expert advisors using the classes provided with the client terminal. It allows for rapid testing of trading ideas by creating your own 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: Trading Signals with Morning/Evening Stars and 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 using 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 using the classes provided with the client terminal. It allows for rapid testing of trading ideas by creating your own trading signals class. The structure of this class and an example can be found in the relevant article. The general concept involves deriving a trading signals class from the base class, then overriding the virtual methods with your custom logic.

Also recommended: trade signals using reversal candlestick patterns in mql5 - similar expert with strong performance on MetaTrader 5.


A book titled "Trading Strategies" (in Russian) discusses numerous trading strategies. This guide focuses on reversal candlestick patterns confirmed by indicators and oscillators.

It is recommended to create a separate class derived from the base class specifically for identifying candlestick patterns. For confirming trade signals generated by candlestick patterns, you can create a class derived from ccandlepattern and add necessary features, such as confirmation by oscillators.

This guide details signals based on "morning star/evening star" (including morning doji star/evening doji star) reversal candlestick patterns, confirmed by the RSI indicator. The trading signal module is based on the provided class, offering a simple example for creating trade signals with candlestick patterns.

1. Morning Star and Evening Star Reversal Candlestick Patterns

1.1. Morning Star
This pattern signals a downtrend reversal and consists of three candles. Following a long black candle, a candle with a small body (color is not critical) appears, lying outside the body of the black candle. A small body indicates a balance between buying and selling pressure, suggesting a potential trend change. The third candle is a bullish candle, with its body not overlapping the second candle's body. The closing price lies within the body of the first (bearish) candle. Figure 1 illustrates this pattern and the morning doji star variation, where the second candle resembles a doji. The identification is handled by the checkpatternmorningstar() and checkpatternmorningdoji() methods within the class, using checkcandlestickpattern() for confirmation.

1.2. Evening Star
This pattern indicates an uptrend reversal and also comprises three candles. After a long white candle, a candle with a small body appears, lying outside the white candle's body. Similar to the morning star, a small body suggests market equilibrium and a potential trend reversal. The third candle is a bearish candle, its body not overlapping the second candle's body, and its closing price is within the first (bullish) candle's body. Figure 2 shows this pattern and the evening doji star variation. The methods for identifying these patterns are also available within the class, using checkcandlestickpattern() for confirmation.

2. Trade Signals Confirmed by RSI Indicator
Trading signals for opening long or short positions must be confirmed by the RSI indicator. The RSI value should be below 40 for long positions and above 60 for short positions. Position closure depends on RSI values, occurring when it reaches opposite critical levels (70 for long, 30 for short) or when a reverse signal is not confirmed (RSI reaching 30 for long, 70 for short). Figure 3 depicts a morning star pattern confirmed by RSI.

The cms_es_rsi::longcondition() method checks conditions for opening a long position (returns 80) and closing a short position (returns 40). The cms_es_rsi::shortcondition() method checks 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 "morning star" pattern must be confirmed by RSI(1) < 40. A short position should be closed if the RSI crosses upward past critical levels of 70 or 30.

2.2. Open Short Position / Close Long Position
The formation of an "evening star" pattern must be confirmed by RSI(1) > 60. A long position should be closed if the RSI crosses downward past critical levels of 70 or 30.

2.3. Creating an Expert Advisor Using MQL5 Wizard
The cms_es_rsi class is not part of the standard library. To use it, download the acms_es_rsi.mqh file and save it to the client_terminal_data_folder\mql5\include\expert\signal\mysignals folder, along with the candlepatterns.mqh file. After restarting MetaEditor, you can use these files in the MQL5 Wizard. To create an Expert Advisor, launch the MQL5 Wizard, specify the Expert Advisor name, and configure general properties. Subsequently, select the trade signal modules. In this case, we use only one module: "Signals based on morning/evening stars confirmed by rsi". Add this module, select trailing properties (e.g., "trailing stop not used"), and configure money management properties (e.g., "trading with fixed trade volume").

Pressing "Finish" generates the Expert Advisor code in expert_ams_es_rsi.mq5, saved in the terminal_data_folder\mql5\experts\ folder. The default input parameters of the generated Expert Advisor need adjustment. The signal_thresholdopen and signal_thresholdclose input parameters allow customization of threshold levels for opening and closing positions. In the code, fixed threshold values are set: 80 for opening positions and 40 for closing positions. The Expert Advisor uses "votes" from trade signal modules for opening and closing positions. The main module's vote is also considered, but its methods return 0. Vote averaging is employed; with the main module and one additional module, thresholds should be adjusted accordingly (e.g., 40 = (0+80)/2 for opening, 20 = (0+40)/2 for closing). Setting signal_stoplevel and signal_takelevel to 0 ensures position closing occurs only based on defined closing conditions.

2.4. History Backtesting Results
Backtesting of the Expert Advisor was performed on historical EURUSD H1 data from 2010.01.01 to 2011.03.04, with specific indicator periods (k=47, d=9, slow=13, ma_period=5). Fixed volume (0.1) was used, and trailing stop was not enabled. Figure 11 shows the testing results. The optimal input parameters can be found using the Strategy Tester in MetaTrader 5. Parameter analysis is simplified with the Graph visualizer available from build 419 onwards (Figure 12), displaying balance as a function of RSI and MA periods.

The Expert Advisor code generated by the MQL5 Wizard is attached as expert_ms_es_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\acms_es_rsi.mqh>
#include <expert\trailing\trailingnone.mqh>
#include <expert\money\moneyfixedlot.mqh>
input string expert_title         ="expert_ams_es_rsi"; // document name
ulong        expert_magicnumber   =23752;               // 
bool         expert_everytick     =false;               // 

.......

Leave your opinion, ask a question, share some knowledge

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.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.