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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
26 changes: 23 additions & 3 deletions nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
14 changes: 14 additions & 0 deletions nodejs/src/quote/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1336,12 +1336,26 @@ pub struct SecurityCalcIndex {
#[js(opt)]
gamma: Option<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`.
#[js(opt)]
theta: Option<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`.
#[js(opt)]
vega: Option<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`.
#[js(opt)]
rho: Option<Decimal>,
}
Expand Down
14 changes: 14 additions & 0 deletions python/pysrc/longbridge/openapi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 14 additions & 0 deletions python/src/quote/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1299,12 +1299,26 @@ pub(crate) struct SecurityCalcIndex {
#[py(opt)]
gamma: Option<PyDecimal>,
/// 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<PyDecimal>,
/// 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<PyDecimal>,
/// 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<PyDecimal>,
}
Expand Down
14 changes: 14 additions & 0 deletions rust/src/quote/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1730,10 +1730,24 @@ pub struct SecurityCalcIndex {
/// Gamma
pub gamma: Option<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`.
pub theta: Option<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`.
pub vega: Option<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`.
pub rho: Option<Decimal>,
}

Expand Down
Loading