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
Result
tickflag -= tickflag & TICK_FLAG_##A;
The flags structure member in MqlTick is a 32 bits number. So, it can encode up to 32 different flags as a bit-field.
Each flag is specific to one bit from position 0 to position 31. This facilitate to combine (encode) multiple binary attributes into a single number by using simple arithmetic + or bitwise | (or) operators.
The rest of the bit-field is unused or it may be used for adding new attributes in future releases.
The bit at position 7 may indicate that a change has occurred in some flags, i think.
'
Hi, sorry for double post.
The additional bit number 8 seems to change the behavior of the Strategy Tester when using "Real Ticks".
According to this documents https://www.mql5.com/en/docs/runtime/testing#real_ticks, the tester can change the "Rates" value if it diverges from the "Tick" value in case of "Real Ticks" test. For example, if the "Rates" PRICE_OPEN diverges from the tick[0].last in a given minute "Rates", the Strategy Tester ignores the original "Rates", replacing the original "Rates" with a calculated "Rates" with PRICE_OPEN equal to the tick[0].last at that minute.
If the Tick has the flag of bit 8 (value 256), it seems that this divergence correction does not occur.
That seems useful.
But there is a problem when used with custom symbol, because the CustomTicksReplace() command does not apply bit number 8 to the custom symbol Flag, which is created only with the previous bits on Flags.
This behavior occurs only in the Strategy Tester, who makes corrections on bars by divergence of tick when testing "Real Ticks" mode.
When using Scripts - OnStart () - the behavior does not occur.
MetaCotes could create the option of not correcting bars for the Tester "Real TIcks" mode. Or allow CopyTicksReplace() to copy Flag bit number 8.
I have merged the answers from the 2 topics.
Thanks for wasting mine and others' time by selfishly posting the same question twice. (sarcasm)
Sorry for this.