MqlTick: How to handle flag TICK_FLAG_LAST | TICK_FLAG_VOLUME

 

Hello,

I'm trying to understand MqlTick. This is a volume / order flow log I've recorded some days ago.

2016.06.24 21:36:01.504 OrderFlow (EURUSD,H1)   6  = bs @ 2016.06.24 22:36:00: Bid = 1.11108 Ask = 1.11120 Last = 1.11108   Volume = 2250000
2016.06.24 21:36:00.737 OrderFlow (EURUSD,H1)   2  = b  @ 2016.06.24 22:35:59: Bid = 1.11109 Ask = 1.11121 Last = 1.11109   Volume = 4250000
2016.06.24 21:36:00.378 OrderFlow (EURUSD,H1)   6  = bs @ 2016.06.24 22:35:59: Bid = 1.11110 Ask = 1.11121 Last = 1.11110   Volume =  250000
2016.06.24 21:36:00.131 OrderFlow (EURUSD,H1)   2  = b  @ 2016.06.24 22:35:58: Bid = 1.11109 Ask = 1.11120 Last = 1.11109   Volume = 1000000
2016.06.24 21:36:00.032 OrderFlow (EURUSD,H1)   6  = bs @ 2016.06.24 22:35:58: Bid = 1.11112 Ask = 1.11120 Last = 1.11112   Volume =  250000
2016.06.24 21:36:00.023 OrderFlow (EURUSD,H1)   24 = lv @ 2016.06.24 22:35:58: Bid = 1.11110 Ask = 1.11121 Last = 1.11112   Volume =  250000 b < l
2016.06.24 21:36:00.023 OrderFlow (EURUSD,H1)   24 = lv @ 2016.06.24 22:35:58: Bid = 1.11110 Ask = 1.11121 Last = 1.11112   Volume =  250000 b < l
2016.06.24 21:35:59.651 OrderFlow (EURUSD,H1)   6  = bs @ 2016.06.24 22:35:58: Bid = 1.11110 Ask = 1.11121 Last = 1.11110   Volume = 3250000
2016.06.24 21:35:58.848 OrderFlow (EURUSD,H1)   24 = lv @ 2016.06.24 22:35:57: Bid = 1.11108 Ask = 1.11120 Last = 1.11108   Volume = 3250000 b = l
2016.06.24 21:35:56.497 OrderFlow (EURUSD,H1)   4  = s  @ 2016.06.24 22:35:55: Bid = 1.11108 Ask = 1.11120 Last = 1.11108   Volume = 2250000
2016.06.24 21:35:56.363 OrderFlow (EURUSD,H1)   4  = s  @ 2016.06.24 22:35:54: Bid = 1.11108 Ask = 1.11121 Last = 1.11108   Volume = 2250000
...
2016.06.24 20:59:57.301 OrderFlow (EURUSD,H1)   24 = lv @ 2016.06.24 21:59:55: Bid = 1.11202 Ask = 1.11213 Last = 1.11201   Volume = 2000000 b > l
2016.06.24 20:59:57.301 OrderFlow (EURUSD,H1)   24 = lv @ 2016.06.24 21:59:55: Bid = 1.11202 Ask = 1.11213 Last = 1.11201   Volume = 2000000 b > l

b = BUY order
s = SELL order
bs = BUY & SELL (trade happened?)
lv = LAST & VOLUME changed 

So far everything is pretty self-explaining. But I'm wondering what happens when the flag is = 24 (TICK_FLAG_LAST | TICK_FLAG_VOLUME). From my observations they always seem to appear together and sometimes "last" is != "bid" . Sometimes lower, sometimes higher, but always < "ask".

So what happens on the market when this appears? I could think of someone moving their LMT. But if this is true, how do I know if it is on the bid or ask side? And what happens when "bid" = "last". I don't think of a trade happening there, because I assume thats indicated by flag 6 ("bs").

EDIT:
Or could it be that there was a trade happening to that price and "last" is the new current market price? Think that makes more sense.

Anyknow here knowing more? Thank you! :) 

 

Anyone? I'm still trying to figure out what exactly happens when the flags are "BS" or "LV".

Really hope somebody could bring some clarification.

Thanks! :) 

 
nuclearping:

Anyone? I'm still trying to figure out what exactly happens when the flags are "BS" or "LV".

Really hope somebody could bring some clarification.

Thanks! :) 

I'm ignoring the flags !!!

just do it in code:


//--- BEGIN CODE

MqlTick tick_array[];
int copied=CopyTicks(_Symbol,tick_array,COPY_TICKS_TRADE,0,10);

// Latest loop
for(int i=copied-1;i>=0;i--) {
    char c = '?';    // Unknown                                
    MqlTick tick = tick_array[i];

    if(tick.last <= tick.bid){
        c = 'S';    // SELL
    }else if(tick.last >= tick.ask){
        c = 'B';    // BUY
    }

     // the variable c has information aggression: BUYER, SELLER or Unknown.

       
}

// --- END CODE


Excuse my English, I hope it helped.

Reason: