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

# DefaultQuantity

## Definition

An order size variable that can be set either programmatically or overridden via the Strategy that determines the quantity of an entry order.

## Property Value

An **int** value represents the number of contracts or shares to enter a position with. Default value is 1.

This property should ONLY be set from the **OnStateChange()** method during **State.SetDefaults** or **State.Configure**.

## Syntax

`DefaultQuantity`

## Examples

```csharp
protected override void OnStateChange() 
{
    if (State == State.SetDefaults)
    {
        DefaultQuantity = 1;
    }
}
```