Tick flags codification - how to understand?

 

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?

Documentation on MQL5: Integration / MetaTrader for Python / copy_ticks_from
Documentation on MQL5: Integration / MetaTrader for Python / copy_ticks_from
  • www.mql5.com
copy_ticks_from - MetaTrader for Python - Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
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

        Testing 'CopyTicks'

        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

        CopyTicks question

        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
        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!
        Reason: