Is it possible to count long and short positions separately in cAlgo?!?
Created at 28 Oct 2014, 19:02
Is it possible to count long and short positions separately in cAlgo?!?
28 Oct 2014, 19:02
If I want to count all positions I can use this:
}
if (Positions.Count < 5)
{
Is there any way I can count long and short positions separately?
Thank you in advance...
Replies
.ics
13 Mar 2015, 03:01
RE:
Spotware said:
You can use the following code snippet:
var shortPositionsCount = Positions.Count(p => p.TradeType == TradeType.Sell); var longPositionsCount = Positions.Count(p => p.TradeType == TradeType.Buy);
Hi spotware,
Could you please explain what this is below? Is this some kind of filter or query? It seems very interesting...
p => p.TradeType == TradeType.Sell
Thanks in advance.
@.ics
Spotware
29 Oct 2014, 09:34
You can use the following code snippet:
@Spotware