finance-solution 0.3.0

Finance math: TVM, cashflow, amortization, equity path metrics, technical analysis (SMA/EMA/MACD/Bollinger/Keltner/Stoch/VWAP/RVOL), and European BSM options (price, Greeks, IV) with Result-only APIs, solutions, tables, and incremental state.
Documentation
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Planned

- Black ’76 / Garman–Kohlhagen (roadmap D2–D3)
- Optional RSI / more oscillators
- Optional TVM identity proptests (E5 remainder)
- Optional BSM Criterion benches

## [0.3.0] — 2026-08-11

Additive **European option math** and a real-bar demo joining underlier TA with BSM. **No** dual panicking / `try_*` public math. Still a pure math library (no feeds, chains, or order routing).

### Added

- **`derivatives` module (D1):**
  - European Black–Scholes–Merton `bsm_price`, `bsm_greeks` (Δ Γ Θ ν ρ), `bsm_terms`, `bsm_implied_vol`
  - Put–call parity residual, `intrinsic` / `time_value` / spot & forward moneyness
  - `BsmParams`, `ValidatedBsm`, `BsmSolution` teaching table, `BsmGreeks` desk helpers (`vega_per_vol_point`, `theta_per_calendar_day`)
  - `BsmState` for live `set_spot` / `set_vol` / `set_vol_from_price` / `set_time_years` updates
  - Deep `//!` docs: trading desk view + engineering wire-up (sync math, join with `stocks::ta`)
- **Examples:**
  - `cargo run --example bsm_option`
  - `cargo run --example real_bars_ta_bsm --release` — real 1m OHLCV under `examples/data/` (GitHub only; excluded from crates.io)
- **TA proptests:** MACD / Keltner last-value batch↔stream parity

### Design notes

- Option + underlier concurrency lives in **your** engine (`HashMap` of `BsmState`, optional `rayon` over strikes).
- Black ’76 (futures options) and Garman–Kohlhagen (FX) remain planned.

## [0.2.0] — 2026-08-10

Additive technical-analysis and domain-primitive surface for quant consumers. **No** dual panicking / `try_*` public math.

### Added

- **Domain newtypes:** `Rate`, `Periods`, `PeriodLength`, `PositivePrice`, `Money` (validated `new``FinanceResult`)
- **`stocks::ta` batch indicators:** SMA, EMA, Stochastic (fast/full params), MACD, Bollinger, Keltner (Wilder ATR), VWAP (cumulative/rolling + price source enums), RVOL
- **Params + `Validated*` + free functions + `*_solution` tables** for teaching (warm-up as `n/a`; deep `//!` docs with word problems and sample tables)
- **Incremental state machines** (live bars, not a market-data engine):
  - `SmaState`, `EmaState`, `StochState`, `MacdState`, `BollingerState`, `KeltnerState`, `VwapState`, `RvolState`
  - `new` / `from_history` / `push` / `push_bars` / `reset` (where applicable)
  - Batch ↔ stream parity unit tests + **proptest** random-path parity
- SMA/EMA **batch implemented via state** (single math path; `sma_last` / `ema_last` use state)
- Bollinger **`StdevKind`**: Sample (`n−1`, default) or Population (`n`)
- Stochastic **flat window** (HH==LL): carry previous raw %K, else 50
- Criterion **suite D** TA benches; README quant-engine sketch (per-symbol pipeline, caller-owned session reset)
- Example: `cargo run --example ta_indicators`

### Changed

- Fallible constructors use **`new``FinanceResult`** (not `try_new`), consistent with Result-only crate policy (`Schedule::new_*`, std `File::open` style)

### Design notes

- Streaming **state** is in scope; streaming **engine** (feeds, multi-symbol registry, calendars) is not — the quant app owns those and calls `reset()` / `from_history` as policy.

## [0.1.0] — 2026-08-10

First crates.io release of the Result-only API.

### Added

- Public math returns `FinanceResult` / `FinanceError` only (no dual panicking / `try_*` surface)
- TVM, cashflow, rate conversion, amortization (solution/series/tables + PPMT/IPMT/CUMPRINC/CUMIPMT)
- Doubling rules, equity price-path metrics (returns, vol, Sharpe, Sortino, beta, drawdowns)
- Domain-oriented docs, examples, Criterion benches for core TVM/cashflow