diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a2d484c6..2b88801a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- **Rust, Python, Node.js:** Document normalization formulas for `SecurityCalcIndex` Greeks fields: `theta` (divide by 252 for per-trading-day), `vega` and `rho` (divide by 100 for per-unit change). The raw API values differ from Longbridge app display values by these factors. +- **Rust:** `Config::header(key, value)` builder method to inject custom headers into every HTTP request and WebSocket upgrade request. +- **Rust, Python:** `ContentContext` adds three new methods: + - `topic_detail(topic_id)` — get detail of a single topic. + - `list_topic_replies(opts)` — list replies for a topic, with optional page/size filtering. + - `create_topic_reply(opts)` — create a reply under a topic. +- **Rust, Python:** New types `ListTopicRepliesOptions`, `CreateReplyOptions`, and `TopicReply` to support the above methods. - **All languages (Rust/Python/Node.js/Java/C/C++):** Six new `FundamentalContext` methods: - `BusinessSegments` — GET `/v1/quote/fundamentals/business-segments`: latest business segment breakdown. - `BusinessSegmentsHistory` — GET `/v1/quote/fundamentals/business-segments/history`: historical business and regional segment breakdowns with optional `report` and `cate` filters. diff --git a/nodejs/index.d.ts b/nodejs/index.d.ts index d815607a2..4495ed531 100644 --- a/nodejs/index.d.ts +++ b/nodejs/index.d.ts @@ -2153,11 +2153,31 @@ export declare class SecurityCalcIndex { get delta(): Decimal | null /** Gamma */ get gamma(): Decimal | null - /** Theta */ + /** + * Theta + * + * The raw value returned by the API is annualized (scaled by 252 trading + * days per year). To obtain the standard per-calendar-day theta, divide + * by 252: `theta / 252`. + */ get theta(): Decimal | null - /** Vega */ + /** + * Vega + * + * The raw value returned by the API is expressed per 1 percentage-point + * change in implied volatility (i.e. the value has been multiplied by + * 100). To obtain the standard vega (per unit change in IV), divide by + * 100: `vega / 100`. + */ get vega(): Decimal | null - /** Rho */ + /** + * Rho + * + * The raw value returned by the API is expressed per 1 percentage-point + * change in the risk-free rate (i.e. the value has been multiplied by + * 100). To obtain the standard rho (per unit change in rate), divide by + * 100: `rho / 100`. + */ get rho(): Decimal | null } diff --git a/nodejs/src/quote/types.rs b/nodejs/src/quote/types.rs index ed2e01b24..d649ff65c 100644 --- a/nodejs/src/quote/types.rs +++ b/nodejs/src/quote/types.rs @@ -1336,12 +1336,26 @@ pub struct SecurityCalcIndex { #[js(opt)] gamma: Option, /// Theta + /// + /// The raw value returned by the API is annualized (scaled by 252 trading + /// days per year). To obtain the standard per-calendar-day theta, divide + /// by 252: `theta / 252`. #[js(opt)] theta: Option, /// Vega + /// + /// The raw value returned by the API is expressed per 1 percentage-point + /// change in implied volatility (i.e. the value has been multiplied by + /// 100). To obtain the standard vega (per unit change in IV), divide by + /// 100: `vega / 100`. #[js(opt)] vega: Option, /// Rho + /// + /// The raw value returned by the API is expressed per 1 percentage-point + /// change in the risk-free rate (i.e. the value has been multiplied by + /// 100). To obtain the standard rho (per unit change in rate), divide by + /// 100: `rho / 100`. #[js(opt)] rho: Option, } diff --git a/python/pysrc/longbridge/openapi.pyi b/python/pysrc/longbridge/openapi.pyi index 6da9ddeb6..6afef758f 100644 --- a/python/pysrc/longbridge/openapi.pyi +++ b/python/pysrc/longbridge/openapi.pyi @@ -2787,16 +2787,30 @@ class SecurityCalcIndex: theta: Optional[Decimal] """ Theta + + The raw value returned by the API is annualized (scaled by 252 trading + days per year). To obtain the standard per-calendar-day theta, divide + by 252: ``theta / 252``. """ vega: Optional[Decimal] """ Vega + + The raw value returned by the API is expressed per 1 percentage-point + change in implied volatility (i.e. the value has been multiplied by + 100). To obtain the standard vega (per unit change in IV), divide by + 100: ``vega / 100``. """ rho: Optional[Decimal] """ Rho + + The raw value returned by the API is expressed per 1 percentage-point + change in the risk-free rate (i.e. the value has been multiplied by + 100). To obtain the standard rho (per unit change in rate), divide by + 100: ``rho / 100``. """ class QuotePackageDetail: diff --git a/python/src/quote/types.rs b/python/src/quote/types.rs index 3da11132f..0c4816dca 100644 --- a/python/src/quote/types.rs +++ b/python/src/quote/types.rs @@ -1299,12 +1299,26 @@ pub(crate) struct SecurityCalcIndex { #[py(opt)] gamma: Option, /// Theta + /// + /// The raw value returned by the API is annualized (scaled by 252 trading + /// days per year). To obtain the standard per-calendar-day theta, divide + /// by 252: `theta / 252`. #[py(opt)] theta: Option, /// Vega + /// + /// The raw value returned by the API is expressed per 1 percentage-point + /// change in implied volatility (i.e. the value has been multiplied by + /// 100). To obtain the standard vega (per unit change in IV), divide by + /// 100: `vega / 100`. #[py(opt)] vega: Option, /// Rho + /// + /// The raw value returned by the API is expressed per 1 percentage-point + /// change in the risk-free rate (i.e. the value has been multiplied by + /// 100). To obtain the standard rho (per unit change in rate), divide by + /// 100: `rho / 100`. #[py(opt)] rho: Option, } diff --git a/rust/src/quote/types.rs b/rust/src/quote/types.rs index c4cec312d..bfe3ae775 100644 --- a/rust/src/quote/types.rs +++ b/rust/src/quote/types.rs @@ -1730,10 +1730,24 @@ pub struct SecurityCalcIndex { /// Gamma pub gamma: Option, /// Theta + /// + /// The raw value returned by the API is annualized (scaled by 252 trading + /// days per year). To obtain the standard per-calendar-day theta, divide + /// by 252: `theta / 252`. pub theta: Option, /// Vega + /// + /// The raw value returned by the API is expressed per 1 percentage-point + /// change in implied volatility (i.e. the value has been multiplied by + /// 100). To obtain the standard vega (per unit change in IV), divide by + /// 100: `vega / 100`. pub vega: Option, /// Rho + /// + /// The raw value returned by the API is expressed per 1 percentage-point + /// change in the risk-free rate (i.e. the value has been multiplied by + /// 100). To obtain the standard rho (per unit change in rate), divide by + /// 100: `rho / 100`. pub rho: Option, }