OrderModify error 130
-
hello @miro1360 , please, can you help me?

I can not resolve this error, I guess it depends from the trailing stop. If we handle the trailing stop/start, more and more times gives the error, sometimes gives no error, is there any formula to fix this issue?
thanks in advance
https://fxdreema.com/shared/ULeQD7jse -
I added various checks here and there, so the EA would attempt to automatically move SL or TP to the nearest possible levels before the request is sent to the server. But while the request is sending, the price moves and suddenly the SL or TP level that is sent looks invalid. This is what I think the problem is. I guess that the problem happens only sometimes, and other times everything is fine.
-
I think this error is caused when broker reject your request for modify order, you can not do much for this issue (it depends on broker) ... why broker is doing this ... because, most brokers are using some automated antiscalping plugins which are controlling traders behaviour - I mean, if trader is not very agressive (scalping trading) ... into scalping can be achivied also agressive trailing-stop and moving stops by 1 pip and stops too close from open/close price ... if you want avoid this issue, you have only few options:
- find super scalping broker (I dont know if any exist, when you trade greater volume, no one want see you scalping
), or - change trailing stop limits (like fewer agressive) ...
- find super scalping broker (I dont know if any exist, when you trade greater volume, no one want see you scalping
-
@fxdreema the problem is that: if I set trailing stop=1, and trailing start=3, the tester crashes, maybe you have to calculate the stop level of the broker?
-
@miro1360 you are right but the product that I am developing is subjected to the check of the mql5 community, and I have to find the solution to avoid the error
-
it calculates the stop level of the broker... just before sending the request. But the actual prices could change while the request travels to the broker, so when the request finally arrives there (let's say 200 ms later), the requested SL is already invalid.
Unfortunately in the request we specify SL and TP as absolute values, not as relative. We send values such as 1.2345, not for example 0.0010 (for 10 pips relative to the current Ask/Bid price that is on the broker). So, because of that the EA can say one price, but until this price goes to the broker, the price is already different.
-
Hi @fxdreema, I saw that the curious thing is that this does not happen with orders Buy now
https://fxdreema.com/shared/qz047fJae -
-
this worth a try

-
@miro1360, how could I try these on fxdreema, I am not a programmer mql, any suggestion?
-
it is little complicated

-
@miro1360 it may be useful the "Custom MQL4 code" block?
-
yes, but you need create here whole trailing ... or combination of normal blocks + custom code block (with code for modifying stops into both directions - because SL have possibility goes into "possitive" when it is as trailing ... ) ...
-
@miro1360 .....ok, I'll think about it, thank you
-
But I have checks like these in the code above, even more, so if the SL level is less than the required, it is automatically changed to the minimum that is required
But I think the problem happens because until the request travels to the server, sometimes all the numbers become different (and wrong) -
and take into account also reasons from brokers antiscalp plugin (which is also activated for agressive trailing stops)
... this plugin just reject your request and send info into log that your request was not accpeted for many reasons
... and here is nothing you can do with this (only avoid agressive trailing or scalping or another broker
) ... ...

