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

# ApplyDefaultValue

## Definition

Sets the default **BarsPeriod** values used for a custom Bar Type.

## Method Return Value

This method does not return a value.

## Parameters

| Parameter | Description                                                                                                                        |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| period    | The [BarsPeriod](/developer/desktop-sdk/references/common/onbarupdate/barsperiod) chosen by the user when utilizing this Bars type |

## Syntax

You must override the method in your Bars Type with the following syntax:

`public override void ApplyDefaultValue(BarsPeriod period)  \{  \}`

## Examples

```csharp
public override void ApplyDefaultValue(BarsPeriod period)
{
		period.BarsPeriodTypeName = "MyBarType";
		period.Value = 1;
}
```