Navigation


 Publications


 Go back to the forum

Forex Stock Exchange Forum    

"Hulk" Trading Robot (Expert Advisor) For MT5 Trading Platform

gandra | Published on the wed Mar 10, 2021 11:05 pm | 3283 Views

Intro

More than two years ago, the seed of an innovative idea was planted in my mind. The concept emerged from a desire to create an expert advisor (EA) with a diverse array of signals, eliminating the need for multiple robots. Thus, the genesis of the Hulk robot began. Reflecting on those early days, it wasn't a smooth journey, especially given my novice status in programming. My affinity for Python over MQL5 posed an additional challenge. Nevertheless, perseverance prevailed, and the fruits of labor materialized on May 31, 2020, with the release of the inaugural version of Hulk.

General information about the robot

versatile selection. Choose a signal, configure essential parameters such as risk level, and initiate trading with ease. However, before embarking on live trading, a crucial step is to test the robot on a demo account, allowing users to familiarize themselves with its functionality. This precaution ensures a comprehensive understanding and optimizes the robot's performance.

Inputs

Money Management:

Exit Rules:

Entry/Exit Rules Based on Signal Rules:

These inputs can be used independently or in combination with Stop Loss (SL) and Take Profit (TP) targets. If used independently, with SL and TP set to zero, the robot will automatically open and close orders based on the specified ratio (e.g., 40/20, 80/20, 50/50, or 10/10). Lower values make opening and closing positions more stringent, while higher values ease these conditions.

Order Type:

Trailing Rules based on a Fixed Stop Level:

Inputs for trailing (SAR):

Inputs for trailing (MA):

Auxiliary:

Note: The subsequent section involves 22 indicator-based strategies, which will be skipped for now. We'll delve into 28 candle-based strategies in the upcoming days, promising a comprehensive explanation of each strategy.

The general rule for candle formation used in the Hulk EA

Three Black Crows, Three White Soldiers candlestick reversal patterns

A bearish candlestick pattern is employed to anticipate a reversal in the prevailing uptrend. This pattern comprises three consecutive long-bodied candlesticks that have closed lower than the preceding day. Importantly, each session's opening occurs within the body of the previous candle.

Conversely, a bullish candlestick pattern is utilized to forecast a reversal in the ongoing downtrend. This particular pattern involves three consecutive long-bodied candlesticks that have closed higher than the previous day. In each case, the opening of the session falls within the body of the previous candle.


The validity of the pattern is contingent upon the candle of day two opening in the upper half of day one's range. Furthermore, by the close of day two, it should ideally conclude near its peak, leaving a minimal or non-existent upper shadow. This identical pattern is then replicated on day three. Consequently, the Hulk generates four signals based on these Japanese candle formations, utilizing MFI, CCI, RSI, and stochastic indicators for confirmation. These four signals are formed along with the default inputs:

  1. Signal: Three Black Crows and Three White Soldiers, confirmed by MFI
  2. Signal: Three Black Crows and Three White Soldiers, confirmed by CCI
  3. Signal: Three Black Crows and Three White Soldiers, confirmed by RSI
  4. Signal: Three Black Crows and Three White Soldiers, confirmed by Stochastic


"Bullish Engulfing" and "Bearish Engulfing" Reversal Patterns

A "bullish engulfing" reversal pattern takes shape within a downtrend when a small black candlestick is succeeded by a substantial white candlestick that entirely engulfs the previous day's candlestick. The short shadows (tails) of the small candlestick permit the large candlestick's body to encompass the entire range of the preceding day's candlestick.


Conversely, a "Bearish Engulfing" reversal pattern emerges in an uptrend when a diminutive white candlestick is succeeded by a sizable black candlestick that wholly engulfs the candlestick from the previous day. The brief shadows (tails) of the small candlestick enable the large candlestick's body to cover the entire range of the previous day's candlestick.

These patterns give rise to four signals, accompanied by default inputs:


Bullish or bearish Harami reversal candlestick patterns

The bullish harami reversal pattern materializes within a downtrend when a large candlestick is succeeded by a smaller candlestick, with its body nestled within the vertical range of the larger body. This pattern suggests a potential reversal of the falling trend (downtrend) and serves as a signal to consider entering a long position. Notably, the second candlestick opens with a gap.

The smaller the second (white) candlestick, the higher the likelihood of the reversal.


Conversely, the Bearish Harami reversal pattern unfolds within an uptrend when a large candlestick is followed by a smaller candlestick, and its body is situated within the vertical range of the larger body. This pattern indicates a possible reversal of the rising trend (uptrend) and signals an opportune time to consider entering a short position. Similar to its bullish counterpart, the second candlestick opens with a gap.


The smaller the second (black) candlestick, the greater the likelihood of the reversal.

These patterns give rise to four signals, complemented by default inputs:


Dark Cloud Cover and Piercing Line reversal candlestick patterns

