Download MetaTrader 5

what does MQLtick flag mean ?

To add comments, please log in or register
Having difficulties in understanding the Trading Signals service? Read the article!
yalewang
606
yalewang 2016.03.07 08:43 

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 .

Alain Verleyen
Moderator
30775
Alain Verleyen 2016.03.07 10:03  
yalewang
606
yalewang 2016.03.07 10:17  

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 –

yalewang
606
yalewang 2016.03.07 12:37  

   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

yalewang
606
yalewang 2016.03.09 14:24  
may someone explain the flag valume of 6 and 24 stands for ?
Vasyl Nosal
18559
Vasyl Nosal 2016.03.09 14:26  
yalewang:
may someone explain the flag valume of 6 and 24 stands for ?

It is just name of numbers.

Like MODE_SMA means 0 

yalewang
606
yalewang 2016.03.09 15:23  
the instruction manual only defines 6 values ,but no define the flag valume of 6 and 24 .
Alain Verleyen
Moderator
30775
Alain Verleyen 2016.03.09 15:29  
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.
nuclearping
10
nuclearping 2016.06.24 21:34  

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.

Ehsan Tavakoli
163
Ehsan Tavakoli 2016.10.05 20:46  
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
Jose Francisco Casado Fernandez
2405
Jose Francisco Casado Fernandez 2016.10.06 15:43  
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
12
To add comments, please log in or register