Skip to content
Order Submission

Submit Position Take-Profit and Stop-Loss Orders

Places take-profit and/or stop-loss conditional orders for an existing position at once, used by the position's take-profit and stop-loss panel. Unlike attached orders, position take-profit and stop-loss orders act on the existing position and do not depend on a new main order. Derive the side from the position: pass 2 (sell) for a long position and 1 (buy) for a short position. Set at least one of take-profit and stop-loss; both use the same order type. On success, the response returns the group ID ploy_id, which links the take-profit and stop-loss orders placed in this request in the order list. The placed orders are regular conditional orders, so amend and cancel them as conditional orders. On failure, show message to the Client.

WhaleCore's orderService() wraps this endpoint as the typed method submitTPSLOrder. If you use WhaleCore, prefer that method.

POSThttps://api.lbkrs.com/v1/orders/submit_tpsl

Request body application/json

counter_idstringrequired

Security ID (counter_id), such as ST/US/AAPL or ST/HK/700

settlement_currencystringrequired

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

actionstringrequired

Closing side:

  • 1 - Buy (short position)
  • 2 - Sell (long position)
Values
1
2
quantitystringrequired

Order quantity of the take-profit and stop-loss orders

time_in_forceintegerrequired

Time in force. The value must be in support_time_in_forces of the order type in Get Order Configuration:

  • 0 - Day (DAY)
  • 1 - Good till canceled (GTC)
  • 3 - Immediate or cancel (IOC)
  • 5 - Fill or kill (FOK)
  • 6 - Good till date (GTD); expire_time is also required

If omitted, the order is treated as a day order.

Values
0
1
3
5
6
expire_timestring

Expiry time as a Unix timestamp in seconds. Required when time_in_force is 6

force_only_rthstring

Trading session (pass it when the security supports pre-market and after-hours trading):

  • 1 - Regular trading hours only
  • 2 - Regular trading hours plus pre-market and after-hours
Values
1
2
take_profit_order_typestring

Take-profit order type:

  • LIT - Limit if touched; the matching *_submit_price is also required
  • MIT - Market if touched
Values
LIT
MIT
take_profit_trigger_pricestring

Take-profit trigger price. Required when take-profit is set

take_profit_submit_pricestring

Limit price after the take-profit order triggers. Required when take_profit_order_type is LIT

stop_loss_order_typestring

Stop-loss order type:

  • LIT - Limit if touched; the matching *_submit_price is also required
  • MIT - Market if touched
Values
LIT
MIT
stop_loss_trigger_pricestring

Stop-loss trigger price. Required when stop-loss is set

stop_loss_submit_pricestring

Limit price after the stop-loss order triggers. Required when stop_loss_order_type is LIT

Responses

HTTP 200The request succeeded. The response body contains the result of the “Submit Position Take-Profit and Stop-Loss Orders” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
ploy_idstring

Group ID that links the take-profit and stop-loss orders placed in this request in the order list

Whale Docs