Skip to content

Commit 266d923

Browse files
authored
feat(trade): Re-land grid trading APIs (after gateway release) (#570)
Restores the grid trading APIs originally added in #563 and reverted in #568. **DO NOT MERGE until the gateway is released.** This is a "revert the revert" of #568, bringing back the full grid trading implementation (Rust core + all bindings) unchanged. Once the gateway goes live, mark ready and merge.
1 parent 78cf6ae commit 266d923

93 files changed

Lines changed: 13638 additions & 197 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
- **All languages:** add grid-trading support via a standalone `GridContext` — submit / replace / cancel / suspend / restart grid orders, list orders (paged and by IDs), fetch order detail and trigger history, submit the strategy risk-disclosure questionnaire, and query the security (symbol) info (`symbol_info``GridSymbolInfo`: name, last price, lot sizes, price-step rules, channel/authorization) needed to build a grid order. Available in the Rust, Python, Node.js, Java, and C/C++ bindings
1112
- **All languages:** `Execution` gains a `side` field (`OrderSide`) — the buy/sell direction of the fill, now returned by the `today_executions`, `history_executions`, and `all_executions` responses
1213

1314
### Fixed

c/cbindgen.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,25 @@ cpp_compat = true
111111
"COrderChargeItem" = "lb_order_charge_item_t"
112112
"COrderChargeDetail" = "lb_order_charge_detail_t"
113113
"COrderDetail" = "lb_order_detail_t"
114+
"CGridTradeRule" = "lb_grid_trade_rule_t"
115+
"CSubmitGridOrderOptions" = "lb_submit_grid_order_options_t"
116+
"CReplaceGridOrderOptions" = "lb_replace_grid_order_options_t"
117+
"CGetGridOrdersOptions" = "lb_get_grid_orders_options_t"
118+
"CGetGridOrdersByIdsOptions" = "lb_get_grid_orders_by_ids_options_t"
119+
"CGetGridOrderDetailOptions" = "lb_get_grid_order_detail_options_t"
120+
"CGetGridTriggerHistoryOptions" = "lb_get_grid_trigger_history_options_t"
121+
"CSubmitGridOrderResponse" = "lb_submit_grid_order_response_t"
122+
"CGridOrder" = "lb_grid_order_t"
123+
"CGridOrderSubOrder" = "lb_grid_order_sub_order_t"
124+
"CGridOrderHistory" = "lb_grid_order_history_t"
125+
"CGridOrderDetail" = "lb_grid_order_detail_t"
126+
"CTriggerOrder" = "lb_trigger_order_t"
127+
"CGridBidSize" = "lb_grid_bid_size_t"
128+
"CGridChannelInfo" = "lb_grid_channel_info_t"
129+
"CGridSymbolInfo" = "lb_grid_symbol_info_t"
130+
"CGridOrdersResponse" = "lb_grid_orders_response_t"
131+
"CGridTriggerHistoryResponse" = "lb_grid_trigger_history_response_t"
132+
"CPushGridOrderChanged" = "lb_push_grid_order_changed_t"
114133
"CEstimateMaxPurchaseQuantityOptions" = "lb_estimate_max_purchase_quantity_options_t"
115134
"CEstimateMaxPurchaseQuantityResponse" = "lb_estimate_max_purchase_quantity_response_t"
116135
"CCreateWatchlistGroup" = "lb_create_watchlist_group_t"
@@ -143,6 +162,7 @@ cpp_compat = true
143162
"CFundamentalContext" = "lb_fundamental_context_t"
144163
"CAlertContext" = "lb_alert_context_t"
145164
"CDCAContext" = "lb_dca_context_t"
165+
"CGridContext" = "lb_grid_context_t"
146166
"CSharelistContext" = "lb_sharelist_context_t"
147167
"CCalendarContext" = "lb_calendar_context_t"
148168
"CPortfolioContext" = "lb_portfolio_context_t"
@@ -408,6 +428,13 @@ include = [
408428
"CWatchlistSecurity",
409429
"CMarginRatio",
410430
"COrderDetail",
431+
# GridContext: grid trading (reachable only via void* async data pointer)
432+
"CSubmitGridOrderResponse",
433+
"CGridOrder", "CGridOrderSubOrder", "CGridOrderHistory", "CGridOrderDetail",
434+
"CTriggerOrder", "CGridBidSize", "CGridChannelInfo", "CGridSymbolInfo",
435+
"CGridOrdersResponse", "CGridTriggerHistoryResponse",
436+
# TradeContext: grid trading push (stays on trade side)
437+
"CPushGridOrderChanged",
411438
"CEstimateMaxPurchaseQuantityResponse",
412439
"CSecurityCalcIndex",
413440
"CWarrantInfo",

0 commit comments

Comments
 (0)