
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
... please :
Most half of both global and local variables are uninitialized - I'm sure they contain a lot of rubbish at some point.
You never check if an order is selected by OrderSelect(), we are not even talking about checking if it is open or closed at all.
I haven't noticed any quotes update before trading functions...
GetLastError is not reset before opening/closing, but it is checked - again, there will be cases of rubbish in the variable.
You don't check and normalise prices when closing
Do you want to continue?
Go ahead.
Very useful.
Here https://www.mql5.com/ru/forum/137651/page3 I posted my closing function
Replace GetInfo() with print, Fun_Error() = ErrorDescription()
You never check if an order is selected by OrderSelect(),
Honestly, I don't quite understand what to do if a value - false - is returned when an order is selected.
Does false mean that it is 100% absent among MODE_TRADES?
I have redrawn order opening codes according to your recommendations, frankly, I have not touched the Expert Advisor's configuration, so I am curious, let's see...
Will it sell out or will it take another profit?
To be honest, I don't quite understand what to do if false is returned when an order is selected.
Does false mean its 100% absence among MODE_TRADES?
it means 100% that nothing can be done with the order because it is not selected.
it means 100% that nothing can be done with it [the order] as it is not selected.
Right...
For example, see this function,
If the order is not selected, I should return -1. And if it is not selected for any other reason - for example, a failure of some kind, but the order is open, then what should I do?Right... Oh, man... But if it's not selected, it's an error of some kind, isn't it? Something has to be done...
It may not be selected:
1) because of bugs in the Expert Advisor's code;
2) it was closed due to circumstances beyond the EA's control (triggered SL/TP, closed manually, closed by the EA)
Right... Oh, man... but if it's not selected, there's an error, isn't there? Something has to be done...
Are you kidding me or are you serious?
Pause and select again. I have it organised that way, it works online:
Are you kidding me or are you serious?
Pause and select again. I have it organised this way, it works online:
I supplemented my post there.
How many times do I have to choose?
I supplemented my post there.
And how many times to choose?
BEFORE. Until it is selected in a loop:
It may not be selected:
1) because of a bug in the EA code;
this is quite clear
2) it was closed due to circumstances beyond the EA's control (the SL/TP was triggered, manually closed, closed by the EA)