> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decibel.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel TP/SL Order for Position

> Cancel a take-profit or stop-loss order for a position

**Function:**

```
{package}::dex_accounts_entry::cancel_tp_sl_order_for_position
```

**ABI Object:**

```typescript theme={null}
const functionAbi: MoveFunction = {
  name: "cancel_tp_sl_order_for_position",
  visibility: "private",
  is_entry: true,
  is_view: false,
  generic_type_params: [],
  params: [
    "&signer",
    "0x1::object::Object<{package}::dex_accounts::Subaccount>",
    "0x1::object::Object<{package}::perp_market::PerpMarket>",
    "u128",
  ],
  return: [],
};
```

**Parameters:**

* `signer` - The account signer
* `subaccount` - The Trading Account object
* `market` - The PerpMarket object
* `order_id` - The TP/SL order ID to cancel (u128)

**Example:**

<CodeGroup>
  ```typescript Typescript theme={null}
  const transaction = await aptos.transaction.build.simple({
    sender: account.accountAddress,
    data: {
      function: `${PACKAGE}::dex_accounts_entry::cancel_tp_sl_order_for_position`,
      typeArguments: [],
      functionArguments: [
        "0x123...abc", // subaccountAddr
        "0x456...def", // marketAddr (PerpMarket object address)
        12345678901234567890, // orderId (u128)
      ],
    },
  });
  ```

  ```python Python theme={null}
  transaction = rest_client.build_transaction(
      sender=account.address(),
      payload={
          "function": f"{PACKAGE}::dex_accounts_entry::cancel_tp_sl_order_for_position",
          "type_arguments": [],
          "function_arguments": [
              "0x123...abc",  # subaccountAddr
              "0x456...def",  # marketAddr (PerpMarket object address)
              12345678901234567890,  # orderId (u128)
          ],
      },
  )
  ```
</CodeGroup>
