close price of a 15 days ago order

 

hi,

can any one tell that how can i find a close price of a 15 days ago order ??

thanks

 
if( OrderSelect( OrderTicket() ) { Print( OrderClosePrice() );}
Search the Document to find out more about those functions.
 
ubzen:
Search the Document to find out more about those functions.


this will return me close order price of OrderTicket  ... my problem is to find order that took place 15 days ago . we dont have any parameter in select order fn that return order of particular date . do we ??
 
tazz90:

hi,

can any one tell that how can i find a close price of a 15 days ago order ??

thanks

Hello tazz90,

You can code a combination of a while or for cycle and OrderSelect() within an EA to identify an order and its parameters. The while or for cycle should search inside an MT4 order history index using OrdersHistoryTotal() then OrderSelect() will select an order's position number (an order's position number in the MT4 order history's index) to retrieve an order's OrderClosePrice().

Thank you
 
tazz90: this will return me close order price of OrderTicket  ... my problem is to find order that took place 15 days ago . we dont have any parameter in select order fn that return order of particular date . do we ??  
for(int i=OrderHistoryTotal()-1; i>=0; i--)
if( !OrderSelect( i ) ){ return; }
if( OrderOpenTime()!=xTime ){ continue; }
if( OrderCloseTime()!=xTime){ continue; }
Print( OrderClosePrice() );
//Above Code Will Not Compile. Write Your Own.
Did you read the Book?
 
WhooDoo22:
Hello tazz90,

You can code a combination of a while or for cycle and OrderSelect() within an EA to identify an order and its parameters. The while or for cycle should search inside an MT4 order history index using OrdersHistoryTotal() then OrderSelect() will select an order's position number (an order's position number in the MT4 order history's index) to retrieve an order's OrderClosePrice().

Thank you


oh thank you so much for your help :)
 
tazz90:

oh thank you so much for your help :)

Glad to be of service and thanks to ubzen for his posts as well.

Thank you

 
ubzen:
Did you read the Book?

thank you :)
Reason: