Is success or fail when Ctrade ResultRetcode return TRADE_RETCODE_PLACED

 
Ctrade ResultRetcode return TRADE_RETCODE_PLACED, but ResultOrder is 0, why?
 
Hardy5012 :
Ctrade ResultRetcode return TRADE_RETCODE_PLACED, but ResultOrder is 0, why?

It means that the trade server has checked and placed a trade order and this order went further - to the exchange.

Reference: Basic Principles

Scheme of trade operations: from order creation to execution by broker

Basic Principles - Trading Operations - MetaTrader 5 Help
Basic Principles - Trading Operations - MetaTrader 5 Help
  • www.metatrader5.com
is an instruction given to a broker to buy or sell a financial instrument. There are two main types of orders: Market and Pending. In addition, there are special Take Profit and Stop Loss levels. is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the...
 
Vladimir Karputov:

It means that the trade server has checked and placed a trade order and this order went further - to the exchange.

Reference: Basic Principles


Thanks for you answer. Buy I have an other  issue, in that case the  ResultOrder return zero, how can I get  relation with MqlTradeTransaction

 
Hardy5012 :

Thanks for you answer. Buy I have an other  issue, in that case the   ResultOrder return zero, how can I get   relation with  MqlTradeTransaction

How I do it: I issue a trade order (' OpenBuy ') and do minimal checks. If all is well, I am waiting for confirmation in OnTRadeTransaction.

This pattern can be seen in my recent advisors.

 
Vladimir Karputov:

How I do it: I issue a trade order (' OpenBuy ') and do minimal checks. If all is well, I am waiting for confirmation in OnTRadeTransaction.

This pattern can be seen in my recent advisors.

However ,I want from  OnTRadeTransaction find the corresponding relationship of the previous OpenBuy . Originally, I used tick ,buy in this case tick is zeor

Documentation on MQL5: Language Basics / Functions / Event Handling Functions
Documentation on MQL5: Language Basics / Functions / Event Handling Functions
  • www.mql5.com
The MQL5 language provides processing of some predefined events. Functions for handling these events must be defined in a MQL5 program; function name, return type, composition of parameters (if there are any) and their types must strictly conform to the description of the event handler function. The event handler of the client terminal...
 
Hardy5012 :

However  ,I want from  OnTRadeTransaction  find the corresponding relationship of the previous OpenBuy  .  Originally, I used tick ,buy in this case tick is zeor

I showed you the solution. But your desires are not clear to me - you do not know what you want (or you do not know how to explain your thoughts). Please describe in detail what you are doing and what you want to receive.

Reason: