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

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

Intro

The idea for this robot was born more than two years ago. Namely, I wanted to have an EA that will have more different signals, so in that case, I don't have to use different robots than just one. And so the idea for the Hulk was born. Honestly, now when I remember those days it wasn't easy for me to solve all problems, primarily because those are my beginner's days in programming, and frankly I was more into Python programming language than MQL5. But after a while, the hard work paid off. The first version of  Hulk was released exactly on 31.05.2020

General information about the robot

So the Hulk gives you a choice to choose between a large number of signals. Pick one signal, set other necessary fields such as risk level, and so on, and the robot will start trading immediately. But before you do that, you need to test the robot on one of the Demo accounts, at least for a while.

Inputs

I already explained these inputs on the page where the Hulk is. So, I will give only a general review.

Money Management

• Set volume risk in percent[0...100]
• Decrease factor (must be greater than 0). The main purpose of this input is to control our losses, and according to that, this function decreases lot size automatically.

Exit Rules

• Stop Loss level (in points). Everything is clear here, so there is no need to explain anything.
• Take Profit level (in points). Same here.

Entry/ Exit Rules Based On Signal Rules

• Signal threshold value to open [...0...100]
• Signal threshold value to close [...0...100]

These two inputs can be used independently of our SL, and TP target, or in combination with them. If we decide to use them independently, in that case, we set SL and TP to zero and then set these inputs with the desired values. In that case, the robot will open and close orders automatically in the appropriate ratio, eg 40/20 or 80/20, 50/50, or 10/10. Generally speaking, these two input parameters allow specifying threshold levels for open and close positions. If you set these two parameters with 0, means that closing of the positions will be done only when closing conditions will be true. In any other case that's not the case. So, the smaller the number is, the harder is to open and close positions and vice versa.

Order Type

• Price level to execute a deal [...-100..0..100...](in points). If our level is set to ZERO, we instruct our robot to open market buy/sell orders. If we want to trade using a stop sell/buy order, we must determine the appropriate level of points and tell the robot where we want to open our stop order in relation to the current price. Choosing all numbers below ZERO means we give instructions to a robot to open Stop pending order at the given level. Choosing all numbers above ZERO means we give instructions to a robot to open Limit pending order at the given level.
• Expiration of pending orders in bars[0....]. So, if we use pending orders, then using these options makes sense. How this works. For example, if we trade on the H1 timeframe, each bar is one hour.  So if we set the expiration whit 1, means that the pending orders will expire in one hour.

Trailing Rules based on fixed Stop Level

• Activate
• Stop Loss trailing level (in points)
• Take Profit trailing level (in points)

Inputs For Trailing (SAR

• Activate
• Speed increment
• Maximum rate

Inputs For Trailing (MA)

• Activate
• Period of MA
• Shift
• Method
• Prices series

Auxiliary

• Expert Magic Number

The following are 22 indicator-based strategies that I will skip today and move on to 28 candle-based strategies. I promise to come back to this topic and explain all these strategies in the coming days.

The general rule for candle formation used in the Hulk EA

3 Black Crows 3 White Soldiers candlestick reversal patterns

A bearish candlestick pattern is used to predict the reversal of the current uptrend. This pattern consists of three consecutive long-bodied candlesticks that have closed lower than the previous day with each session's open occurring within the body of the previous candle.

A bullish candlestick pattern is used to predict the reversal of the current downtrend. This pattern consists of three consecutive long-bodied candlesticks that have closed higher than the previous day, with each session's open occurring within the body of the previous candle.

The pattern is valid as long as the candle of day two opens in the upper half of day one's range. By the end of day two, it should close near its high, leaving a very small or non-existent upper shadow. The same pattern is then repeated on day three. So, the Hulk has four signals formed based on this formation of Japanese candle, using MFI, CCI, RSI, Stochastic indicators as confirmation. Based on these patterns, four signals are formed along with default inputs:

1. Signal 3 Black Crows & 3 White Soldiers con. by MFI
2. Signal 3 Black Crows & 3 White Soldiers con. by CCI
3. Signal 3 Black Crows & 3 White Soldiers con. by RSI
4. Signal 3 Black Crows & 3 White Soldiers con. by Stochastic

Bullish Engulfing/ Bearish Engulfing  reversal candlestick patterns

Bullish Engulfing" reversal pattern forms in a downtrend when a small black candlestick is followed by a large white candlestick that completely eclipses ("engulfs") the candlestick of the previous day. The shadows (tails) of the small candlestick are short, which enables the body of the large candlestick to cover the entire candlestick from the previous day.

"Bearish Engulfing" reversal pattern forms an uptrend when a small white candlestick is followed by a large black candlestick that completely eclipses ("engulfs") the candlestick of the previous day. The shadows (tails) of the small candlestick are short, which enables the body of the large candlestick to cover the entire candlestick from the previous day.

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

1. Signal Bullish/Bearish Engulfing con.by MFI
2. Signal Bullish/Bearish Engulfing con. by CCI
3. Signal Bullish/Bearish Engulfing con. by RSI
4. Signal Bullish/Bearish Engulfing con. by Stochastic

Bullish/Bearish Harami reversal candlestick patterns

The Bullish Harami reversal pattern forms in a downward trend when a large candlestick is followed by a smaller candlestick whose body is located within the vertical range of the larger body. This pattern indicates that the falling trend (downtrend) may be reversing, it signals that it's a good time to enter into a long position. The second candlestick is opened with a gap up.

The smaller the second (white) candlestick, the more likely the reversal.

The Bearish Harami reversal pattern forms in an upward trend when a large candlestick is followed by a smaller candlestick whose body is located within the vertical range of the larger body. This pattern indicates that the rising trend (uptrend) may be reversing, it signals that it's a good time to enter into a short position. The second candlestick is opened with a gap down.

The smaller the second (black) candlestick, the more likely the reversal.

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

1. Signal Bullish/Bearish Harami con.by MFI
2. Signal Bullish/Bearish Harami con.by CCI
3. Signal Bullish/Bearish Harami con.by RSI
4. Signal Bullish/Bearish Harami con.by Stochastic

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 up 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 discernable using bar charts as it is with candlestick charts. The more penetration of the close on the second day to 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 con. 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 formed 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 formed 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 con.by MFI
2. Signal Hammer/Hanging Man con. by CCI
3. Signal Hammer/Hanging Man con. by Stochastic
4. Signal Hammer/Hanging Man con. by RSI

Bullish/Bearish Meeting Lines

Bullish Meeting Lines consist of two candlesticks (bearish and bullish) with equal (or very close) 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) 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

