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
Hello, I'm trying to figure out what the cause of the error "Invalid Stops" is inside my EA.
I have been reading this forum and googling around for days but have not found the solution yet, hence I'm creating a topic here.
So, In my EA I'm getting this error when opening an order and modifying an order, probably only once per 50 times.
I will show you the code and the printed results from the code:
As you can see, all the printed values seem fine, so.... I'm clueless.
Beside what the documentation says as posted by Keith, an invalid Stops error (130) can also be an open price error. So in a fast market, as your pending open price is only 5 points of the market (Bid), it may happens the market has moved between the time you send the order and the server receive it. You can try to print the updated Bid/Ask to check it (you need to use RefreshRates() after OrderSend() for that).
What broker/account type is it ?
Beside what the documentation says as posted by Keith, an invalid Stops error (130) can also be an open price error. So in a fast market, as your pending open price is only 5 points of the market (Bid), it may happens the market has moved between the time you send the order and the server receive it. You can try to print the updated Bid/Ask to check it (you need to use RefreshRates() after OrderSend() for that).
What broker/account type is it ?
And here is the printed result when it got an Invalid Stops error:
As you can see there is a difference of 12 points in both the Bid and Ask price...
So apparently the actual Bid price was already lower than the OpenPrice of my SellStop, which makes it an invalid OpenPrice obviously.
I'm testing all this on a IC Markets Raw Spread Demo account, I believe it's ECN?
And I'm having a connection with about 90ms latency.
What do you think that would potentially fix (or lessen) this error? I'd guess a faster connection?
Good idea, I just tested it with this code:
And here is the printed result when it got an Invalid Stops error:
As you can see there is a difference of 12 points in both the Bid and Ask price...
So apparently the actual Bid price was already lower than the OpenPrice of my SellStop, which makes it an invalid OpenPrice obviously.
I'm testing all this on a IC Markets Raw Spread Demo account, I believe it's ECN?
And I'm having a connection with about 90ms latency.
What do you think that would potentially fix (or lessen) this error? I'd guess a faster connection?
Yes you could try the Metaquotes VPS service, it gives very low latency ( you can see it in your Journal log):
2019.10.23 17:47:20.990 Trades: use hosting service to speed up the execution - 1.27 ms via 'MQL5 London 10 (MQL5.community)' instead of 105.53 ms