Find and FindAll

Created at 08 Dec 2021, 21:00
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!
sirinath's avatar

sirinath

Joined 25.11.2021

Find and FindAll
08 Dec 2021, 21:00


I want to find positions ignoring the labels, i.e., search by symbol only. How can I do that?

If I pass null as the lable, does this only search for orders which were created with a null lable or search for all orders regardless of label?


@sirinath
Replies

amusleh
09 Dec 2021, 09:25

Hi,

You have to use Linq:

var currentSymbolPositions = Positions.Where(position => position.SymbolName.Equals(SymbolName, System.StringComparison.OrdinalIgnoreCase));

 


@amusleh