Download MetaTrader 5
To add comments, please log in or register
Interested in MQL5 features? Find them in documentation!
Donald Gibson
488
Donald Gibson 2016.07.04 12:46  
honest_knave:

Does it do what you want? That's the most important thing; the rest is academic.

Just some thoughts from quickly skimming through it:

You can save a line of code by checking OrderOpenTime() before testing the OrderType(). 

 

An order cannot be more than one type. So use an 'if / else if' statement:

 

 

It depends on how you want to deal with commission and swap (can the first 'if' criteria be met while the second 'if' statement fails?), but this may be simpler:

 

Now this is making sense. 

Looks like I have work to do. The academic part of this is what I am interested in, just as a exercise. 

/ /123
To add comments, please log in or register