Analysis of test results and optimisation in the MetaTrader 5 strategy tester - page 16

 
Ilya Malev #:
That's what I ended up doing.
Then the slipping problem is solved.
 
fxsaber #:
Then the slip problem is solved.

I think it is, yes, solved. No orders - no slippage. 😹

And at the same time there is no non-execution of them on "missed" during tick generation ask prices. Except for the stop out, of course.....
 
Stanislav Korotky #:

chasing the regime at opening prices clearly implies a willingness to be more loyal to accuracy.

It is hard to disagree.
 
Ilya Malev #:
Anyway, you can't edit the count mode even in a custom symbol.
A lot of things can be done by post-processing the history in OnTesterDeinit. I have done the processing of commissions, having no success with the settings in the tester. In addition, I removed positions that are forcibly closed at the end of the test from the calculations, which spoil the statistics.
 
Edgar Akhmadeev #:
You can do a lot of things post-processing the history in OnTesterDeinit.
Only, probably, OnTester. Indeed, it is possible to recalculate profit via OrderOpenPriceRequest and OrderClosePriceRequest for Optimisation modes.
 
Ilya Malev #:

So I went down the path of creating a custom symbol in the beginning. I thought that turning OHLC into OHHLLC (O-Hbid-Hask-Lbid-Lask-C) would solve the problem. But it didn't solve the problem - it only introduced more discrepancies in the tests, so I didn't investigate the reasons further. Now I understand what the reason is - in the different mechanism of triggering orders in the Open Price Only mode and the Real Tickmode (for OHHLLC to work, you need to run the custom symbol in the Real Tick mode). Because in the first case triggering will go without sliding, and in the second case with sliding, and if you make six ticks from one bar, especially if the bar is not M1, but for example H1, this sliding will make the test results obviously inadequate.

And take into account that the All ticks mode generates a stream of ticks from minute bars, i.e. within a minute the spread is fixed by the value that is set once in a minute bar(most likely by the value that was at the opening). Real ticks are the only adequate intra-minutes model in MT5 tester. I did not realise this for a long time and used All ticks everywhere in tests. Until one day recently I got a picture of a completely opposite profitability chart with the All ticks and Real ticks modes on one of my Expert Advisors (in that Expert Advisor there is a very close to the price trawl of orders, which was made within the spread).

Well, it kind of goes without saying - if you generate special ticks, you need to enable work on them.

And the spread is most likely taken from the M1 bar, and the minimum spread per bar is prescribed in bars, and this is the problem - departure from reality.

 
Stanislav Korotky #:
And the spread is most likely taken from the M1 bar, and the minimum spread per bar is prescribed in bars, and that's the problem - a departure from reality.
Even so - minimum? Let's know
 
fxsaber #:
Just OnTester, I guess.
Sure
 
Edgar Akhmadeev #:
A lot can be done by post-processing the story in OnTester.

And here's another thing. From the very beginning of programming in MQL5, I have included in the engine a table with the data of the brokerage centres I have dealt with. Commissions, average spread, average slippage, clock translation rule (US/EU)....

I read from the account, where I am connected to, what type of account (demo/real, in rare cases you can define cent account), and take data from the table.

 
fxsaber #:
Checked, it matches: using only one CustomTicksReplace is enough.
Except for the flags.
Новая версия платформы MetaTrader 5 build 5370: улучшения в веб-версии
Новая версия платформы MetaTrader 5 build 5370: улучшения в веб-версии
  • 2025.10.16
  • www.mql5.com
В пятницу 17 октября 2025 года будет выпущена обновленная версия платформы MetaTrader 5...