How do I attach an event to a particular order to tract order or pending order to track status changes?

Created at 06 Dec 2021, 20:41
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!
sirinath's avatar

sirinath

Joined 25.11.2021

How do I attach an event to a particular order to tract order or pending order to track status changes?
06 Dec 2021, 20:41


How  do I attach an event to a particular order to tract order or pending order to track status changes?

I want to know if the order or pending order is partially filled, filled, cancelled, etc.


@sirinath
Replies

amusleh
07 Dec 2021, 09:15

Hi,

The events are for all orders, there is no specific event for a single order.

You have to assign a comment or label for your order and subscribe to PendingOrders or Positions events, you can then check if the event got triggered was related to the order that you wanted to track or not.


@amusleh

sirinath
07 Dec 2021, 15:50

RE:

amusleh said:

Hi,

The events are for all orders, there is no specific event for a single order.

You have to assign a comment or label for your order and subscribe to PendingOrders or Positions events, you can then check if the event got triggered was related to the order that you wanted to track or not.

Many thanks for the response. What are the order / trade related events in cTrader and how can I listen to them?


@sirinath

amusleh
07 Dec 2021, 16:11

RE: RE:

sirinath said:

amusleh said:

Hi,

The events are for all orders, there is no specific event for a single order.

You have to assign a comment or label for your order and subscribe to PendingOrders or Positions events, you can then check if the event got triggered was related to the order that you wanted to track or not.

Many thanks for the response. What are the order / trade related events in cTrader and how can I listen to them?

Please check the API references:

cAlgo API Reference - Positions Interface (ctrader.com)

cAlgo API Reference - PendingOrders Interface (ctrader.com)


@amusleh

sirinath
07 Dec 2021, 16:28 ( Updated at: 08 Dec 2021, 07:57 )

RE: RE: RE:

amusleh said:

sirinath said:

amusleh said:

Hi,

The events are for all orders, there is no specific event for a single order.

You have to assign a comment or label for your order and subscribe to PendingOrders or Positions events, you can then check if the event got triggered was related to the order that you wanted to track or not.

Many thanks for the response. What are the order / trade related events in cTrader and how can I listen to them?

Please check the API references:

cAlgo API Reference - Positions Interface (ctrader.com)

cAlgo API Reference - PendingOrders Interface (ctrader.com)

Many thanks for the quick response. Does the Fill mean complete fill or it is fired on each partial fill. Is there and event for partial fills?


@sirinath

amusleh
08 Dec 2021, 08:45

Hi,

The order filled event will be triggered if an order gets filled fully or partially, there is no event for partial fill and you can use the filled event to check if the order is filled partially or fully by subtracting the position volume from pending order volume.


@amusleh