NinjaScript > Language Reference > Strategy > TradeCollection >
Count
Definition Returns the number of trades in the collection.
Property Value
An int value that represents the number of trades in the collection.
Syntax <TradeCollection>.Count
Examples
protected override void OnBarUpdate() { // Print out the number of long trades
Print("The strategy has taken " + Performance.LongTrades.Count + " long trades."); }