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

# AtmStrategyCancelEntryOrder()

## Definition

Cancels the specified entry order determined by the string "orderId" parameter.

1. This method is intended ONLY for orders submitted as [Atm Entry Orders](/developer/desktop-sdk/references/strategy/atm-strategy-methods/atmstrategycreate) and assumes the [OrderState](/developer/desktop-sdk/references/strategy/atm-strategy-methods/getatmstrategyentryorderstatus) is NOT terminal (i.e., Cancelled, Filled, Rejected, Unknown).
2. If the specified order does not exist, the method returns false and an error is logged.

## Method Return Value

Returns true if the specified order was found; otherwise false.

## Syntax

`AtmStrategyCancelEntryOrder(string orderId)`

This method should ONLY be called once the strategy [State](/developer/desktop-sdk/references/common/onstatechange/state) has reached State.Realtime

## Parameters

| orderId                                   |
| ----------------------------------------- |
| The unique identifier for the entry order |

## Examples

```csharp
protected override void OnBarUpdate()
{
   // ATM strategy methods only work during real-time
   if (State != State.Realtime)
     return;
 
   string[] entryOrder = GetAtmStrategyEntryOrderStatus("orderId");
 
   // checks if the entry order exists
   // and the order state is not already cancelled/filled/rejected
   if (entryOrder.Length > 0 && entryOrder[2] == "Working")
   {
     AtmStrategyCancelEntryOrder("orderId");
   }
}
```