Skip to main content

Order Management Parameters

Parameters for managing and modifying existing orders.

Cancel Parameters​

cancel_stop_loss​

  • Type: boolean
  • Required: No
  • Default: false

Used with position_side: "CANCEL_ORDERS": cancels the open trade's stop-loss order without closing the position.

{
"position_side": "CANCEL_ORDERS",
"cancel_stop_loss": true
}

cancel_take_profit​

  • Type: boolean
  • Required: No
  • Default: false

Used with position_side: "CANCEL_ORDERS": cancels the open trade's take-profit order without closing the position.

{
"position_side": "CANCEL_ORDERS",
"cancel_take_profit": true
}

Task Parameters​

task_type​

  • Type: string
  • Required: No
  • Description: Type of custom task to execute

Used for advanced order management operations.

task_qty​

  • Type: float
  • Required: No
  • Description: Quantity for task execution (in base currency)

task_quote​

  • Type: float
  • Required: No
  • Description: Quote value for task execution (in quote currency)

Transaction Tracking​

transaction_id​

  • Type: string
  • Required: No
  • Format: a UUID (for example 3f2b8c1e-...) or a short UUID, at most 36 characters
  • Description: Identifier that groups the orders of one trade

You usually do not need to send it. When an entry has no transaction_id, OptAlgo creates one, and every order of that trade carries it. Exits and stop moves find the trade by the bot (and trade_id, if you use one), not by transaction_id.

If you send one, use a fresh UUID per trade. Other formats, such as batch_001, fail the input format check and may be rejected.

Not a duplicate filter

OptAlgo does not use transaction_id to drop repeated webhook signals. Each webhook delivery is processed on its own. See Reliability and safety.


Examples​

Remove Stop Loss​

{
"strategy_key": "your_key",
"exchange": "BINANCE",
"ticker": "BTCUSDT.P",
"position_side": "CANCEL_ORDERS",
"cancel_stop_loss": true
}

Remove Take Profit​

{
"strategy_key": "your_key",
"exchange": "BINANCE",
"ticker": "BTCUSDT.P",
"position_side": "CANCEL_ORDERS",
"cancel_take_profit": true
}

Set New Levels​

Use MOVE_STOP_LOSS. It replaces both orders with the prices you send (a level you leave out is removed):

{
"strategy_key": "your_key",
"exchange": "BINANCE",
"ticker": "BTCUSDT.P",
"position_side": "MOVE_STOP_LOSS",
"stop_loss_price": 49000,
"take_profit_price": 56000
}