Download MetaTrader 5

MqlTick Flags

To add comments, please log in or register
Trade with MetaTarder 5. Download it right now!
LasloLesla
8
LasloLesla 2016.03.21 01:09 

Hello, I'm kinda new to Trading but I've been programming in C#, C++, Obj-C for a while now, I ain't having any big issues at the moment with Mql5 but this with MqlTick flags...

On this code:

void OnInit()
  {
      Print("Ask: ", TICK_FLAG_ASK, " Bid: ", TICK_FLAG_BID, " Buy: ", TICK_FLAG_BUY, " Last: ", TICK_FLAG_LAST, " Sell: ", TICK_FLAG_SELL, " Volume: ", TICK_FLAG_VOLUME);
  }

I get 2, 4, 8, 16, 32, 64 respectivelly:

But trying to get it from SymbolInfoTick() I get different numbers:

void OnTick()
  {
   MqlTick last_tick;
//---
   if(SymbolInfoTick(Symbol(),last_tick))
     {
      Print(last_tick.flags, " ");
     }
   else Print("SymbolInfoTick() failed, error = ",GetLastError());
//---
  }



Where do the 6 and 24 come from?? What do they represent??

It only shows 2, 4, 6 and 24 as flags for all sessions all the time, no Sell or Buy flags.

Is it an issue with my broker's data feed?? I'm with FXPro.


Can somebody please clarify this issue?


Thank you!

yalewang
606
yalewang 2016.03.21 01:38  

I have found this problem ,and post here last week .

but noone cares it .

Alain Verleyen
Moderator
30775
Alain Verleyen 2016.03.21 08:09  
yalewang:

I have found this problem ,and post here last week .

but noone cares it .

These are flag, that means the MqlTick.flags can report several flag.

6 = 2 + 4 => change in Bid AND Ask.

24 = 16 + 8 => change in Last AND Volume.

etc...

If you don't have Buy or Sell flag that means the broker doesn't provide them.

To add comments, please log in or register