Skip to content
Order Submission

Submit Grid Trading Strategy

After the Client selects the grid trading order type on the order page and sets the rules, creates a grid trading strategy: around the base price, the strategy sells according to the rules each time the price rises to the trigger condition and buys each time it falls to the trigger condition, for as long as the strategy is valid. When the price leaves the range, it is handled according to upper_limit_event / lower_limit_event. Grid trading applies only to stock-type securities, does not support options or China A-shares, and requires the Broker to enable the capability for the tenant. Before submission, the Client should have agreed to the grid trading risk declaration (channel_infos.strategy_granted is true in Get Order Configuration) and unlocked trading. On success, the response returns the grid order ID, which you can use to track the strategy. On failure, show message to the Client.

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

POSThttps://api.lbkrs.com/gridtrading/submit

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

grid_trading_ruleobjectrequired

Grid trading rule. An upward trigger sells and a downward trigger buys

Child attributes
submitted_base_pricestringrequired

Base price

upper_limit_pricestringrequired

Upper bound of the price range

lower_limit_pricestringrequired

Lower bound of the price range

upper_limit_eventinteger

Action when the price breaks above the range:

  • 1 - Do not place orders
  • 2 - Close the position at the latest price
Values
1
2
lower_limit_eventinteger

Action when the price breaks below the range. Values are the same as upper_limit_event

Values
1
2
trigger_price_typeintegerrequired

Trigger condition type:

  • 1 - By price spread; use trigger_spread_*, pullback_spread, and rebound_spread
  • 2 - By percentage; use trigger_percent_*, pullback_percent, and rebound_percent
Values
1
2
trigger_spread_upstring

By spread: price rise that triggers a sell

trigger_spread_downstring

By spread: price fall that triggers a buy

trigger_percent_upstring

By percentage: price rise that triggers a sell

trigger_percent_downstring

By percentage: price fall that triggers a buy

pullback_spreadstring

Pullback tracking spread (pass it when pullback tracking is on)

rebound_spreadstring

Rebound tracking spread (pass it when rebound tracking is on)

pullback_percentstring

Pullback tracking percentage (pass it when pullback tracking is on)

rebound_percentstring

Rebound tracking percentage (pass it when rebound tracking is on)

grid_order_type_upstring

Order method for the sell triggered by a rise. Omit it and pass trigger_sell_depth when ordering at an order book level:

  • GMO - Market price (market order)
  • GLO - Market price (limit order)
  • GTG - Trigger price (limit order)
Values
GMO
GLO
GTG
grid_order_type_downstring

Order method for the buy triggered by a fall. Values are the same as grid_order_type_up. Omit it and pass trigger_buy_depth when ordering at an order book level

Values
GMO
GLO
GTG
trigger_sell_depthinteger

Order book level used for the sell order: 1 to 5 for ask 1 to ask 5, and -1 to -5 for bid 1 to bid 5. Pass 0 when grid_order_type_up is used

trigger_buy_depthinteger

Order book level used for the buy order. Values follow trigger_sell_depth. Pass 0 when grid_order_type_down is used

trigger_sell_quantitystringrequired

Sell quantity for each upward trigger

trigger_buy_quantitystringrequired

Buy quantity for each downward trigger

multiple_triggerboolean

Whether multiple-quantity ordering is enabled

support_shortsellboolean

Whether the grid order may short sell

upper_limit_quantitystring

Maximum position quantity (pass it when the position range is on)

lower_limit_quantitystring

Minimum base position quantity (pass it when the position range is on)

time_in_forceinteger

Time in force of the grid strategy, using the same values as order time in force. When it is 6, expire_time is also required

Values
0
1
3
5
6
expire_timeinteger

Expiry time of the grid strategy as a Unix timestamp in seconds

rthinteger

Grid 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
client_request_idstring

Client request identifier: the millisecond timestamp at submission

Responses

HTTP 200The request succeeded. The response body contains the result of the “Submit Grid Trading Strategy” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
order_idstring

Grid order ID

Whale Docs