Download MetaTrader 5

How to select order with highest price?

To add comments, please log in or register
dejaw
29
dejaw  

Please tell me how to select order opened with highest price

thanks

Keith Watford
Moderator
10652
Keith Watford  

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
29
dejaw  
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
10652
Keith Watford  
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