
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
With much experimenting, I have come to similar conclusions. I don't know why it took me so long to find this article and discussion.
I started with a problem where my break out and trend riding strategies tended to fit themselves to a few super profitable trades. So much profit from these few that the optimizer only "cared" about these few trades and used wide stops and far away take profit and making sure its signal caught and milked these few trades to the maximum. this occurred even on 20 year samples with 100's of trades. Even when optimizing with a dd to profit ratio, it still went after the runs with these trades at all costs cause the runs were 90% of its profit. I wanted to limit this behavior in some way without cutting the head off of the breakout/trend ride strat. I found that optimizing for relative dd percent (NOT dd ratio to profit, just dd relative percent only and nothing much else) gives good results going forward as long as minimum trades and minimum profit factor (about 1.3) are met.
It seems wrong to not have profit involved but by having a pf minimum criteria, mostly quite profitable runs are appearing at the top. Cropping out dd from profitable runs is usually increasing profits. In any case, by selecting the more profitable trades and doing the final touch-ups carefully manually by hand (such as near the end of this excellent article https://www.mql5.com/en/articles/156), I can allow the optimizer to do a lot of the initial work while avoiding a lot of curve fitting. Ive experimented and had mixed results with code such as the following. (Experiments should include changing risk and starting balance too once you begin put additional weights in on top of a percent based score)
Can anyone tell me if this article will be applicable for MT4? It seems that it has already adopted many properties from MT5.
In general, my task is to get just the values of LR Correlation and LR Standard Error in the MT4 tester, as it can be easily seen in the MT5 tester.
I just want to read these values in the deinit() function at the end of the test run and write them to a file together with the value of the optimised parameter.
Maybe someone has already done such things and will share with me the ready result (the necessary function for calculating LR Correlation and LR Standard Error values) so that I don't have to reinvent the wheel?
Can anyone tell me if this article will be applicable for MT4? It seems that it has already adopted many properties from MT5.
In general, my task is to get just the values of LR Correlation and LR Standard Error in the MT4 tester, as it can be easily seen in the MT5 tester.
I just want to read these values in the deinit() function at the end of the test run and write them to a file together with the value of the optimised parameter.
Maybe someone has already done such things and will share with me the ready result (the necessary function for calculating LR Correlation and LR Standard Error values) so that I don't have to reinvent the wheel?
An example of calculating LR Correlation and LR Standard Error for trades in history is available in AlgLib (MQL4\Scripts\Alglib\UseAlglib.mq4).
Thank you! I'll look into it.
I got it. The correlation seems to be calculated.
The only thing I had to think about is the fact that this point does not work in the MT4 Build 670 tester:
There are simply no orders with type 6 in the tester.
That is, when running in the MT4 tester and using the code from UseAlglib.mq4, which is included in the downloaded zip file, through a call from the deinit() function.
balance remains equal to 0. And then the error"Trading operations with zero balance" is printed.
I had to simply insert the necessary value of the initial balance in the MT4 tester into the code itself and then everything was counted perfectly.
Perhaps the developers can take this point into account in future versions of the library.
I have tested Kelly Criterion (Strategy), using the following code:
I am not sure if Metatrader Strategy Tester computes 0 (zero) profit trades as profit trades. Anyone?
Well, here I am again, the lone wolf in this universe :-)
I have been trying the straightness Custom Criteria trying to get the slope of the calculated straight line into the equation. As is it can give you a very hgh rating on a very feeble profit. Just adding the end profit
into the caculation does not make it any better In an attempt to add the actual slope into the equation I changed the code lilke seen below.
It is not a perfect solution but it is closer to what I want to see. Using result together wit balance or profit works fine for me with this code
I know it's been so long since you posted this but in case you are still playing with this or someone else are looking for the same straightness criteria implementation.
I found a working public solution here https://community.darwinex.com/t/equity-curve-straigthness-optimization-with-metatrader/3976
The relating tutorial has too much info, such as specifically about programming an EA, which is in other tutorial, and non-applicable to average punter, who, will buy their EA and has minimal programming ability.
I find, that by default, the only useful criterions for MT5 in genetic algo is the "balance max", then have to repeat that a few times, and fish through results til find low drawdown, as for use on multiple pairs.
What criterions I need :- Max balance with <20 Drawdown, MaxBalance with <10 Drawdown