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
You are obviously right.
What I was saying is to retry OrderSend with the latest prices. Also maybe include IsTradeContextBusy() maybe..it also help to speedup filling requested order.
Because, as he is saying, he is only getting this error sometimes, not every time.
What does isTradeContextBusy() do ?, and can error 138 occur when I try to send multiple orders from different pairs at the same time ?
Retrying the OrderSend() with the same parameters is a waste of time and effort for a Requote. Obviously if it is a requote, then the market prices have changed and drifted too far away from the maximum deviation specified by the user. The parameters for the order are no longer valid and have to be recalculated and the conditions reevaluated to see if they still make sense according to the strategy rules or not, and only then resubmit the order under the new parameters and conditions.
Is my maximum standard deviation my slippage value ?, if so
This is my code for slippage, could this be the reason I get order send error 138 ?
What does isTradeContextBusy() do ?, and can error 138 occur when I try to send multiple orders from different pairs at the same time ?
yes it might...as if it is busy it will delay to fill your order with the prices already set ... and with slippage... eliminate it and test...just to see if without slippage you still have that error... try it also with a different broker
yes it might...as if it is busy it will delay to fill your order with the prices already set ... and with slippage... eliminate it and test...just to see if without slippage you still have that error... try it also with a different broker
Hi, thanks for the response, so I should make slippage = 0 ?
Hi, thanks for the response, so I should make slippage = 0 ?