I'd hate to show the code, as the first version proved to be very survivable. It survived for 10 years without optimisation. Now I want to make it a bit more complex and profitable.
The code is very simple.
Still, orders may be opened on every tick because of an error in the logic.
No, the problem has not been solved. it is not in this unit.
Can you please explain the difference between my option and yours?
Then you are doing something wrong, work out your code.
Mine is better :)
...
This way you won't miss any order. In your version, if at that moment some position is closed or an order is deleted, you can skip any of the remaining ones.
So you're doing something wrong, deal with your code.
Mine is better :)
...
This way you won't miss any order. If your version shows that if at that moment some position is closed or an order is deleted, then you can skip some of the remaining ones.
I declared it as a global variable, but it gives me an error.
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.
I'd hate to show the code, as the first version proved to be very survivable. It survived for 10 years without optimisation. Now I want to make it a bit more complex and profitable.
The code is very simple.
Still, orders may be opened on every tick because of an error in the logic.
Check before you open a position to see if it is already open or not.
Before closing is like this.
Right?
It goes something like this.
It's better to make it into a function.
Before closing is like this.
It goes something like this.
No, the problem has not been solved. it is not in this unit.
Can you please explain the difference between my option and yours?
No, the problem has not been solved. it is not in this unit.
Can you please explain the difference between my option and yours?
Then you are doing something wrong, work out your code.
Mine is better :)
...
This way you won't miss any order. In your version, if at that moment some position is closed or an order is deleted, you can skip any of the remaining ones.
So you're doing something wrong, deal with your code.
Mine is better :)
...
This way you won't miss any order. If your version shows that if at that moment some position is closed or an order is deleted, then you can skip some of the remaining ones.
I declared it as a global variable, but it gives me an error.
int CountOrder;I declared it as a global variable, but it gives an error.
What I have written to you is a function.
Here's an example of how to use it.
What I have written to you is a function.
Here is an example of how to use it.