Is this Return Code: 10008 (TRADE_RETCODE_PLACED) Error or not? I understand 10008 shows that my order has been placed. I am not 100% sure if it is error or not? Please confirm with me. Thank you.
I found this on the forum, maybe it's enough to clarify your doubts
"10008 - TRADE_RETCODE_PLACED" vs "10009 - TRADE_RETCODE_DONE"
phi.nuts, 2013.01.16 19:30
10008 is for OrderSendAsync.
This is language problem. For example, a boss tell his employee to do something and his employee reply "considered done", when the employee finish with what his boss was asked him to do, he tell his boss, "It's done, Sir"
In this case, "10009 - TRADE_RETCODE_DONE" means successful, that your request is completely done . There's also 10010 - TRADE_RECODE_DONE_PARTIAL, for example only half of the lot is opened, usually for IOC (Immediate Or Cancel) type of order (IOC- Investopedia)
You only have to read the documentation :
if the request is sent to a trade server. In case the request is not
sent, it returns false. In case the request is sent, in the result variable the response code contains TRADE_RETCODE_PLACED
value (code 10008) "order placed". Successful execution means only
the fact of sending, but does not give any guarantee that the request
has reached the trade server and has been accepted for processing. When
processing the received request, a trade server sends a reply to a
client terminal notifying of change in the current state of positions,
orders and deals, which leads to the generation of the Trade event.
Unfortunately, if we follow the documentation, that doesn't mean a correctly placed order, but a correctly sent order. The name of the code seems poorly chosen. It would have been better to use TRADE_RETCODE_SENDED.