MQL5 Wizard: Trading Signals with Morning/Evening Stars and Stochastic Oscillator
Info
The MQL5 Wizard: Trading Signals with Morning/Evening Stars and Stochastic Oscillator is a Expert Advisor for MetaTrader 5 that this tool enables the creation of ready-made expert advisors (eas) based on classes provided with the client terminal. It allows for quick testing of your 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 Stochastic Oscillator
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 (EAs) based on 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 (EAs) based on classes provided with the client terminal. It allows for quick testing of your trading ideas by creating your own trading signals class. The structure and an example of this class can be found in the provided resources.Also recommended: trade signals using reversal candlestick patterns in mql5 - similar expert with strong performance on MetaTrader 5.
The general concept is to derive a trading signals class from a base class, and then override the virtual methods with your custom logic.
This guide focuses on reversal candlestick patterns, specifically the Morning Star and Evening Star patterns, confirmed by the Stochastic Oscillator.
Morning Star Pattern
This pattern signals a potential reversal of a downtrend and consists of three candles. After a long bearish candle, there is a candle with a small body, indicating a balance between buyers and sellers. The third candle is bullish, with its closing price falling within the body of the first candle. A variation, the Morning Doji Star, occurs when the second candle is a Doji.
Evening Star Pattern
This pattern signals a potential reversal of an uptrend and also consists of three candles. Following a long bullish candle, there is a candle with a small body. The third candle is bearish, with its closing price within the body of the first candle. A variation, the Evening Doji Star, occurs when the second candle is a Doji.
Trading Signals Confirmed by Stochastic Oscillator
Trading signals for opening long or short positions are confirmed by the Stochastic Oscillator. For a long position, the %K line must be below 30. For a short position, it must be above 70.
Position Closing Conditions:
- For long positions: Close when the %K line crosses above 80 or falls below 20.
- For short positions: Close when the %K line crosses below 20 or rises above 80.
Opening Long Position / Closing Short Position:
- The formation of a Morning Star pattern must be confirmed by the Stochastic Oscillator: stochsignal(1) < 30.
- A short position should be closed if the Stochastic Oscillator's signal line crosses upward the 20 or 80 levels.
Opening Short Position / Closing Long Position:
- The formation of an Evening Star pattern must be confirmed by the Stochastic Oscillator: stochsignal(1) > 70.
- A long position should be closed if the Stochastic Oscillator's signal line crosses downward the 80 or 20 levels.
Creating an Expert Advisor using the MQL5 Wizard
To use the custom signal classes (e.g., CMS_ES_Stoch, CandlePatterns), they need to be saved in the appropriate MQL5 include folders. After restarting the MetaEditor, these can be utilized in the MQL5 Wizard.
Steps to Create an EA:
1. Launch the MQL5 Wizard.
2. Specify the Expert Advisor name.
3. Select the trading signal modules to use. In this case, add the 'Signals based on morning/evening stars by stochastic' module.
4. Configure trailing stop properties (e.g., 'trailing stop not used').
5. Configure money management properties (e.g., 'trading with fixed trade volume').
6. Press 'Finish' to generate the Expert Advisor code.
The generated EA code (e.g., expert_ams_es_stoch.mq5) will be saved in the 'experts' folder.
Default Input Parameters and Adjustments
The default input parameters may require adjustment. The signal_thresholdopen and signal_thresholdclose parameters control the threshold levels for opening and closing positions. Since the EA uses a main module and one trade signal module, the votes need to be averaged. For example, thresholdopen might be set to 40 and thresholdclose to 20.
The signal_stoplevel and signal_takelevel parameters are often set to 0, indicating that position closing relies solely on the specified closing conditions.
History Backtesting Results
Backtesting results on historical data (e.g., EURUSD H1 from 2000 to 2011) with specific parameters (periodK=12, periodD=8, slowPeriod=29, MA_period=4) using fixed volume (0.1) and no trailing stop, demonstrate the performance of the EA. The optimal input parameters can be found using the Strategy Tester within MetaTrader 5.
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_stoch.mqh>
#include <expert\trailing\trailingnone.mqh>
#include <expert\money\moneyfixedlot.mqh>
input string expert_title ="expert_ams_es_stoch"; // document name
ulong expert_magicnumber =9182; //
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.