Download MetaTrader 5
To add comments, please log in or register
Take active part in the life of the community. Improve your rating!
tafadzwa
117
tafadzwa 2013.12.21 10:13 
// If the price is greater than OrderOpenPrice() and it comes back to OrderOpenPrice() then OrderClose().


// Advise, SampleCode is appreciated. 
Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2013.12.21 10:48  
tafadzwa:

Check the OrderClosePrice() vs OrderOpenPrice() if it is greater set a bool PriceExceededOpen to true

If PriceExceededOpen is true and OrderClosePrice() is very close to OrderOpenPrice() the OrderClose() . . . bear in mind the issues wiith comparing doubles . . . if you have more than one open Order you will need more than one bool

/
To add comments, please log in or register