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
Because it is common sense! If you are using only "open price data", you don't have any information on ticks to be able to know what the spread was on the opening tick. You only have the "MqlRates" data available to you and that has an average spread component.
https://www.mql5.com/en/docs/constants/structures/mqlrates
Because it is common sense! If you are using only "open price data", you don't have any information on ticks to be able to know what the spread was on the opening tick. You only have the "MqlRates" data available to you and that has an average spread component.
Easy! Look at the documentation about the MqlRates which I provide in previous post and in your code print out the bar's "spread" component and see for yourself.
Easy! Look at the documentation about the MqlRates which I provide in previous post and in your code print out the bar's "spread" component and see for yourself.
There is two explanations for this "spread" component in the MqlRates - some defend it is the Maximum spread and some defend that it is the Average.
Irrespective of what it is Average or Maximum, it does not matter, because the only import fact here in your case, is that it is the spread that is used during the Open Price only testing.
So, in order to prove me right (or wrong), update you code to print out that value and compare it to the difference (Ask-Bid). Should it be consistently always the same, then you have confirmed what I stated, and if it is different, then you can state that I am wrong.
So, run the test!
EDIT: Here is supposedly the official information about what the "spread" component represents, namely the "maximum":
Exactly, I don't see the word "AVERAGE" for spread. For example I was assuming this spread should be for bar opening price only(exacly as it was at moment of opening), but not for all bar in AVERAGE. Where did you find about average, kindly?
What is stored in rate spread is not documented and it has already changed in the past. It's also no consistent between different timeframes. (That's last time I checked).
On your backtests you get different ask prices because different spread are used, on Open Prices it's the spread of the bar of the timeframe you used. On Every tick it's the spread of M1 bar (and also on 1 Minute OHLC of course). All these modes are using emulated ticks.
Only on Every tick using real ticks, the tick bid/ask prices are used from history.
...
EDIT: Here is supposedly the official information about what the "spread" component represents, namely the "maximum":
I am afraid it's obsolete information. It was not like that the last time I checked (some months ago).
That is why I stated "supposedly", because MetaQuotes has yet to declare an official position about this in the documentation. It also seems that brokers use their own rules for this as well.
some defend it is the Maximum spread and some defend that it is the Average
Who are this "some", ain't there a strict directive in documentation? Do you know this for sure or it's just forum experience. Thank's.
See my previous post as well as @Alain Verleyen's previous posts!
Also, plenty of the information we users use is provided by other users on the forum, because MetaQuotes themselves are not very forthcoming and transparent. Their attitude towards users most of the time, is in my opinion, one of contempt.
What is stored in rate spread is not documented and it has already changed in the past. It's also no consistent between different timeframes. (That's last time I checked).
On your backtests you get different ask prices because different spread are used, on Open Prices it's the spread of the bar of the timeframe you used. On Every tick it's the spread of M1 bar (and also on 1 Minute OHLC of course). All these modes are using emulated ticks.
Only on Every tick using real ticks, the tick bid/ask prices are used from history.