Skip to content

Feature/mutileg calendar - #1251

Open
liuyuhou-code wants to merge 1 commit into
longbridge:mainfrom
liuyuhou-code:feature/mutileg-calendar
Open

liuyuhou-code wants to merge 1 commit into
longbridge:mainfrom
liuyuhou-code:feature/mutileg-calendar

Conversation

@liuyuhou-code

Copy link
Copy Markdown
Contributor

支持日历价差枚举

多腿策略枚举补充 CalendarCallSpread(7) / CalendarPutSpread(8),
译名对齐 tubelet locales。en/zh-CN/zh-HK 三语言同步。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@liuyuhou-code
liuyuhou-code force-pushed the feature/mutileg-calendar branch from f705316 to f33aede Compare September 8, 2026 02:27
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant