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

# RemoveLastBar()

## Definition

Removes the last data point for the Bars Type. There may be cases where your custom bar type may need to amend the last values added on a bar that has already closed. Calling **RemoveLastBar()** will remove the last points for that bar type and allow you to call **AddBar()** with the updated values.

* In order to use this method, the [**IsRemoveLastBarSupported**](/developer/desktop-sdk/references/bars-type/isremovelastbarsupported) method must be true.
* **RemoveLastBar()** CANNOT be used with [**TickReplay**](https://ninjatrader.com/support/helpGuides/nt8/?tick_replay.htm)

## Syntax

`RemoveLastBar(Bars bars)`

## Parameters

| Parameter | Description                       |
| --------- | --------------------------------- |
| **bars**  | The Bars object of your bars type |

## Examples

```csharp
RemoveLastBar(bars);
```