Count Pending Order by Label an Direction
Count Pending Order by Label an Direction
24 Apr 2019, 00:13
Hi,
Im trying count pending orders by label and direction but i cant. Example for Stop order with Long direction
_LongPendingPositionsCount = PendingOrders.Where(posPendingLongCount => posPendingLongCount.Label == LabelBuy).Where(posPendingLongCount => posPendingLongCount.OrderType == PendingOrderType.Stop && posPendingLongCount.TradeType == TradeType.Buy).Count();
Please Help me.
Thank you
Replies
DelFonseca
24 Apr 2019, 20:17
Hi Panagiotis,
Im trying to count how many buy stop pending orders i have.
I have 6 pending orders, with order type "Buy Stop"and the code below returns 1, not 6.
_LongPendingOrdersCount = PendingOrders.Where(posPendingLongCount => posPendingLongCount.Label == LabelBuy).Where(posPendingLongCount => posPendingLongCount.OrderType == PendingOrderType.Stop && posPendingLongCount.TradeType == TradeType.Buy).Count();
Can you help me please ?
Thank you so much
@DelFonseca
PanagiotisCharalampous
25 Apr 2019, 09:34
Hi DelTrader,
I do not see anything wrong in this code. Can you share the complete cBot code? Make sure you are setting the labels correctly.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Apr 2019, 10:16
Hi DelTrader,
Can you please explain to us what is the problem?
Best Regards,
Panagiotis
@PanagiotisCharalampous