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
It may happens there is never a deal, even when the order was accepted.
Here is the code I am using:
Result:
ResulDeal keeps always the value 0 even though the position has been received by the server.
So what is wrong in my code ?
Regards,
Dorian
So what is wrong in my code ?
What do you want?
What do you want?
As you can see on my example the ResultDeal is not a good indicator to check if my order has been executed since it always keeping the value 0. So which condition should I use to make sure transaction has been executed on the server side ?
Regards,
Dorian
I monitor in the OnTradeTransaction() event. This is similar to @fxsaber 's solution.
Thanks Anthony. The event handler "OnTradeTransaction()" is a good indicator to check if my transaction has been executed.
Here is the code I am using:
Result:
ResulDeal keeps always the value 0 even though the position has been received by the server.
Of course trade.ResultDeal() will never be updated.
You are mixing deal, order and position.
So what is wrong in my code ?
Of course trade.ResultDeal() will never be updated.
You are mixing deal, order and position.
Hi Alain,
Ok I understand that trade.ResultDeal will never be updated.
However does trade.ResultOrder will always contain an order number if no errors are found as showed in the example:
I am asking this question because I would like to use the variable lastTicketNumber to identified the execution of the transaction in the function OnTradeTransaction()
Regards,
Dorian
Hi Alain,
Ok I understand that trade.ResultDeal will never be updated.
However does trade.ResultOrder will always contain an order number if no errors are found as showed in the example:
I am asking this question because I would like to use the variable lastTicketNumber to identified the execution of the transaction in the function OnTradeTransaction()
Regards,
Dorian
Yes it should.
Please note that your way to filter "no errors" is incorrect. TRADE_RETCODE_DONE is not the only "no errors" answer.
It may happens there is never a deal.