> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# Count

## Definition

The total number of bars or data points.

## Property Value

An **int** value representing the total number of bars.

## Syntax

`Count`

## Examples

```csharp
//If there are less than 365 bars on the chart, text indicates how many bars are on the chart
if (Count < 365)
{
  Draw.TextFixed(this, "tag1", "There are " + Count + " bars on the chart", TextPosition.BottomRight);
}
```

[CurrentBar](/developer/desktop-sdk/references/common/onbarupdate/currentbar) value is guaranteed to be \<= Count - 1. This is because of the NinjaTrader multi-threaded architecture, the Count value can have additional bars as inflight ticks come in to the system.