#![cfg_attr(
    test,
    allow(
        clippy::expect_used,
        clippy::unwrap_used,
        clippy::panic,
        clippy::indexing_slicing
    )
)]

//! Pure performance statistics library for trading.
//!
//! All functions are pure math - no I/O, no async, WASM-compatible.
//!
//! # Example
//!
//! ```
//! use quant_metrics::{total_return, sharpe_ratio, max_drawdown};
//! use rust_decimal_macros::dec;
//!
//! let equity = vec![dec!(10000), dec!(10150), dec!(10230), dec!(10080), dec!(10350)];
//! let rf_rate = dec!(0.02); // 2% annual risk-free rate
//!
//! let ret = total_return(&equity);
//! let sharpe = sharpe_ratio(&equity, rf_rate, 252); // 252 trading days
//! let max_dd = max_drawdown(&equity);
//! ```

pub mod analytics;
pub mod cointegration;
pub mod composition;
mod drawdown;
mod error;
mod kelly;
mod math;
mod returns;
mod risk_adjusted;
pub mod risk_metrics;
mod rolling;
mod trading;

pub use drawdown::{drawdown_series, max_drawdown, max_drawdown_duration, recovery_time};
pub use error::MetricsError;
pub use kelly::{compute_kelly_fraction, compute_kelly_inputs, KellyFraction, KellyMode};
pub use returns::{annualized_return, cagr, total_return};
pub use risk_adjusted::{calmar_ratio, information_ratio, sharpe_ratio, sortino_ratio};
pub use rolling::RollingWindow;
pub use trading::{avg_loss, avg_win, expectancy, profit_factor, win_rate};
