How to find Last closed order id,type?

 

How to find Last closed order id,type?

 
sheriffonline :

How to find Last closed order id,type?



closed order ==>> where do you have to search ??

and what trade has it to search where are you looking for

For Example try to find in code EA called moving average ....

 

i have to find last closed order type whether it is buy/sell and last order id?

eg: i have running many orders id as 1,2,3...

if suppose the id:2 is closed last, i have to get the value of last order id?

 
sheriffonline :

i have to find last closed order type whether it is buy/sell and last order id?

eg: i have running many orders id as 1,2,3...

if suppose the id:2 is closed last, i have to get the value of last order id?


Make it and show... you have an example now it is time to LEARN how to code

show your attempt doing it....

 
sheriffonline :

i have to find last closed order type whether it is buy/sell and last order id?

eg: i have running many orders id as 1,2,3...

if suppose the id:2 is closed last, i have to get the value of last order id?

Select the orders one by one, check their OrderCloseTime() to find the one that was last closed then get its OrderType() . . . done !
 

Thanks for your support RaptorUK & WHRoeder.

I found it with your help.

To find the last order type: OrderType()

To find the order id : OrderMagicNumber()

works fine.

Reason: