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

# GetClose()

## Definition

Returns the closing price at the current bar index value.

## Method Return Value

A **double** value that represents the close price at the desired bar index.

## Syntax

`Bars.GetClose(int index)`

## Parameters

| Parameter | Description                                     |
| --------- | ----------------------------------------------- |
| **index** | An int representing an absolute bar index value |

## Examples

```csharp

protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
   base.OnRender(chartControl, chartScale);
   // loop through only the rendered bars on the chart
   for(int barIndex = ChartBars.FromIndex; barIndex &lt;= ChartBars.ToIndex; barIndex++)
   {
     // get the close price at the selected bar index value
     double closePrice = Bars.GetClose(barIndex);
     Print("Bar #" + barIndex + " closing price is " + closePrice);
   }
}

```