Reply To: Description of Price Action Engulfing Candles Strategy

Forums Strategies and Expert Advisors Price Action Engulfing Candles EA Description of Price Action Engulfing Candles Strategy Reply To: Description of Price Action Engulfing Candles Strategy


@Dominik wrote:

Hi everyone!

Today I will try to explain you how to make strategy tests reasonably and how to optimize strategy in shortest possible way. This description applies to all currency pairs, commodities, equities, indices etc. The length of the period of testing is dependent on the timeframe. There is a lot of different theories (on this subject), but practice shows that each strategy is different and you can not generalize that there is one perfect way to find the appropriate testing period etc. I made the assumption that for M5 timeframe optimization period since 2010 or 2012 is sufficient. It would be good if the strategy optimized for this period gives good results also from, for example, 2000 year, but unfortunately perfect things in nature do not occur, so we can expect that the strategy optimized for a given period will work best only in the same period. The most important issue is the steady growth with little drawdown, because it allows us to appropriate money management, which contributes to larger profits while increasing the size of the lot without risking a large drawdown.

Techniques to obtain the best strategy may be several, depending on what we expect from the system. If we take maximum profit as the main goal, regardless of any other , we get probably the most aggressive and profitable, but also unstable system with the possibility of a big drawdown in future. If we take drawdown and/or profit factor – we get less profitable, but stable system with sustainable growth. I personally prefer systems with stable growth and proper money management in order to achieve the desired profit in the long term. In my opinion, when the system has the risk reduced to a minimum and brings regular profit then we can talk about success. In all other cases, where the profit is instantaneous and there are large drawdowns on the account, the perspective is so uncertain that it’s comparable to betting on the horses or playing roulette. Exactly this situation is with 99% Expert Advisors, which can be bought on MQL market and in other places – great optimized systems to prove to all people (potential customers) huge profits in a short time, but what happens next, after a few weeks or months of wonderfully work? It blows up accounts of all subscribers and then, with all “magical” profit, this “magical” signal disappears, along with its provider. Who earned? (Hint: only one person) Signal provider!

OK. I go to the point. As you know, our system has a lot of parameters and it would be best to optimize all parameters at the same time, but due to the number of combinations optimizing all at once is practically impossible. Not without reason, the parameter’s list was divided into blocks. Besides that the parameters have been ordered by the relationship to each other, this was done to simplify and shorten in time the process of optimization aswell.

The most important parameters that should be optimized as the first are parameters for: Buy/Sell Stop orders, Take Profit, Break Even, Trailing Stop Loss (optional). All parameters for pattern we can set to “False”. We cun turn off filters: RSI low level=100, ADX low level=0, ADX high level=100, Trading days = all “True”, Trading hours 0-24, all Min size of candles=0, all Max size of candles=5000 or more. We can also turn off “Room to the left” by setting large number (e.g. 5000) as a “Candles_to_Room_to_the_left”. All previously mentioned will be optimized at the very end of optimization process.

As I said, at the beginning of optimizing new period of time, new timeframe or new currency pair, most important parameters are not these which filtrate bad orders (as RSI, ADX, RTTL, sizes etc.), but these which directly determine the circumstances of triggering orders. It is crucial to understand functioning of the system at all stages, so I also suggest to focus on the graphical analysis of system in the “Visual mode” in tester. It’s especially useful in process of removing losing trades through step by step analysis and exclusion conditions leading to losses.

Many parameters can be optimized in pairs or 3 at one time, in different combinations, for example:

1) Candles_To_Take_To Stop + Stops_Distance_from_Extreme + Buy_Sell_Stop_Expiation
2) Candles_To_Take_To_TP + TP_Distance_from_Extreme
3) Candles_To_Take_To_SL + SL_Distance_from_Extreme
4) Candles_To_Take_To_Extreme + Min_Stop_Distance_to_Extreme
5) Candles_To_Room_to_the_left + Room_to_the_left
6) (“BE”=True) BE_Min_Distance_from_Price_To_Modify_Order + BE_Distance_from_Open_Order_Price
7) (“Sl_Follow”=True) SL_Follow_Points_from_Price + SL_Follow_Min_Distance_from_SL
When we have best parameters for number 7) we can test 2 cases of “SL_Follow”: True and False.
8) All parameters frm “Engulfing pattern” block together
9) All sizes of candles can be optimized separately
10) RSI_Period + RSI_Low_Level
11) ADX_Period + ADX_Low_Level + ADX_High_Level
12) All parameters from “Trading Days” together
13) “Trading hours” can be optimized separately

This method (points above) is the fastest, in my opinion. If regardless of settings of parameters strategy isn’t good enough for specified currency pair or timeframe it may be necessary to make some changes in code of program. As always, I wait for every proposals of changes which would improve our system.

In a few days I’ll try to make short video with example of optimization process and with another description and I will upload link here.

It’s already enough for today. If you have any questions please feel free to ask here.


Dominik, thank you for a description of the expert optimization settings, and that too many parameters to optimize immediately. and do not know that to start to optimize in the first place.