finance_solution/stocks/mod.rs
1//! Ordered **price-path** analytics (equities or any positive price series).
2//!
3//! # Layers
4//!
5//! | Layer | API | Purpose |
6//! |-------|-----|---------|
7//! | Scalars | [`simple_return`], [`volatility`], [`beta`], … | One-off metrics |
8//! | Solution | [`price_path_solution`] | Summary stats + formulas for a full path |
9//! | Series | [`PricePathSolution::series`] | Period detail (return, wealth, drawdown) |
10//! | Tables | [`PricePathSeries::print_table`] | Terminal / copy-paste output |
11//! | **TA** | [`ta`] — SMA/EMA/Stoch/MACD/BB/KC/VWAP/RVOL + `*State` | Batch series + incremental push |
12//!
13//! # Error handling (v0.1+)
14//!
15//! Public scalars and [`price_path_solution`] return [`crate::FinanceResult`].
16//! Empty series, non-positive prices, length mismatches, and zero volatility cases are
17//! structured [`crate::FinanceError`] values — not panics.
18//! Prefer composing with `?` when prices come from users or external data.
19pub mod path;
20pub mod returns;
21pub mod risk;
22pub mod ta;
23
24#[doc(inline)]
25pub use path::*;
26#[doc(inline)]
27pub use returns::*;
28#[doc(inline)]
29pub use risk::*;
30// TA: re-export common entry points; full surface under `stocks::ta`.
31#[doc(inline)]
32pub use ta::{
33 bollinger, bollinger_solution, ema, ema_last, keltner, keltner_solution, macd, macd_solution,
34 rvol, rvol_solution, sma, sma_last, stochastics, stochastics_solution, vwap, vwap_solution,
35 BollingerBarOutput, BollingerParams, BollingerSeries, BollingerSolution, BollingerState,
36 EmaState, KeltnerBarOutput, KeltnerParams, KeltnerSeries, KeltnerSolution, KeltnerState,
37 MacdParams, MacdSeries, MacdSolution, MacdState, RvolParams, RvolSeries, RvolSolution,
38 RvolState, SmaState, StdevKind, StochBarOutput, StochState, StochasticParams, StochasticSeries,
39 StochasticSolution, ValidatedBollinger, ValidatedKeltner, ValidatedMacd, ValidatedRvol,
40 ValidatedStochastic, ValidatedVwap, VwapMode, VwapParams, VwapPriceSource, VwapSeries,
41 VwapSolution, VwapState,
42};