sergey087: I read about it here https://www.mql5.com/en/docs/integration/python_metatrader5/mt5copyticksfrom_py#tick_flag But if I do query, server will return flags as 230/100/226 ... etc. How to decode them to really values? Maybe table or formula is allow for decode all possible int values? Where is it?
Just as the name says — they are "bit flags" or "binary flags". Here are some references for Python ...
Enum vs Flag for bitmasks in Python | Bjarne Magnussen
Binary flags with Python
And here are some MQL5 references ...
Forum on trading, automated trading systems and testing trading strategies
Sergey Gritsay, 2016.12.11 07:23
Please advise which type of flag corresponds to number 24. Experimentally determined that
- TICK_FLAG_BID = 2
- TICK_FLAG_ASK = 4
- TICK_FLAG_LAST = 8
- TICK_FLAG_VOLUME = 16
- TICK_FLAG_BUY = 32
- TICK_FLAG_SELL = 64
Forum on trading, automated trading systems and testing trading strategies
William Roeder, 2017.02.21 17:27
Since anding with a bit mask can only result in zero or the bit mask and since non-zero is true if((tick.flags &TICK_FLAG_BID)==TICK_FLAG_BID) s+="BID|";
if((tick.flags &TICK_FLAG_ASK)==TICK_FLAG_ASK) s+="ASK|";
if((tick.flags &TICK_FLAG_LAST)==TICK_FLAG_LAST) s+="LAST|";
if((tick.flags &TICK_FLAG_VOLUME)==TICK_FLAG_VOLUME) s+="VOL|";
if((tick.flags &TICK_FLAG_BUY)==TICK_FLAG_BUY) s+="BUY|";
if((tick.flags &TICK_FLAG_SELL)==TICK_FLAG_SELL) s+="SELL|";Code can be simplified. if(tick.flags & TICK_FLAG_BID) s+="BID|";
if(tick.flags & TICK_FLAG_ASK) s+="ASK|";
if(tick.flags & TICK_FLAG_LAST) s+="LAST|";
if(tick.flags & TICK_FLAG_VOLUME) s+="VOL|";
if(tick.flags & TICK_FLAG_BUY) s+="BUY|";
if(tick.flags & TICK_FLAG_SELL) s+="SELL|";
Enum vs Flag for bitmasks in Python | Bjarne Magnussen
- Bjarne Magnussen
- blog.magnussen.casa
Ever wondered what’s behind those funny looking Unix access permission values like ✋, ⚠, or 😈? Well, they are octal representations, where each of the three rightmost digits represents a different part of the permissions for owner, group, and others. Each of these digits is created from the sum of its component bits. As a result, specific bits...
Thanks!
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
I read about it here https://www.mql5.com/en/docs/integration/python_metatrader5/mt5copyticksfrom_py#tick_flag
But if I do query, server will return flags as 230/100/226 ... etc
How to decode them to really values? Maybe table or formula is allow for decode all possible int values?
Where is it?