> 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.

# BarsAgo

## Definition

Gets the number of bars back (x-axis coordinate) the chart anchor is drawn by a NinjaScript object. This value is the direct value which was passed to a NinjaScript Draw method. Please see the [Drawing](/developer/desktop-sdk/references/common/drawing) section for more information.

This value will NOT work on manually drawn objects. This property is reserved for chart anchors which were drawn by another NinjaScript object (e.g, using a Draw method in an indicator). For manually drawn objects, please see the [SlotIndex](/developer/desktop-sdk/references/drawing-tools/chartanchor/barindex) property.

## Property Value

A **int** value that value representing the **barsAgo** value used to drawn the anchor. This property is read-only.

## Syntax

`\<chartanchor\>.BarsAgo`