Skip to content
Tradable Quantity and Margin

Estimate Multi-Leg Option Open Quantity

On the multi-leg option order page, after the Client enters a price or quantity, estimates the maximum number of combinations that can be opened by strategy, leg securities, limit price, and combination quantity, and returns the margin of one combination and the margin, available cash, and cash book balance before and after the trade. Multi-leg orders do not distinguish cash from margin; use max_qty as the maximum quantity. To estimate the margin used by this order, multiply unit_margin by the combination quantity. Do not call this endpoint when the price is 0.

When you call this endpoint through WhaleCore requestService(), set requiresTradeToken to true.

WhaleCore's orderService() provides the corresponding capability. If you use WhaleCore, prefer the corresponding orderService() method.

POSThttps://api.lbkrs.com/v1/orders/stock_contract/mleg/available_open_quantity

Request body application/json

counter_idstringrequired

Main security ID of the combination: the counter_id of the underlying stock

pricestringrequired

Combination limit price in the trading currency

settlement_currencystringrequired

Settlement currency, such as USD or HKD. Use an item of channel_infos.settlement_currency returned by Get Order Configuration

currencystringrequired

Trading currency. Pass the same value as settlement_currency

order_typestringrequired

Order type code, such as LO, MO, or ELO. Use a key of channel_infos.order_type_config returned by Get Order Configuration

actionintegerrequired

Order side:

  • 1 - Buy
  • 2 - Sell
Values
1
2
strategystringrequired

Multi-leg strategy type:

  • 0 - Covered call
  • 1 - Covered put
  • 2 - Vertical call spread
  • 3 - Vertical put spread
  • 4 - Collar
  • 5 - Straddle
  • 6 - Strangle
  • 7 - Calendar call spread
  • 8 - Calendar put spread
Values
0
1
2
3
4
5
6
7
8
legsarray<object>required

Legs in the combination

Child attributes
counter_idstringrequired

Security ID of the leg

quantitystringrequired

Combination quantity

Responses

HTTP 200The request succeeded. The response body contains the result of the “Estimate Multi-Leg Option Open Quantity” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
max_qtystring

Maximum number of combinations that can be opened (cash and margin are not distinguished)

unit_marginstring

Margin of one combination

before_im_marginstring

Initial margin before the trade

after_im_marginstring

Initial margin after the trade

before_mm_marginstring

Maintenance margin before the trade

after_mm_marginstring

Maintenance margin after the trade

before_available_cashstring

Available cash before the trade

after_available_cashstring

Available cash after the trade

before_cash_book_balancestring

Cash book balance in the settlement currency before the trade

after_cash_book_balancestring

Cash book balance in the settlement currency after the trade

Whale Docs