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
What errors do you get before the 141 ?
Eror 141 is the first and only error I get. Just when I try to add the first stop loss.
Eror 141 is the first and only error I get. Just when I try to add the first stop loss.
Hi, I did the changes you told me:
1) I simplified the "if" statement.
2) I used GetLastError() only when OrderModify is not valid.
And still the same 141 error as soon as the stop loss is added.
I get it when I print the GetLastError result.
Let's do this easier. I just tried a new, very simple and stupid ea. Just to test purposes. I want to send a new operation every new bar. This is the code:
I get it when I print the GetLastError result.
Let's do this easier. I just tried a new, very simple and stupid ea. Just to test purposes. I want to send a new operation every new bar. This is the code:
Lanzar_Operacion is a function that simply sends an operation and works fine. Once I start this ea, the operation is created with no problems, but when it tries the modification, once again the error 141 shows.
Also, using Bars in they way you have is not a reliable method, you should use time instead. When the number of bars on the chart chart reaches "Max bars on chart" Bars stops incrementing.
I know that every time I change period, etc, the ea goes through deinit()/init() sequence. When I do that, I just remove the ea, and add it agin to initialize all correctly.
As I already mentioned in my last comment, this is just an ea to test the error 141. I'm not doing trailing stop in this ea. As you can see, this ea just sends an order (with no problems), and when that order is modified, it returns always an error 141. I'm just asking why always returns error 141 when the order is modified.
This is all the code:
I know that every time I change period, etc, the ea goes through deinit()/init() sequence. When I do that, I just remove the ea, and add it agin to initialize all correctly.
As I already mentioned in my last comment, this is just an ea to test the error 141. I'm not doing trailing stop in this ea. As you can see, this ea just sends an order (with no problems), and when that order is modified, it returns always an error 141. I'm just asking why always returns error 141 when the order is modified.