Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Forum on trading, automated trading systems and testing trading strategies
PositionsTotal() return 0 after a call of function trade.PositionOpen()
fxsaber, 2018.08.09 19:44
You must wait until Result.deal != 0
There are many pitfalls in the platform. This one is the simplest. So I do not use a standard library and I use my own (MQL4-style).
Forum on trading, automated trading systems and testing trading strategies
PositionsTotal() return 0 after a call of function trade.PositionOpen()
fxsaber, 2018.08.09 19:51
Try this Demo for Result.deal == 0 - ForexTimeFXTM-Demo01 (or FXOpen-MT5).
Which function should I use to check if an order (not pending) is excuted on the server side ?
I monitor in the OnTradeTransaction() event. This is similar to @fxsaber 's solution.
I monitor in the OnTradeTransaction() event.
Try this script there ForexTimeFXTM-Demo01 (or FXOpen-MT5)
Sometimes two new positions will open, not one.
You must wait until Result.deal != 0
There are many pitfalls in the platform. This one is the simplest. So I do not use a standard library and I use my own (MQL4-style).
It may happens there is never a deal.
It's not about reject.
It's not about reject.
It may happens there is never a deal, even when the order was accepted.
Forum on trading, automated trading systems and testing trading strategies
How to check that an order is executed after calling PositionOpen
fxsaber, 2018.08.09 20:35
Try this script there ForexTimeFXTM-Demo01 (or FXOpen-MT5)
Sometimes two new positions will open, not one.
I know that since 2014.
Forum on trading, automated trading systems and testing trading strategies
PositionsTotal() return 0 after a call of function trade.PositionOpen()
fxsaber, 2018.08.09 19:44
You must wait until Result.deal != 0
There are many pitfalls in the platform. This one is the simplest. So I do not use a standard library and I use my own (MQL4-style).
isn't a return code of 10009 a sufficient indication of a successful operation on server side ?
The problem is the synchronization between Server side and Client (Terminal) side.
It's not true!
Result