What does MQLtick flag mean?

 

when test MQLtick ,the value of flag is 2,4,6,24 and even BID changed .

what does this value or symbol mean ?

And what is the value of the  following MACRO ?


TICK_FLAG_BID –

TICK_FLAG_ASK  –

TICK_FLAG_LAST –

TICK_FLAG_VOLUME – 

TICK_FLAG_BUY – l

TICK_FLAG_SELL –


thanks .

 
 

i have read it .

but i can not find the valume of the flags ,TICK_FLAG_BID – TICK_FLAG_ASK  – TICK_FLAG_LAST – TICK_FLAG_VOLUME –  TICK_FLAG_BUY –TICK_FLAG_SELL –

 

   I use Print function and now get the valumes .

  But when Print the flag element of MQLtick structure , i get 6 and 24 valumes ,what do they stang for ?


   Print("TICK_FLAG_BID= –",TICK_FLAG_BID);            =2

   Print("TICK_FLAG_ASK= –",TICK_FLAG_ASK);           =4
   Print("TICK_FLAG_LAST= –",TICK_FLAG_LAST);        =8
   Print("TICK_FLAG_VOLUME= –",TICK_FLAG_VOLUME);=16
   Print("TICK_FLAG_BUY= –",TICK_FLAG_BUY);            =32

   Print("TICK_FLAG_SELL= –",TICK_FLAG_SELL);           =64

 
may someone explain the flag valume of 6 and 24 stands for ?
 
yalewang:
may someone explain the flag valume of 6 and 24 stands for ?

It is just name of numbers.

Like MODE_SMA means 0 

 
the instruction manual only defines 6 values ,but no define the flag valume of 6 and 24 .
 
yalewang:
the instruction manual only defines 6 values ,but no define the flag valume of 6 and 24 .
That's why they are flags. Use the names and don't care about the values.
 

They are "flags", that means they are bitwise combined - or in other words: They contain more than one "option":

TICK_FLAG_BID | TICK_FLAG_ASK = 6
TICK_FLAG_LAST | TICK_FLAG_VOLUME = 24
| = OR

 

 To "decode" the info, you need to check by bitwise AND:

      string fl;

      if ((last_tick.flags & TICK_FLAG_BID) == TICK_FLAG_BID) {
         fl += "b";
      }
      if ((last_tick.flags & TICK_FLAG_ASK) == TICK_FLAG_ASK) {
         fl += "s";
      }
      if ((last_tick.flags & TICK_FLAG_LAST) == TICK_FLAG_LAST) {
         fl += "l";
      }
      if ((last_tick.flags & TICK_FLAG_VOLUME) == TICK_FLAG_VOLUME) {
         fl += "v";
      }
      if ((last_tick.flags & TICK_FLAG_BUY) == TICK_FLAG_BUY) {
         fl += "Ob";
      }
      if ((last_tick.flags & TICK_FLAG_SELL) == TICK_FLAG_SELL) {
         fl += "Os";
      }

      Print(fl);


I never got "TICK_FLAG_BUY" or "TICK_FLAG_SELL" so far tho. Don't know what triggers them.

 
nuclearping:

They are "flags", that means they are bitwise combined - or in other words: They contain more than one "option":

 

 To "decode" the info, you need to check by bitwise AND:


I never got "TICK_FLAG_BUY" or "TICK_FLAG_SELL" so far tho. Don't know what triggers them.

thank you for your guide. i have that problem too
""" never got "TICK_FLAG_BUY" or "TICK_FLAG_SELL" """
i do specify sell and buy deal by compare "last" and "ask or bid" but i can't specify and get S/L deal data
 
nuclearping:

I never got "TICK_FLAG_BUY" or "TICK_FLAG_SELL" so far tho. Don't know what triggers them.

TICK_FLAG_BUY or TICK_FLAG_SELL only appear on symbols with Times & Sales feature enabled (mostly stocks and futures). Try to select any MOEX's stock or DGCX's future at Market Watch on MetaQuotes-Demo and you'll see. Regards
Reason: