Find PendingOrder from label
Find PendingOrder from label
12 Apr 2021, 11:56
Hi all,
I know there is Find/FindAll methods on Positions to find Position based on the label / Symbol / TradeType, and I was expecting to see the same methods on the PendingOrders.
There is not, so I will have to use LinQ (no problems with that), but:
- Is there a reason why these methods are just on Positions and not PendingOrders ?
- Is there any difference between doing Positions.First(p => p.label == "test") and Positions.Find("test") or Positions.Where(p => p.label == "test") and Positions.FindAll("test") ?
Thanks for your answers,
Cheers,
Jerry
Replies
JerryTrader
13 Apr 2021, 11:30
RE:
amusleh said:
Hi,
You can use all Linq methods and there is no difference, if there is an API method I recommend you to use it instead of Linq, otherwise use Linq.
I prefer to use the API when available, but since it is not available on the PendingOrder, for the sake of consistency, I will use Linq.
Thanks for your answer.
@JerryTrader
amusleh
13 Apr 2021, 09:50
Hi,
You can use all Linq methods and there is no difference, if there is an API method I recommend you to use it instead of Linq, otherwise use Linq.
@amusleh