NinjaScript > Language Reference > Data > Bars >


Print this Topic Previous pageReturn to chapter overviewNext page


The total number of ticks of the current bar.


Property Value

A int value that represents the total number of ticks of the current bar.






// Prints the tick count to the output window
Print("The tick count of the current bar is " + Bars.TickCount.ToString());

Additional Access Information
This property can be accessed without a null reference check in the OnBarUpdate() event handler. When the OnBarUpdate() event is triggered, there will always be a Bar object which holds the TickCount property. Should you wish to access this property elsewhere, check for null reference first. e.g. if (Bars != null)