Morning Star indicates the reversal of the downtrend, it consists of three candles (Fig. 1). After a long black candle, there is a candle (the color isn't important) with a small body, which lies outside the body of the black candle. The small body of a candle means that the strengths of the bulls and bears are equal and the market is ready to change the trend.

The third candle of the pattern is the bullish candle, its body isn't overlapped with the body of the second candle, and close price lies inside the body of the first (bearish) candle. The resulting candle of the model is also plotted in Figure 1.

For this case, if the second candle is a Doji-candle, the model is named "Morning Doji Star".

Evening Star indicates the reversal of uptrend, it consists of three candles (Fig. 2). After a long white candle, there is a candle (the color isn't important) with a small body, which lies outside the body of the white candle. The small body of a candle means that the strengths of the bulls and bears are equal and the market is ready to change the trend.

The third candle of the pattern is the bearish candle, its body isn't overlapped with the body of the second candle, and close price lies inside the body of the first (bullish) candle. The resulting candle of the model is also plotted in Figure 2.

For this case, if the second candle is Doji-candle, the model is named "Evening Doji Star".

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

1. Signal Morning/Evening Stars con.by MFI
2. Signal Morning/Evening Stars con.by CCI
3. Signal Morning/Evening Stars con.by RSI
4. Signal Morning/Evening Stars con.by Stochastic

Recommendation of inputs for all Candlestick Patterns are:

___ Money Management ___

• Set volume risk in percent[0...100] = 1
• Decrease factor (must be greater than 0) = 20

___ Exit Rules ___

• Stop Loss level (in points) =0
• Take Profit level (in points) = 0

___ Entry/ Exit Rules Based On Signal Rules ___

• Signal threshold value to open [...0...100] = 40. We decided to use this input instead of our SL. So in this case our  SL is set to  0. We can also use this option in combination with SL, everything depends on what we want.
• Signal threshold value to close [...0...100] = 20.Same here.

___ Order Type  ___

• Price level to execute a deal[...-100..0..100...](in points) =0. Zero means you will be immediately on the market, and the robot will open buy/sell market orders.
• Expiration of pending orders in bars[0....] = 0. This option is used only for Pending orders such as Limit or Stop orders type. Therefore, no adjustment is required with any number, except zero, which means this option is not active.

Trailing rules are not used, but this not need to be mandatory. The inputs for this signal are already set in expert advisor and these are default values, which does not mean that they are the best values. This rule applies to all recommended inputs.

Optimization process basic steps

How to optimize the Hulk to get the most optimal inputs, for your strategy for example, and other inputs you intend to use. It is not necessary to optimize all inputs. Select three or four inputs, using a larger step during the optimizing process to avoid Overoptimization.

I will make just a small review of how to do this because the complete optimization guide can be found on the MQL5 website at the following link:

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 risk level and decrease factor then you need to choose your win-loss ratio, for example, 2:1, or 3:1, etc... Don't forget, all inputs are in points, not pips. 100 points = 10pips  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 …