added

Added Order Groups

Added Order Groups functionality to manage multiple orders together with a shared contracts limit.

Overview

Order Groups allow traders to create a collection of orders that share a common contracts limit. This feature is useful for implementing risk management strategies where you want to limit your total exposure across multiple orders.

Key Features

  • Create order groups with a specified contracts limit
  • Automatic cancellation: When the total matched contracts across all orders in the group reaches the limit, all remaining orders are automatically cancelled
  • Group management: No new orders can be placed in the group until it is reset
  • Reset functionality: Clear the matched contracts counter to allow new orders without deleting the group
  • Delete functionality: Remove the group and cancel all orders within it

API Endpoints

Create Order Group

  • Endpoint: POST /portfolio/order_groups/create
  • Request Body:
    {
      "contracts_limit": 1000
    }
    
  • Response: Returns the created order group ID

List Order Groups

  • Endpoint: GET /portfolio/order_groups
  • Response: Returns all order groups with their IDs and auto-cancel status

Get Order Group Details

  • Endpoint: GET /portfolio/order_groups/{order_group_id}
  • Response: Returns all order IDs in the group and auto-cancel status

Reset Order Group

  • Endpoint: PUT /portfolio/order_groups/{order_group_id}/reset
  • Description: Resets the matched contracts counter to zero, allowing new orders to be placed

Delete Order Group

  • Endpoint: DELETE /portfolio/order_groups/{order_group_id}
  • Description: Permanently deletes the group and cancels all associated orders

Usage Notes

  • Orders can be added to a group by specifying the order_group_id parameter when creating an order
  • The is_auto_cancel_enabled flag indicates whether the group has auto-cancellation active
  • Access to this feature may be restricted via allowlist configuration

API Version

2.0.7