Close pending orders

Created at 22 Jun 2020, 15:24
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!
thuyetdz's avatar

thuyetdz

Joined 18.06.2020

Close pending orders
22 Jun 2020, 15:24


Hello friends.
I place a pending order at the beginning of the candle, if when passing a new candle that the orders have not been executed, then close all pending orders.
Can someone help with how to close pending orders when going through the new candle.
Thanks very much.


@thuyetdz
Replies

PanagiotisCharalampous
22 Jun 2020, 15:30

Hi thuyetdz,

See below

        protected override void OnBar()
        {
            foreach (var order in PendingOrders)
            {
                order.Cancel();
            }
        }

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

thuyetdz
22 Jun 2020, 15:39

RE:

PanagiotisCharalampous said:

Hi thuyetdz,

See below

        protected override void OnBar()
        {
            foreach (var order in PendingOrders)
            {
                order.Cancel();
            }
        }

Best Regards,

Panagiotis 

Join us on Telegram

 

Thank you so much for the quick reply.


@thuyetdz