I am not at my computer at the moment. Compare previous MqlTick and current MqlTick then you will know the different. I will test it on Monday when the market is open. I am curious too.
angevoyageur: Compare the dates (DEAL_TIME) and keep the greater.
Thank you again! But don't you think is easier to use the MqlTick structure and code something like:
MqlTick latest_price;
if(latest_price.ask==latest_price.last)
Comment(StringFormat("It is a BUY"));
if(latest_price.bid==latest_price.last)
Comment(StringFormat("It is a SELL"));
Something like this.
Sorry as I said I am novice.
I read about struct MqlTick. There we can find all the information about last trade.
But something is not clear for me; how to code to find: "WAS LAST TRADE A BUY OR A SELL"
Well, hope to find a solution !
And one more specification: Is not about a trade in the past.
I want to use the code in an expert advisor, so I want to know in real time : "was the last trade a buy or a sell ?".
You have to check the deals and find the last one : see here for an example of processing the deals.
Sorry again. My question is about how to code in mql5 language the following question: "Last trade in market was a buy or a sell?"
Thank you for your suggestion.I read the example. But how can I find the last deal ?
Compare the dates (DEAL_TIME) and keep the greater.
Thank you again! But don't you think is easier to use the MqlTick structure and code something like:
Thank you again! But don't you think is easier to use the MqlTick structure and code something like:
If the last trade was made during the last tick . . . then yes. When was the last trade made ?
Perhaps there are some crossed wires in this thread . . . . Are you talking about all trades or just the trades you have placed ?