Download MetaTrader 5
To add comments, please log in or register
Interested in the Market activity? Come and track!
dejaw
33
dejaw 2015.05.04 19:41 

Please tell me how to select order opened with highest price

thanks

Keith Watford
Moderator
7869
Keith Watford 2015.05.04 21:16  

Open orders?

Closed orders?

Opening price

 

Have 2 variables, one to store the ticket number

The other to store the price, initialised at 0 

Loop through the relevant orders

Check if price is higher than the price variable and if it is, store the ticket number in the ticket variable 

dejaw
33
dejaw 2015.05.06 20:40  
GumRai:

Open orders?

Closed orders?

Opening price? 

 

Have 2 variables, one to store the ticket number

The other to store the price, initialised at 0 

Loop through the relevant orders

Check if price is higher than the price variable and if it is, store the ticket number in the ticket variable 


Thanks man I made it
Keith Watford
Moderator
7869
Keith Watford 2015.05.06 21:21  
GumRai:

Check if price is higher than the price variable and if it is, store the ticket number in the ticket variable 

 Glad that you got it sorted.

I should have said 

 Check if price is higher than the price variable and if it is, store the ticket number in the ticket variable and the price in the price variable

 so that each pass through the loop it will be checking against the highest so far 

/
To add comments, please log in or register