Feature/mutileg calendar - #1251
Open
liuyuhou-code wants to merge 1 commit into
Open
liuyuhou-code wants to merge 1 commit into
liuyuhou-code wants to merge 1 commit into
Conversation
多腿策略枚举补充 CalendarCallSpread(7) / CalendarPutSpread(8), 译名对齐 tubelet locales。en/zh-CN/zh-HK 三语言同步。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
liuyuhou-code
force-pushed
the
feature/mutileg-calendar
branch
from
September 8, 2026 02:27
f705316 to
f33aede
Compare
sunli829
added a commit
to longbridge/openapi
that referenced
this pull request
Sep 9, 2026
Follows [longbridge/developers#1251](longbridge/developers#1251), which documents two new values on the multi-leg strategy enum. `MultiLegStrategy` gains: - `CalendarCallSpread` — wire value `7` - `CalendarPutSpread` — wire value `8` Calendar (horizontal) spreads. Accepted by `TradeContext.submit_multileg`, and reported back on the `multi_leg` field of `today_orders` / `history_orders` / `order_detail` and the order-changed push. Both variants are appended after `Strangle`, so the discriminants of the existing variants are unchanged — this is additive, not a breaking change. Without them the SDK parsed the two new server values as `Unknown` and had no way to submit either strategy. ## Layers touched | Layer | Files | | --- | --- | | Rust core | `rust/src/trade/types.rs` (with the `#[strum(to_string = …, serialize = "7"/"8")]` mapping) | | C | `c/src/trade_context/enum_types.rs` | | C++ | `cpp/include/types.hpp`, `cpp/src/convert.hpp` (both `convert()` directions) | | Java | `java/src/types/enum_types.rs`, `java/javasrc/…/trade/MultiLegStrategy.java` | | Node.js | `nodejs/src/trade/types.rs` | | Python | `python/src/trade/types.rs`, `python/pysrc/longbridge/openapi.pyi` | | Generated | `c/csrc/include/longbridge.h`, `nodejs/index.d.ts` | ## Verification - `cargo clippy --all --all-features` and `cargo +nightly fmt --all` — clean (only the pre-existing `longbridge-nodejs` warnings) - `cargo build -p longbridge-c` / `-p longbridge-java` / `-p longbridge-python` — pass - `npm run build:debug` — pass; `index.d.ts` regenerated - C++: syntax-checked a TU including `convert.hpp` (`g++ -std=c++17 -fsyntax-only`); both `convert()` overloads resolve the new variants. Full CMake build not run. - strum round-trip checked with a throwaway `cargo test`: `"7"`/`"8"` and `"CalendarCallSpread"`/`"CalendarPutSpread"` parse to the new variants, and `to_string()` yields the string names. The temporary test file is not part of this PR. `java/javasrc` was not compiled — no JDK on this machine. The change there is two enum constants; the Rust JNI half does build. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
支持日历价差枚举