Last trade on account

 

Hi,

How do I check in MQL5 when my last trade happened on my account?

Sorry if it is a bit of a cheapass question.


Thanx

 
Gary Niemand:

Hi,

How do I check in MQL5 when my last trade happened on my account?

Sorry if it is a bit of a cheapass question.


Thanx

By checking the deals history. Please show your attempt if you want coding help.

Orders, Positions and Deals in MetaTrader 5
Orders, Positions and Deals in MetaTrader 5
  • 2011.02.01
  • MetaQuotes Software Corp.
  • www.mql5.com
Creating a robust trading robot cannot be done without an understanding of the mechanisms of the MetaTrader 5 trading system. The client terminal receives the information about the positions, orders, and deals from the trading server. To handle this data properly using the MQL5, it's necessary to have a good understanding of the interaction between the MQL5-program and the client terminal.
 
Alain Verleyen:

By checking the deals history. Please show your attempt if you want coding help.

Thanx for the reply. I finally found that in the docs. Will they come back in time sequence?
 

I would be a bit nervous to show my code. I'm an old mainframe COBOL programmer, so my MQL5 coding skills might scare a few people! :)

 
Gary Niemand:
Thanx for the reply. I finally found that in the docs. Will they come back in time sequence?
I don't know, probably better to not rely on that, check the date.
Gary Niemand:

I would be a bit nervous to show my code. I'm an old mainframe COBOL programmer, so my MQL5 coding skills might scare a few people! :)

I doubt you can surprise me ;-)
Reason: