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.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.