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

# Bars Type

Creating custom Bars Types allows for incredible flexibility in the way you want to present data in a chart. The methods and properties covered in this section are unique to custom Bars Type development.

## Methods and Properties

| Method/Property                                                                                        | Description                                                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AddBar()](/developer/desktop-sdk/references/bars-type/addbar)                                         | Adds new data points for the Bars Type.                                                                                                                                                                                                  |
| [ApplyDefaultBasePeriodValue](/developer/desktop-sdk/references/bars-type/applydefaultbaseperiodvalue) | Sets the default base values used for the [BarsPeriod](/developer/desktop-sdk/references/common/onbarupdate/barsperiod) selected by the user (e.g., the default PeriodValue, DaysToLoad, etc.) for your custom Bar Type.                 |
| [ApplyDefaultValue](/developer/desktop-sdk/references/bars-type/applydefaultvalue)                     | Sets the default [BarsPeriod](/developer/desktop-sdk/references/common/onbarupdate/barsperiod) values used for a custom Bar Type.                                                                                                        |
| [BuiltFrom](/developer/desktop-sdk/references/bars-type/builtfrom)                                     | Determines the base dataset used to build the BarsType (i.e., Tick, Minute, Day).                                                                                                                                                        |
| [GetInitialLookBackDays()](/developer/desktop-sdk/references/bars-type/getinitiallookbackdays)         | Determines how many days of data load when a user makes a "bars back" data request.                                                                                                                                                      |
| [GetPercentComplete()](/developer/desktop-sdk/references/bars-type/getpercentcomplete)                 | Determines the value your BarsType would return for [Bars.PercentComplete](/developer/desktop-sdk/references/common/bars/percentcomplete)                                                                                                |
| [Icon](/developer/desktop-sdk/references/bars-type/icon-barstype)                                      | The shape which displays next to the Bars Type menu item.                                                                                                                                                                                |
| [IsRemoveLastBarSupported](/developer/desktop-sdk/references/bars-type/isremovelastbarsupported)       | Determines if the bars type can use the [RemoveLastBar()](/developer/desktop-sdk/references/bars-type/removelastbar) method when true, otherwise an exception will be thrown.                                                            |
| [IsTimebased](/developer/desktop-sdk/references/bars-type/istimebased)                                 | Used to indicate the BarsType is built from time-based bars (day, minute, second).                                                                                                                                                       |
| [OnDataPoint()](/developer/desktop-sdk/references/bars-type/ondatapoint)                               | OnDataPoint() method is where you should adjust data points (bar values) of your series through [AddBar()](/developer/desktop-sdk/references/bars-type/addbar) and [UpdateBar()](/developer/desktop-sdk/references/bars-type/updatebar). |
| [RemoveLastBar()](/developer/desktop-sdk/references/bars-type/removelastbar)                           | Removes the last data point for the Bars Type.                                                                                                                                                                                           |
| [SessionIterator](/developer/desktop-sdk/references/common/sessioniterator)                            | Provides trading session information to the bars type. Must be built using the bars object.                                                                                                                                              |
| [UpdateBar()](/developer/desktop-sdk/references/bars-type/updatebar)                                   | Updates a data point in our Bars Type.                                                                                                                                                                                                   |