Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- **All languages:** `MultiLegStrategy` gains `CalendarCallSpread` (`7`) and `CalendarPutSpread` (`8`) — calendar (horizontal) spreads, accepted by `TradeContext.submit_multileg` and reported back on the `multi_leg` field of order queries and the order-changed push. Both are appended after `Strangle`, so the discriminants of the existing variants are unchanged. Added across Rust, C, C++, Java, Node.js, and Python. Documented in longbridge/developers#1251
- **Rust:** `Signal.status` is now a `SignalStatus` enum (pending / active / deleted / ai-failed / filtered-by-manual / ai-submit-failed), `SignalsResponse.total` is `i32` to match the wire contract, and the `risk_level` / `display_control` fields were dropped — neither is part of the API contract nor served in production
- **Rust:** `SignalContext.security_facts` now returns a typed `SecurityFact` instead of raw JSON — fact id / type / direction, the securities it is about, the factors behind it (with their anomaly test and groups), the data sources, and the natural-language `nl_info`. Adds the `FactType` and `FactDirection` enums, and `FactNlInfo::summary_tags()` / `invest_anal_tags()` / `eli_explain_tags()` for the `{tag, value}` entries the API carries as JSON inside a string
- **Rust:** add `SignalContext` — strategy signals and the catalyst facts behind them. `signals` (`GET /v1/signals`) queries signals with symbol / strategy / catalyst / time-range filters and paging; `signal` (`GET /v1/signals/{signal_id}`) returns one signal including the full strategy analysis in `json_data`; `security_facts` (`GET /v1/facts/security_facts`) lists a security's fact (catalyst) events. Bindings for the other languages are not wired up yet
Expand Down
8 changes: 8 additions & 0 deletions c/csrc/include/longbridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,14 @@ typedef enum CMultiLegStrategy {
* Strangle
*/
MultiLegStrategyStrangle,
/**
* Calendar call spread
*/
MultiLegStrategyCalendarCallSpread,
/**
* Calendar put spread
*/
MultiLegStrategyCalendarPutSpread,
} CMultiLegStrategy;

/**
Expand Down
6 changes: 6 additions & 0 deletions c/src/trade_context/enum_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@ pub enum CMultiLegStrategy {
/// Strangle
#[c(remote = "Strangle")]
MultiLegStrategyStrangle,
/// Calendar call spread
#[c(remote = "CalendarCallSpread")]
MultiLegStrategyCalendarCallSpread,
/// Calendar put spread
#[c(remote = "CalendarPutSpread")]
MultiLegStrategyCalendarPutSpread,
}

/// Multi-leg position direction
Expand Down
4 changes: 4 additions & 0 deletions cpp/include/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,10 @@ enum class MultiLegStrategy
Straddle,
/// Strangle
Strangle,
/// Calendar call spread
CalendarCallSpread,
/// Calendar put spread
CalendarPutSpread,
};

/// Multi-leg position direction
Expand Down
8 changes: 8 additions & 0 deletions cpp/src/convert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,10 @@ convert(CMultiLegStrategy strategy)
return MultiLegStrategy::Straddle;
case MultiLegStrategyStrangle:
return MultiLegStrategy::Strangle;
case MultiLegStrategyCalendarCallSpread:
return MultiLegStrategy::CalendarCallSpread;
case MultiLegStrategyCalendarPutSpread:
return MultiLegStrategy::CalendarPutSpread;
default:
return MultiLegStrategy::Unknown;
}
Expand All @@ -1520,6 +1524,10 @@ convert(MultiLegStrategy strategy)
return MultiLegStrategyStraddle;
case MultiLegStrategy::Strangle:
return MultiLegStrategyStrangle;
case MultiLegStrategy::CalendarCallSpread:
return MultiLegStrategyCalendarCallSpread;
case MultiLegStrategy::CalendarPutSpread:
return MultiLegStrategyCalendarPutSpread;
default:
return MultiLegStrategyUnknown;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ public enum MultiLegStrategy {
Straddle,
/** Strangle */
Strangle,
/** Calendar call spread */
CalendarCallSpread,
/** Calendar put spread */
CalendarPutSpread,
}
4 changes: 3 additions & 1 deletion java/src/types/enum_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,9 @@ impl_java_enum!(
VerticalPutSpread,
Collar,
Straddle,
Strangle
Strangle,
CalendarCallSpread,
CalendarPutSpread
]
);

Expand Down
6 changes: 5 additions & 1 deletion nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6002,7 +6002,11 @@ export declare const enum MultiLegStrategy {
/** Straddle */
Straddle = 6,
/** Strangle */
Strangle = 7
Strangle = 7,
/** Calendar call spread */
CalendarCallSpread = 8,
/** Calendar put spread */
CalendarPutSpread = 9
}

/** Options for listing topics created by the current authenticated user */
Expand Down
4 changes: 4 additions & 0 deletions nodejs/src/trade/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ pub enum MultiLegStrategy {
Straddle,
/// Strangle
Strangle,
/// Calendar call spread
CalendarCallSpread,
/// Calendar put spread
CalendarPutSpread,
}

/// Multi-leg position direction
Expand Down
10 changes: 10 additions & 0 deletions python/pysrc/longbridge/openapi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6266,6 +6266,16 @@ class MultiLegStrategy:
Strangle
"""

class CalendarCallSpread(MultiLegStrategy):
"""
Calendar call spread
"""

class CalendarPutSpread(MultiLegStrategy):
"""
Calendar put spread
"""

class MultiLegPosition:
"""
Multi-leg position direction
Expand Down
4 changes: 4 additions & 0 deletions python/src/trade/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ pub(crate) enum MultiLegStrategy {
Straddle,
/// Strangle
Strangle,
/// Calendar call spread
CalendarCallSpread,
/// Calendar put spread
CalendarPutSpread,
}

/// Multi-leg position direction
Expand Down
6 changes: 6 additions & 0 deletions rust/src/trade/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ pub enum MultiLegStrategy {
/// Strangle
#[strum(to_string = "Strangle", serialize = "6")]
Strangle,
/// Calendar call spread
#[strum(to_string = "CalendarCallSpread", serialize = "7")]
CalendarCallSpread,
/// Calendar put spread
#[strum(to_string = "CalendarPutSpread", serialize = "8")]
CalendarPutSpread,
}

/// Multi-leg position direction
Expand Down
Loading