Looking to optimise this code

Created at 05 Feb 2019, 21:56
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!
TradeMingZhi's avatar

TradeMingZhi

Joined 05.02.2019

Looking to optimise this code
05 Feb 2019, 21:56


                foreach (var order in PendingOrders)
                {
                    if (order.TradeType == TradeType.Buy && order.Label == BotName && order.SymbolCode == Symbol.Code)
                    {
                        ModifyPendingOrder();
                    }
                }

 

I i think it would be much better if i could somehow ask for this criteria with the foreach command. because it will do the if on many orders otherwise, although FindAll command does not work with it.


@TradeMingZhi
Replies

PanagiotisCharalampous
06 Feb 2019, 09:25

Hi wisegprs,

I am not sure what the question is. The code seems fine to me.

Best Regards,

Panagiotis


@PanagiotisCharalampous

TradeMingZhi
06 Feb 2019, 11:45

RE:

Panagiotis Charalampous said:

Hi wisegprs,

I am not sure what the question is. The code seems fine to me.

Best Regards,

Panagiotis

Yeah i realised shortly after, no option to delete thread though

You can delete it, thanks!


@TradeMingZhi