Order Execution event

Created at 20 Mar 2020, 06:48
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
AlgoTraderHu's avatar

AlgoTraderHu

Joined 19.03.2020

Order Execution event
20 Mar 2020, 06:48


Is there a way to get any type of account order execution data using cAlgo API? 

Example: Position reverse, using a market order

Existing Position: Long 2
New Position: Short 3

Obviously, a Sell 5 Market order was filled (executed by the server) that also can be broken into 2 steps: A. Close Long Position (Sell 2) and Open Short Position (Sell 3).

How can I get at least the Sell 5 market order data after the order gets executed?

cAlgo API: There are PENDING order events and POSITION events only. Market order fill (execution) events are missing. Position events do not contain any information about the initial order that was executed. 

However, I found this function in the Open API.

ProtoOAExecutionEvent

The event that is sent following the successful order acceptance or execution by the server. Acts as Response to the ProtoOANewOrderReq, ProtoOACancelOrderReq, ProtoOAAmendOrderReq, ProtoOAAmendPositionSLTPReq, and ProtoOAClosePositionReq requests. Also, the event is sent when a Deposit/Withdrawal took place.

 

Please help,


@AlgoTraderHu
Replies

PanagiotisCharalampous
20 Mar 2020, 08:27

Hi AlgoTraderHu,

There is no corresponding event in cAlgo API, only Position related events. So you will need to somehow calculate this information yourself.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

AlgoTraderHu
20 Mar 2020, 09:17

Bad news,

I suggest introducing Execution Events in the future. This is very important in you'd like to make cTrader compatible with real exchange trades instruments, like Futures, Stocks.

A very commonly used algo function in order to control execution/portfolio related risk, avoid overfills etc.

Thank you for your answer!


@AlgoTraderHu