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

# GetAtmStrategyMarketPosition()

## Definition

Gets the current market position of the specified ATM Strategy.

Notes:

1. Changes to positions will not be reflected till at least the next **OnBarUpdate()** event after an order fill.
2. If the ATM Strategy does not exist then **MarketPosition.Flat** returns.
3. Please note this provides access to the current ATM strategy position, which should not be confused with the NinjaScript strategy position or account position. For more information please see the [Using ATM Strategies](/developer/desktop-sdk/guides/educational-resources/using-atm-strategies) section.

## Method Return Value

* **MarketPosition.Flat**
* **MarketPosition.Long**
* **MarketPosition.Short**

## Syntax

`GetAtmStrategyMarketPosition(string atmStrategyId)`

## Parameters

| Parameter         | Description                                |
| ----------------- | ------------------------------------------ |
| **atmStrategyId** | The unique identifier for the ATM strategy |

## Examples

```csharp
protected override void OnBarUpdate()
{
    // Check if flat
    if (GetAtmStrategyMarketPosition("id") == MarketPosition.Flat)
        Print("ATM Strategy position is currently flat");
}
```