Discussion of article "Developing a cross-platform grid EA (Last part): Diversification as a way to increase profitability"
The problem of grids is that the optimiser selects settings so that to get to an unfavourable chart with a minimum lot. This is not how it happens in life. At first, positions are accumulated on the middle market, then a very unfavourable chart comes for a short time and hello to the Margin Call.
It has been proven many times that without a profitable trading system, nets and martins will not improve trading performance.
Can anyone provide a setting set ? I'm running this EA and it's not even opening normal trades... I'd really like to try this.
Thank you, sir.
Can anyone provide a setting set ? I'm running this EA and it's not even opening normal trades... I really want to try this.
Thank you, sir.
I don't feel like I can set the parameters, it always says timer not set, can anyone help?
Thank you for your articles, I have thoroughly studied your code and borrowed some ideas for my robot. I would like to wish you to treat your code more carefully, at least to think up clear and logical names for variables, so that one could immediately understand why a variable is needed. Especially if you post your code for public viewing. And you should comment the code more.
They wrote about the small number of trades and fitting to history - I optimised your robot on the M1 timeframe, which gave from 4 thousand trades for 3 years, the best instances gave quite stable results.
It is absolutely inconvenient to work with the absolute amount of money as the goals of the Expert Advisor, it would be a thousand times better if you chose to set the number of pips as goals, and in addition to a static lot, as an option - a percentage of the maximum allowable lot. Otherwise, even just moving from one budget in the tester to another is a big problem, you have to restart optimisation.
By the way, somewhere it was written about gradual increase of lot - I have not found anything about it in the code, maybe not the latest version.
I was also very confused by the strategy of entering by MA, which usually considers either increasing or decreasing of MA value. In the code it looks like this:
if (buf0[0] > buf0[6]) { //--- MA grows } else if (buf0[0] < buf0[6]) { //--- MA drops }
Why is the value of the seventh bar compared to the current bar? Where is the logic? What if it is a flat and between the 1st and 7th bar the MA was rising and falling? It seems that you didn't care much about this point, perhaps you wanted to finish the article quickly. In my opinion, it is necessary to consider a stable growth for several bars in a row to confirm it. I have written a code to catch confirmed reversals or stable growth/decline of array values for several bars and I am sharing it with you:
//+------------------------------------------------------------------+ //| Catching the indicator reversal| //+------------------------------------------------------------------+ bool getReverse(double & object [], string direction, int repeatsIn, int repeatsOut) { bool reverseCorrect = true; if (direction == "up") { if (repeatsOut > 0) { for(int i = 0; i <= (repeatsOut - 1); i++) { if (!(object[i] > object[i+1])) reverseCorrect = false; } } if (repeatsIn > 0) { for(int i = repeatsIn; i <= (repeatsIn + repeatsOut - 1); i++) { if (!(object[i] < object[i+1])) reverseCorrect = false; } } } else { if (repeatsOut > 0) { for(int i = 0; i <= (repeatsOut - 1); i++) { if (!(object[i] < object[i+1])) reverseCorrect = false; } } if (repeatsIn > 0) { for(int i = repeatsIn; i <= (repeatsIn + repeatsOut - 1); i++) { if (!(object[i] > object[i+1])) reverseCorrect = false; } } } return reverseCorrect; }
Use it like this:
getReverse(MA1Val, "up", 0, 7);
In this example, the function will return true if the MA1 value has been rising for 7 consecutive bars. If you replace 0 with, for example, 3, it will look for a pattern where MA first fell 3 bars in a row and then rose for 7 bars in a row.
I will not comment on other indicators, there is also something to think about. Even when using standard indicators you can add more logic.
Good luck!
gsc:
代码里没有开单程序,只有平单程序,大量重复的参数和程序,毫无用处的错误判断和创建物件,这是我见过的最垃圾的
Can you help write an ea thanks

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Developing a cross-platform grid EA (Last part): Diversification as a way to increase profitability has been published:
In previous articles within this series, we tried various methods for creating a more or less profitable grid Expert Advisor. Now we will try to increase the EA profitability through diversification. Our ultimate goal is to reach 100% profit per year with the maximum balance drawdown no more than 20%.
If we do not alter the underlying trading system, there are two possible ways, which might help us increase profitability.
However, this method has a significant drawback. Past profit does not guarantee future profits. The lower the time interval used for EA testing, the higher the risk of that a strategy can be destroyed by market changes.
Author: Roman Klymenko