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
Victor, you, Renat, in general rightly pointed out, Alexey showed the necessary last check, and earlier check all the necessary checks for each parameter with all the nuances to avoid ambiguity of meaning and without missing any condition!
What's the use of it? Because I reset _LastError in every function. It's not like it's constantly hanging in memory...
still need to check that if none of the 3 parameters has changed, then OrderModify doesn't need to be touched either.
I hear you. It didn't help. Here's a piece of code from my modification method:
We can clearly see that the error value is reset.Then it gets the market info. If the modification is in the tester... then... I do the test proposed by Alexei, and... if the modification is unsuccessful, then... write a log and prints in the log...
In general, we can see that there are no errors between ResetLastError()... There's nothing to be wrong there.
Log:
I hear you. It didn't help. Here's a piece of code from my modification method:
You can clearly see that the error value is being reset.Then it gets the market info. If the modification is in the tester... then... ...then I run the test proposed by Alexei, and... if the modification is unsuccessful... write a log and prints in the log...
In general, we can see that there are no errors between ResetLastError()... There's nothing to be wrong there.
Log:
That's how it is...
In the Expert Advisor, I call the class method like this:
Here's the piece of the class we're interested in:
Here's the log piece we want:
Let me explain. The modification takes place in method fOrderModify(). At the input of this method fOrderModify(), the current values of the order parameters and the new planned values are printed at the beginning of the body. You can see it:
This piece is in the log:
You can see that the parameters are all different. There should be no problems.That's how it is...
In the Expert Advisor, I call the class method like this:
Here's the piece of the class we're interested in:
Here's the log piece we want:
I don't understand what the Bid has to do with the Bid, if the order is pending?
The Bid is always lower than SellLimit, so the line if(New_OOP < Bid) will never be true... ...respectively, the modification is implemented without hindrance.
Why don't you create an error array as well? It is written in black and white in the documentation that the _LastError variable stores the number of the last error. And it is reset by ResetLastError() function. If there are no more errors between calls of _LastError, _LastError stores the value of the last error. There were no more errors in my code. Well, that's not the question.
You are absolutely wrong. The last error is well reset in many important functions. It works so in WinAPI too.
That is why you should save the error code into a local variable right after it occurs and not try to use it after clearing this system variable ten times in a lot of your intermediate functions.
Sorry, SellLimit requires dist:
not if (New_OOP < Bid) continue; butif (New_OOP-dist*Point < Bid) continue;
How do I get rid of this fucking error? I'm sick of it. I'm checking every input parameter of the function. For me, at the moment, it's like this:
That is, if the parameter hasn't been changed, there's no need to change it. I haven't done that before, but I decided to...
Then the parameters are passed to the order modification method like this:
Nw output in the log:
So, the journal notifies us, like modification: OK, but then... an error. None of the parameters has changed.
The order is pending. So we may change open, stop and take price. And this, as I understand it, did not contradict the documentation.
Who has encountered something like this? How to solve it?