tenlau:
If it was a Buy it was from Ask, if it was a Sell it was from Bid, vis versa when closing the trades . . . . . a Sell is closed with a Buy at Ask.
Hello,
It is a very novice question, but for me is very hard. I want to find from where was last trade made; from BID price or from ASK price.
Thank you in advance for your reply !
RaptorUK:
If it was a Buy it was from Ask, if it was a Sell it was from Bid, vis versa when closing the trades . . . . . a Sell is closed with a Buy at Ask.
Sorry maybe my question was not so clear. I want to check in mql5 language if last trade was made from bid (or ask). How can I do it? In other words find if last trade was done at bid price or ask price. Hope now is clear!
If it was a Buy it was from Ask, if it was a Sell it was from Bid, vis versa when closing the trades . . . . . a Sell is closed with a Buy at Ask.
tenlau:
Sorry maybe my question was not so clear. I want to check in mql5 language if last trade was made from bid (or ask). How can I do it? In other words find if last trade was done at bid price or ask price. Hope now is clear!
You mean if it is a sell or a buy ?
Sorry maybe my question was not so clear. I want to check in mql5 language if last trade was made from bid (or ask). How can I do it? In other words find if last trade was done at bid price or ask price. Hope now is clear!
tenlau:
Sorry maybe my question was not so clear. I want to check in mql5 language if last trade was made from bid (or ask). How can I do it? In other words find if last trade was done at bid price or ask price. Hope now is clear!
Select it and check it's ORDER_TYPE using OrderGetInteger()
Sorry maybe my question was not so clear. I want to check in mql5 language if last trade was made from bid (or ask). How can I do it? In other words find if last trade was done at bid price or ask price. Hope now is clear!
angevoyageur:
You mean if it is a sell or a buy ?
Yes, I want to know if last trade was sell or buy. How to code it in mql5 ?
You mean if it is a sell or a buy ?
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?"
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 ?".
tenlau:
Sorry maybe my question was not so clear. I want to check in mql5 language if last trade was made from bid (or ask). How can I do it? In other words find if last trade was done at bid price or ask price. Hope now is clear!
Person A sold x to Person B. Person B bought x from Person A. This is last traded price where Ask and Bid are equal (meet). The last price will move back and forth between the bid and ask prices.
Sorry maybe my question was not so clear. I want to check in mql5 language if last trade was made from bid (or ask). How can I do it? In other words find if last trade was done at bid price or ask price. Hope now is clear!
tenlau:
double Last() - See https://www.mql5.com/en/docs/standardlibrary/tradeclasses/csymbolinfo/csymbolinfolast
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 ?".

Documentation on MQL5: Standard Library / Trade Classes / CSymbolInfo / Last
- www.mql5.com
Standard Library / Trade Classes / CSymbolInfo / Last - Documentation on MQL5
ROMAN5:
double Last() - See https://www.mql5.com/en/docs/standardlibrary/tradeclasses/csymbolinfo/csymbolinfolast
double last() return the last price as a value, but did not tell nothing about it was a sell or a buy....
double Last() - See https://www.mql5.com/en/docs/standardlibrary/tradeclasses/csymbolinfo/csymbolinfolast

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
It is a very novice question, but for me is very hard. I want to find from where was last trade made; from BID price or from ASK price.
Thank you in advance for your reply !