It's a bearish candlestick reversal that occurs at the end of an uptrend. A long white candlestick is formed on the first day and a gap is created on the second day. However, the second day closes below the midpoint of the first day.


The gap down on the second day perpetuates the downtrend. However, the second day's close is above the midpoint of the first day's body. This suggests to the bears that a bottom could be forming. This price action is not nearly as discernible using bar charts as it is with candlestick charts. The more penetration of the close on the second day into the first day's body, the more probable the reversal signal will succeed.


Based on these patterns, four signals are formed along with default inputs:

  1. Signal Dark Cloud Cover/ Piercing Line con. by MFI
  2. Signal Dark Cloud Cover/ Piercing Line con. by CCI
  3. Signal Dark Cloud Cover/ Piercing Line con. by RSI
  4. Signal Dark Cloud Cover/ Piercing Line by Stochastic

Hammer/Hanging Man

The "hammer" is a candlestick with a small body and long lower wick, formed after downward price movement. The "hammer" pattern indicates the end of a bearish trend.

The color of a candlestick body isn't important, but a bullish hammer indicates higher bullish potential. The body of the "Hammer" pattern often forms near the minimum of the previous candle. The longer lower wick and shorter upper wick lead to a higher potential of the reversal pattern.


The "Hanging Man" is a candlestick with a small body and long lower wick, formed after upward price movement. The "Hanging Man" pattern indicates the end of a bullish trend.

The color of a candlestick body isn't important, but a bearish candle indicates higher bearish potential. The body of the "Hanging Man" pattern often forms near the maximum of the previous candle. The longer lower wick and shorter upper wick lead to a higher potential of the reversal pattern.

Based on these patterns, four signals are formed along with default inputs:

  1. Signal Hammer/Hanging Man by MFI
  2. Signal Hammer/Hanging Man by CCI
  3. Signal Hammer/Hanging Man by Stochastic
  4. Signal Hammer/Hanging Man by RSI

Bullish/Bearish Meeting Lines

Bullish meeting lines consist of two candlesticks (bearish and bullish) with equal (or very close) prices. The body of two candlesticks must be greater than the average body length.

The "bullish meeting lines" pattern indicates the reversal of a downward trend.


Bearish meeting lines consist of two candlesticks (bullish and bearish) with equal (or very close) prices. The body of two candlesticks must be greater than the average body length.

The "Bearish Meeting Lines" pattern indicates the reversal of a downward trend.


Based on these patterns, four signals are formed along with default inputs:

  1. Signal Bullish/Bearish Meeting Lines, con. by MFI
  2. Signal Bullish/Bearish Meeting Lines, con. by CCI
  3. Signal Bullish/Bearish Meeting Lines con. by RSI
  4. Signal Bullish/Bearish Meeting Lines con.by Stochastic


Morning Star and Evening Star reversal candlestick patterns

The Morning Star signals a reversal of the downtrend, characterized by three candles (Fig. 1). Following a long black candle, the next candle (color irrelevant) features a small body situated outside the black candle's body. This small-bodied candle suggests a balance between bulls and bears, indicating the market's readiness for a trend reversal.

The third candle in this pattern is bullish; its body does not overlap with the second candle and its closing price lies within the body of the first (bearish) candle. The resulting candle for the model is depicted in Figure 1. If the second candle is a doji candle in this scenario, the model is named "Morning Doji Star."


Conversely, the evening star signals a reversal of the uptrend, consisting of three candles (Fig. 2). After a long white candle, the subsequent candle (color irrelevant) has a small body outside the white candle's body. Similar to the Morning Star, the small-bodied candle signifies a balance between bulls and bears, indicating an impending trend change.

The third candle in this pattern is bearish; its body does not overlap with the second candle and its closing price lies within the body of the first (bullish) candle. The resulting candle of the model is shown in Figure 2. If the second candle is a doji candle in this context, the model is termed "Evening Doji Star."


These patterns yield four signals, accompanied by default inputs:

Recommendations for Inputs for All Candlestick Patterns

Money Management:

Exit Rules:

Entry/Exit Rules Based on Signal Rules:

Order Type:

Trailing Rules:

Optimization process: basic steps

To optimize the Hulk for optimal strategy inputs:

Select Inputs: Choose three or four inputs for optimization, using a larger step to prevent overoptimization.

Review Default Values: Understand default values for inputs and note that they may not be the best for your strategy.

This concise overview is a starting point; for detailed optimization procedures, please refer to the complete guide available on the MQL5 website.

https://www.metatrader5.com/en/terminal/help/algotrading/strategy_optimization

The following pictures are from the MT5 strategy tester!

The first step


The second step is to find Hulk.ex5 file


The next step is


After that, you need to choose the risk level and decrease factor, and then you need to choose your win-loss ratio, for example, 2:1, 3:1, etc. Don't forget, all inputs are in points, not pips. 100 points = 10 pips in most cases because different brokers use different values, but in general, that's it.


Once you are done with the optimization cycles, run Hulk EA on your platform.

to be continued.

About the author