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

 
Ilya Malev #:
You have not understood, I asked a question, why in the history of quotes M1 and older, the spread is specified in the old format (like 130), but trades in the tester are executed as if it was already specified there in the new format (like 13).
You wording is unclear. The broker changed symbol's digits from 3 to 2, but then you call it (citation) - the "new" 3-digit format. Also you provided an expert log, which can print values in a custom way, with any precision, and corresponding source code is not provided. As I can see both logs show supposedly "current" 2 digit format, as it supposedly goes from the symbol properties - so what's the problem?
 
Ilya Malev #:
sees the spread and makes trades as if the spread was recorded on these bars in the "new" 2-digit format. How do they do it? :)
(Ask - Bid) / Point
 
Stanislav Korotky #:
Your wording is not clear. The broker has changed the digitisation of the symbol from 3 to 2, but you call it (quote) a "new" three digit format.

You are absolutely correct, I misspelled that. Of course the new format is 2-digit, as I wrote at the very beginning. And then there was a typo (already corrected)

Stanislav Korotky#:
You also provided an expert log that can output values in any form, with any accuracy, but you didn't provide the corresponding source code. As I see, both logs show supposedly "current" 2-digit format, as supposedly follows from the symbol properties - so what is the problem?

The expert log outputs values with quote accuracy, it is made now, already after the sign change, accordingly its quote accuracy = 2. Spread value is measured as (Ask-Bid)/_Point, all tests are made after changes in the quotes value, this property is set in the contract specification and it (as far as I know) cannot be taken into account retrospectively, i.e. to apply one accuracy format to some bars and another to others. And there are no separate Bid and Ask fields in the M1+ past price information record, just the OHLC field and the Spread field specified in integer. However, the tester draws a conclusion from this field and price, for example, at the time of opening the order on the first screen 2025.10.16 at 10:00, with a minute spread of 200, which can be seen on the screen, the opening price of the bar is 4222.79, that its Ask is 4222.99, as if the spread at that moment was specified not 200, but 20. Since the pip step does not change retrospectively and in both cases is 0.01 (new format)


Анализ результатов тестов и оптимизации в тестере стратегий MetaTrader 5
Анализ результатов тестов и оптимизации в тестере стратегий MetaTrader 5
  • 2025.10.22
  • www.mql5.com
Рассмотрим результаты тестов на одном и нескольких символах. Тесты будем проводить в режиме Все тики...
 

fxsaber #:

(Ask - Bid) / Point
But why in the test "Only opening prices", and H1, still the spread is calculated correctly, because in the source of ticks generation, which should be bars M1 (if not H1 at all), the integer spread in the old 3-digit format is specified at this time
 
Ilya Malev #:
But why in the test "Only opening prices", and H1, the spread is still counted correctly, because in the source of ticks generation, which should be M1 bars (if not H1 at all), an integer spread in the old 3-digit format is specified at this time
There is no tick generation in the opening prices mode.
 
fxsaber #:
In the mode by opening prices there is no tick generation.

How does the tester get Ask prices for execution of Buy trades in this mode?

By "generation of ticks" I meant the sequence of OnTick runs, they are definitely available, and each of them has current prices - Bid and Ask.

 
Ilya Malev #:

How does the tester get Ask prices for execution of Buy trades in this mode?

In tkc-files there are headers for each day of the month. Similarly in hcc-files. I.e. for each day a different _Point is stored.
 
fxsaber #:
The tkc files have headers for each day of the month. Similarly in hcc-files. That is, there is a different _Point stored for each day.
In other words, the spread parameter in OHLC bars is a bogus phenomenon that does not really affect anything?
 
fxsaber #:
The tkc files have headers for each day of the month. Similarly in hcc-files. I.e. for each day a different _Point is stored.

The _Point value in the tester does not change before changing the value of quotes. It remains the same as it is set in the specification of contracts at the beginning of the test. In the M1 spread, the value of the spread at the old _Point is recorded, however, the Ask price is formed as if the Point was 3-digit. If the spread was taken from the minute bar, the Ask at trade opening would be 200 * 0.01 + 4222.79 = 4224.79, not 4222.99


 
Ilya Malev #:

The _Point value in the tester does not change before changing the quotes value.

Look at the question that was answered. Then - how the spread is calculated.