Query regarding order Types.

Created at 05 Mar 2025, 06:10
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!
SI

siddasaiganesh

Joined 14.08.2024

Query regarding order Types.
05 Mar 2025, 06:10


Hi ,
I'm running a script to place limit order with relative stopLoss and takeProfit.
I don't know why the order Type has been changing when ordered (Some times to Market order and Sometime to Stop Limit Order ) which is not as expected (If market order is placed StopLoss won't be applied to that) .What we need to do to fix this? (Is this the issue with API or the behaviour of the orders?).
is the orderId remains same at all points? 
why sometimes i'm getting an Executionevent with orderId 0 and sometimes positionId 0 ?

 


@siddasaiganesh
Replies

monica46cole
06 Mar 2025, 11:24 ( Updated at: 10 Mar 2025, 09:13 )

Hello,
Sometimes, limit orders can convert to market orders when triggered, depending on the API or platform you're using. To fix this, ensure that you explicitly specify the order types in your script and check the API documentation for any nuances related to order execution.

Regarding the orderId, it should remain the same throughout the order's lifecycle. However, discrepancies like receiving an Executionevent with orderId 0 or positionId 0 might indicate issues with how the API handles execution events or how your script processes these events. Proper logging and handling of these events can help resolve these discrepancies.


@monica46cole

siddasaiganesh
11 Mar 2025, 10:24

RE: Query regarding order Types.

monica46cole said: 

Hello,
Sometimes, limit orders can convert to market orders when triggered, depending on the API or platform you're using. To fix this, ensure that you explicitly specify the order types in your script and check the API documentation for any nuances related to order execution.

Regarding the orderId, it should remain the same throughout the order's lifecycle. However, discrepancies like receiving an Executionevent with orderId 0 or positionId 0 might indicate issues with how the API handles execution events or how your script processes these events. Proper logging and handling of these events can help resolve these discrepancies.

Hi , Thanks for info.  I have been seeing that order request sent is limit order always, when order gets accepted they are getting converted as different order sometimes why ? Is that the issue with ctrader open api ?


@siddasaiganesh

siddasaiganesh
11 Mar 2025, 10:24

RE: Query regarding order Types.

monica46cole said: 

Hello,
Sometimes, limit orders can convert to market orders when triggered, depending on the API or platform you're using. To fix this, ensure that you explicitly specify the order types in your script and check the API documentation for any nuances related to order execution.

Regarding the orderId, it should remain the same throughout the order's lifecycle. However, discrepancies like receiving an Executionevent with orderId 0 or positionId 0 might indicate issues with how the API handles execution events or how your script processes these events. Proper logging and handling of these events can help resolve these discrepancies.

Hi , Thanks for info.  I have been seeing that order request sent is limit order always, when order gets accepted they are getting converted as different order sometimes why ? Is that the issue with ctrader open api ?


@siddasaiganesh