Skip to content

SplitOrder ​

Split a large order into multiple smaller orders to reduce market impact or comply with freeze quantity limits.

Endpoint URL ​

http
Local Host   :  POST http://127.0.0.1:5000/api/v1/splitorder
Ngrok Domain :  POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/splitorder
Custom Domain:  POST https://<your-custom-domain>/api/v1/splitorder

Sample API Request ​

json
{
  "apikey": "<your_app_apikey>",
  "strategy": "Python",
  "symbol": "YESBANK",
  "exchange": "NSE",
  "action": "SELL",
  "quantity": "105",
  "splitsize": "20",
  "pricetype": "MARKET",
  "product": "MIS"
}

Sample cURL Request ​

bash
curl -X POST http://127.0.0.1:5000/api/v1/splitorder \
  -H 'Content-Type: application/json' \
  -d '{
  "apikey": "<your_app_apikey>",
  "strategy": "Python",
  "symbol": "YESBANK",
  "exchange": "NSE",
  "action": "SELL",
  "quantity": "105",
  "splitsize": "20",
  "pricetype": "MARKET",
  "product": "MIS"
}'

Sample API Response ​

json
{
  "status": "success",
  "split_size": 20,
  "total_quantity": 105,
  "results": [
    {
      "order_num": 1,
      "orderid": "250408001021467",
      "quantity": 20,
      "status": "success"
    },
    {
      "order_num": 2,
      "orderid": "250408001021459",
      "quantity": 20,
      "status": "success"
    },
    {
      "order_num": 3,
      "orderid": "250408001021466",
      "quantity": 20,
      "status": "success"
    },
    {
      "order_num": 4,
      "orderid": "250408001021470",
      "quantity": 20,
      "status": "success"
    },
    {
      "order_num": 5,
      "orderid": "250408001021471",
      "quantity": 20,
      "status": "success"
    },
    {
      "order_num": 6,
      "orderid": "250408001021472",
      "quantity": 5,
      "status": "success"
    }
  ]
}

Request Body ​

ParameterDescriptionMandatory/OptionalDefault Value
apikeyYour Tradeboard API keyMandatory-
strategyStrategy identifierMandatory-
symbolTrading symbolMandatory-
exchangeExchange code accepted by the shared validation constantsMandatory-
actionOrder action: BUY or SELLMandatory-
quantityPositive numeric quantity to splitMandatory-
splitsizeSize of each split orderMandatory-
pricetypePrice type: MARKET, LIMIT, SL, SL-MOptionalMARKET
productProduct type: MIS, CNC, NRMLOptionalMIS
priceOrder price (for LIMIT orders)Optional0
trigger_priceTrigger price (for SL orders)Optional0
disclosed_quantityDisclosed quantity applied to each child orderOptional0

These eleven fields are the complete SplitOrderSchema. Any other field returns HTTP 400.

Response Fields ​

FieldTypeDescription
statusstring"success" or "error"
split_sizenumberSize used for splitting
total_quantitynumberTotal quantity processed
resultsarrayArray of individual order results

Results Array Fields ​

FieldTypeDescription
order_numnumberOrder sequence number (1, 2, 3...)
orderidstringOrder ID from broker
quantitynumberQuantity for this order
statusstring"success" or "error"
messagestringError message (on failure)

How Split Orders Work ​

For a total quantity of 105 with splitsize of 20:

Order 1: 20 units
Order 2: 20 units
Order 3: 20 units
Order 4: 20 units
Order 5: 20 units
Order 6: 5 units (remainder)
-----------------
Total: 105 units

Notes ​

  • Maximum 100 child orders per split request. A quantity and splitsize combination that would produce more than 100 orders is rejected before any order is sent.
  • The last order contains the remainder (quantity % splitsize)
  • Rate limit: API_RATE_LIMIT, not ORDER_RATE_LIMIT
  • Live child orders are placed sequentially using a delay derived from ORDER_RATE_LIMIT; analyzer mode prefetches one quote and uses the sandbox path.
  • Fractional total quantities are accepted only for CRYPTO; non-crypto total quantities must be whole numbers. splitsize is always a positive integer.
  • Use for:
    • Large F&O orders: Splitting to stay within freeze quantity limits
    • Reducing market impact: Spreading execution over multiple orders
    • TWAP strategies: Time-weighted average price execution
  • If splitsize is larger than quantity, a single order is placed
  • All split orders share the same price type and price

Freeze quantities change and are loaded from data/qtyfreeze.csv; do not hard-code the example values from older releases.


Back to: API Documentation