Converting Stop Limit order to a limit order

Created at 31 Mar 2023, 02:39
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!
LE

leonwij

Joined 09.01.2023

Converting Stop Limit order to a limit order
31 Mar 2023, 02:39


Hello,

I have just noticed that stop limit orders get cancelled if the condition for "stoplimitorderpips" is not met.  Is there a sample code to convert a stop limit order to a limit order at the same price - if a cancellation occurs due to this reason?

If the "stoplimitorderpips" is the same, or slightly more than the fixed bid ask spread - shouldn't the order always get filled and//or act the same as a stop order?  

Thanks, Leon.


@leonwij
Replies

leonwij
14 Apr 2023, 03:57

Anyone?


@leonwij

PanagiotisChar
15 Apr 2023, 12:12

Hi there,

You cannot convert a type of order to another one. You need to cancel the existing order and create a new one. But what you describe is pointless. If a stop limit order is not filled, a limit order will not be filled either. If you want your order to be filled no matter what, what is the point of using a stop limit or limit order? Just use a market order.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 


@PanagiotisChar

leonwij
15 Apr 2023, 13:05

Hi,

I guess what I mean is, for a buy:

- if my Entry Price > Symbol.Ask , then I can't use a limit order, so I have to use a stop limit order.  But sometimes this order will get cancelled if it doesn't fill when the ask rises above the stop limit order.  I understand that I can increase the stop-limit-range-pips value to avoid this.  However, if the order does get cancelled (when the ask goes above the entry price), is there a way to recognise the cancellation reason, and set a new limit order at the entry price?

Obviously this will only fill if the market fluctuates back down to the limit order/entry price. 

The reason I ask is that the spread is fixed on the product I am trading, but I have even had cancellations when the stop-limit-range-pips value is 0.6 for a spread of 0.4.

Thanks Leon

 


@leonwij

PanagiotisChar
18 Apr 2023, 09:28

Hi,

You can listen to the PendingOrders.Cancelled event and act accordingly

        PendingOrders.Cancelled += PendingOrders_Cancelled;        
        
        private void PendingOrders_Cancelled(PendingOrderCancelledEventArgs obj)
        {
            if(obj.Reason == PendingOrderCancellationReason.Cancelled)
            {
                //Do something
            }
        }

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us


@PanagiotisChar