1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/******************************************************************************
use positive::pos_or_panic;
Author: Joaquín Béjar García
Email: jb@taunais.com
Date: 24/12/25
******************************************************************************/
//! # Risk Metrics Module
//!
//! Provides comprehensive risk metrics tools for financial applications,
//! including implied volatility curves and surfaces, risk reversal curves,
//! and dollar gamma curves.
//!
//! ## Core Features
//!
//! ### Implied Volatility
//!
//! - **Curve representation by strike price**: Shows how IV varies across
//! different strike prices for options with the same expiration.
//! - **Surface representation (strike vs time)**: Provides a complete view
//! of the volatility structure across both strikes and time horizons.
//!
//! ### Risk Reversal
//!
//! - **Curve representation by strike price**: Measures the difference between
//! OTM call and put implied volatilities, indicating market sentiment.
//! - Positive values suggest bullish sentiment (calls more expensive)
//! - Negative values suggest bearish sentiment (puts more expensive)
//!
//! ### Dollar Gamma
//!
//! - **Curve representation by strike price**: Shows gamma exposure in dollar
//! terms, crucial for understanding monetary risk from gamma.
//! - Formula: Dollar Gamma = Gamma × Spot² × 0.01
//!
//! ## Usage Examples
//!
//! ### Implied Volatility Curve
//!
//! ```ignore
//! use optionstratlib::chains::chain::OptionChain;
//! use optionstratlib::metrics::ImpliedVolatilityCurve;
//!
//! let chain = OptionChain::new("SPY", pos_or_panic!(450.0), "2024-03-15".to_string(), None, None);
//! let iv_curve = chain.iv_curve()?;
//! ```
//!
//! ### Risk Reversal Curve
//!
//! ```ignore
//! use optionstratlib::chains::chain::OptionChain;
//! use optionstratlib::metrics::RiskReversalCurve;
//!
//! let chain = OptionChain::new("SPY", pos_or_panic!(450.0), "2024-03-15".to_string(), None, None);
//! let rr_curve = chain.risk_reversal_curve()?;
//! ```
//!
//! ### Dollar Gamma Curve
//!
//! ```ignore
//! use optionstratlib::chains::chain::OptionChain;
//! use optionstratlib::metrics::DollarGammaCurve;
//! use optionstratlib::model::OptionStyle;
//!
//! let chain = OptionChain::new("SPY", pos_or_panic!(450.0), "2024-03-15".to_string(), None, None);
//! let dg_curve = chain.dollar_gamma_curve(&OptionStyle::Call)?;
//! ```
pub use DollarGammaCurve;
pub use ;
pub use RiskReversalCurve;