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 as follows:
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?
You are mishandling the error code, forgetting that the error code is already overridden after your numerous functions.
So when an error occurs, you need to save the error code into a local variable and print it out from there, after the mass of your subsequent calls.
You're mishandling the error code, forgetting that the error code is already overridden after your numerous functions.
Therefore, when an error occurs, its code must be saved in a local variable, and only then, after the mass of your subsequent calls, print it out.
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 issue.
Besides, it is not very logical to create variables for errors in each method and then print these variables into Expert Advisors.
After all, if there is a variable to collect errors, why make new ones?
evillive, what do you mean there are no checks? I wrote above:
if (OrderOpenPrice() != ND (fd_MurreyLevelsValue[11])) \\ Если текущая цена не равна новой.. из массива, то.. New_OOP = ND (fd_MurreyLevelsValue[11]); \\.. новая цена равна этому новому значению цены из массива( расчитанного ). else New_OOP = OrderOpenPrice(); \\ Иначе новая цена равно текущей цене выбранного ордера. Т.е. не изменяется. if (OrderStopLoss() != ND (fd_MurreyLevelsValue[12])) New_SL = ND (fd_MurreyLevelsValue[12]); else New_SL = OrderStopLoss(); if (OrderTakeProfit() != ND (fd_MurreyLevelsValue[2])) New_TP = ND (fd_MurreyLevelsValue[2]); else New_TP = OrderTakeProfit();
I even gave a comment for the first one. Although everything is elementary there.
How else can you check here?
I realised, that's why I cleaned up)))
I do double check that it is not equal and directed where you expect!
Boris, what do you mean by that? Because I have it clearly written that if the price is not so... otherwise... current... What's the point? You can check it 20 times... :) It doesn't make sense. I've been struggling with this code for the second day now. I've never encountered such a bug before. Now I have faced it. I have already written and tested all these methods many times. I have faced a problem here.
The thing is, I'm more of a fan of slightly different tactics. But writing the latest Owls, came across this glitch. That's myself do not know where to dig, because pristrintovav all code lengthwise and otherwise I have no more thoughts. That's why the OrderModify() function is built-in. And I don't know its implementation.
evillive, what do you mean there are no checks? I wrote above:
I even gave a comment for the first one. Although everything is elementary there.
How else can you check here?
Victor, after checking, the new value is assigned or not... You have to check.
if (OrderOpenPrice() != ND (fd_MurreyLevelsValue[11]) // Если текущая цена не равна новой.. из массива || OrderStopLoss() != ND (fd_MurreyLevelsValue[12]) // или || OrderTakeProfit() != ND (fd_MurreyLevelsValue[2])) // или // если одно из условий выполнено пойдём в модифай...
Victor, after checking the new value is assigned or not... You have to check
Alexey, and where do you have a check to make sure that the value of the functions being passed is unchanged? I have already taken this into account above. And the need for modification in general is done at the start. There are levels there, if the indicator reports that the level has changed, let's move on...
Boris, what do you mean by that? Because I have it clearly written that if the price is not so... otherwise... current... What's the point? You can check it 20 times... :) It doesn't make sense. I've been struggling with this code for the second day now. I've never encountered such a bug before. Now I have faced it. I have already written and tested all these methods many times. I have faced a problem here.
The thing is, I'm more of a fan of slightly different tactics. But writing the latest Owls, came across this glitch. That's myself do not know where to dig, because pristrintovav all code lengthwise and otherwise I have no more thoughts. That's why the OrderModify() function is built-in. And I don't know its implementation...
evillive, what do you mean there are no checks? I wrote above:
if (OrderOpenPrice() != ND (fd_MurreyLevelsValue[11])) \\ Если текущая цена не равна новой.. из массива, то.. New_OOP = ND (fd_MurreyLevelsValue[11]); \\.. новая цена равна этому новому значению цены из массива( расчитанного ). else New_OOP = OrderOpenPrice(); \\ Иначе новая цена равно текущей цене выбранного ордера. Т.е. не изменяется. if (OrderStopLoss() != ND (fd_MurreyLevelsValue[12])) New_SL = ND (fd_MurreyLevelsValue[12]); else New_SL = OrderStopLoss(); if (OrderTakeProfit() != ND (fd_MurreyLevelsValue[2])) New_TP = ND (fd_MurreyLevelsValue[2]); else New_TP = OrderTakeProfit();
I even gave a comment for the first one. Although everything is elementary there.
How else can you check here?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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 as follows:
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?