Last Trade - Buy or Sell?

 

Hi. Does anyone know if it's possible to determine if the last trade was a Buy or a Sell? I thought that comparing the Ask or Bid to the Close[0] was the answer but Close[0] always returns the Bid price.

 
omelette:
Hi. Does anyone know if it's possible to determine if the last trade was a Buy or a Sell? I thought that comparing the Ask or Bid to the Close[0] was the answer but Close[0] always returns the Bid price.

Why don't you check OrderType() which is working with opened and closed orders!

OP_BUY - buying position,

OP_SELL - selling position,

OP_BUYLIMIT - buy limit pending position,

OP_BUYSTOP - buy stop pending position,

OP_SELLLIMIT - sell limit pending position,

OP_SELLSTOP - sell stop pending position.

 
mqldev:
Why don't you check OrderType() which is working with opened and closed orders!...

OK, this was not a well though-out post

I was not referring to orders that I might have placed - the price data streamed from the broker is a result of someone either placing Buy or Sell orders. For instance, say price dropped 100 pips in 1 minute, it is reasonable to assume that this was the result of lots of Selling. What I was asking was is there any way to say definitively from the last tick received that, 'Yes, that was a Sell order'? What I failed to consider was that for every Buy order there must be a Sell order, and any imbalance will just result in price change - it's all clear to me now I was actually thinking that a Buy/Sell ratio might have made a good scalping tool. Back to the drawingboard........

Reason: