Download MetaTrader 5

Question for the Guru's - page 3

To add comments, please log in or register
Donald Gibson
Donald Gibson  

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. 

To add comments, please log in or register