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
76
77
78
79
80
81
82
83
/******************************************************************************
Author: Joaquín Béjar García
Email: jb@taunais.com
Date: 18/12/25
******************************************************************************/
//! # Price Metrics Module
//!
//! Provides comprehensive price performance metrics tools for financial applications
//!
//! ## Core Components
//! - `VolatilitySkewCurve` trait: Enables plotting functionality for volatility skew curves.
//! - `PutCallRatioCurve` trait: Provides plotting functionalities for premium-weighted Put/Call
//! ratio curves.
//! - `StrikeConcentrationCurve` trait: Provides plotting functionalities for premium-weighted
//! Strike Concentration curves.
//!
//! ## Usage Example Volatility Skew
//! ```rust
//! use std::collections::BTreeSet;
//! use rust_decimal::Decimal;
//! use optionstratlib::curves::Curve;
//! use optionstratlib::error::CurveError;
//! use optionstratlib::metrics::VolatilitySkewCurve;
//!
//! struct MySkew;
//!
//! impl VolatilitySkewCurve for MySkew {
//! fn volatility_skew(&self) -> Result<Curve, CurveError> {
//! // Custom logic to build and return a Curve representing the skew
//! let curve = Curve { points: BTreeSet::new(), x_range: (Decimal::ZERO, Decimal::ZERO) };
//! Ok(curve)
//! }
//! }
//! ```
//!
//! ## Usage Example Put Call Ratio
//! ```rust
//! use std::collections::BTreeSet;
//! use rust_decimal::Decimal;
//! use optionstratlib::curves::Curve;
//! use optionstratlib::error::CurveError;
//! use optionstratlib::metrics::PutCallRatioCurve;
//!
//! struct MyPcr;
//!
//! impl PutCallRatioCurve for MyPcr {
//! fn premium_weighted_pcr(&self) -> Result<Curve, CurveError> {
//! // Custom logic to build and return a Curve representing the premium
//! // weighted put/call ratio
//! let curve = Curve { points: BTreeSet::new(), x_range: (Decimal::ZERO, Decimal::ZERO) };
//! Ok(curve)
//! }
//! }
//! ```
//!
//! ## Usage Example Strike Concentration
//! ```rust
//! use std::collections::BTreeSet;
//! use rust_decimal::Decimal;
//! use optionstratlib::curves::Curve;
//! use optionstratlib::error::CurveError;
//! use optionstratlib::metrics::StrikeConcentrationCurve;
//!
//! struct MyStrikeConcentration;
//!
//! impl StrikeConcentrationCurve for MyStrikeConcentration {
//! fn premium_concentration(&self) -> Result<Curve, CurveError> {
//! // Custom logic to build and return a Curve representing the premium
//! // weighted strike concentration
//! let curve = Curve { points: BTreeSet::new(), x_range: (Decimal::ZERO, Decimal::ZERO) };
//! Ok(curve)
//! }
//! }
//! ```
pub use PutCallRatioCurve;
pub use StrikeConcentrationCurve;
pub use VolatilitySkewCurve;