- The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
- Don't worry about it unless you're scalping M1 or trading news.
- Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
In addition: there is no need to create pending orders in code.
- The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
- Don't worry about it unless you're scalping M1 or trading news.
- Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
My EA is a night scalp and must use a sheet to reduce the effect of the slip point. But I don't understand why a withdrawal would be an invalid stops.
I want to solve this problem, not necessarily need someone else to fix the code, I want to know the cause of the error, so I can fix it myself.
- 2022.01.17
- www.mql5.com
thx,but this is not the same with my problem, and I did not report any error in the backtest, it was the error message given by the verification when EA uploading MQL5.
That is because the validation test runs your EA against different broker conditions, and your code is most probably not doing the necessary checks.
That is way it reports that it cannot cancel an order due to invalid stops because you are not checking for Freeze Levels, Stop Levels, etc.
thx,but this is not the same with my problem, and I did not report any error in the backtest, it was the error message given by the verification when EA uploading MQL5.
I can't be sure but I think that I have seen this problem before.
It happened when the EA tries to delete a pending order when the trigger price is too close to the current market price.
Yes, that is called the "Freeze Level"!
... a freeze level is the minimum distance, measured from the current spot price (Bid/Ask), to be attained to trigger a temporary ban on modifying, deleting, or closing the orders, which are near to execution. Thus, a pending order, which is away from the current market price at a distance equal to or within the freeze level, cannot be modified, deleted, or prematurely closed.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
test on EURUSD,H1 (netting) 2019.04.09 01:00:00 failed cancel order #21 buy limit 0.2 EURUSD at 1.12594 sl: 1.11994 tp: 1.12626 [Invalid stops] 2019.04.09 01:00:01 failed cancel order #21 buy limit 0.2 EURUSD at 1.12594 sl: 1.11994 tp: 1.12626 [Invalid stops] 2019.04.09 01:00:02 failed cancel order #21 buy limit 0.2 EURUSD at 1.12594 sl: 1.11994 tp: 1.12626 [Invalid stops] 2019.04.09 01:00:04 failed cancel order #21 buy limit 0.2 EURUSD at 1.12594 sl: 1.11994 tp: 1.12626 [Invalid stops] 2019.04.09 01:00:05 failed cancel order #21 buy limit 0.2 EURUSD at 1.12594 sl: 1.11994 tp: 1.12626 [Invalid stops]
This error is reported when I upload EA of MT5 to MQL5. It does not appear when running normally.
And I don't understand, what does cancellation have to do with void stop loss?
Is there someone big enough to fix it?