Help to calculate current open position based on label and symbol

Created at 16 May 2017, 11:50
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!
FR

fredrik

Joined 02.05.2017

Help to calculate current open position based on label and symbol
16 May 2017, 11:50


Hi,

currently I have:

var openPositions = 5;

if (Positions.Count < openPositions)
{
 // code...
}

trying:

var symbolPositions = Positions.Find("Orion", Symbol);
var openPositions = 5;

if (sympolPositions < openPositions)
{
 // code...
}

and I also tried symbolPositions.Count

error:

Error CS0019: Operator '<' cannot be applied to operands of type 'cAlgo.API.Position' and 'int'

Please advice!


@fredrik
Replies

... Deleted by UFO ...