|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
#include <backtest.hpp>
Static Public Member Functions | |
| static std::optional< double > | sharpe (std::span< const double > returns, double risk_free_rate=constants::DEFAULT_RISK_FREE_RATE, double annualisation=constants::ANNUALISATION_FACTOR) noexcept |
| static std::optional< double > | sortino (std::span< const double > returns, double risk_free_rate=constants::DEFAULT_RISK_FREE_RATE, double annualisation=constants::ANNUALISATION_FACTOR) noexcept |
| static std::optional< double > | max_drawdown (std::span< const double > returns) noexcept |
| static std::optional< double > | gamma_weighted_ir (std::span< const double > strategy_returns, std::span< const double > benchmark_returns, std::span< const double > gamma_factors) noexcept |
Stateless utility for computing financial performance metrics.
All methods are static and operate on std::span<const double> for zero-copy access to any contiguous container.
Definition at line 127 of file backtest.hpp.
|
staticnoexcept |
Compute γ-weighted information ratio.
IR_γ = (mean(active_ret) × mean(γ)) / σ(active_ret) where active_ret_t = strategy_ret_t − benchmark_ret_t
The γ factor up-weights the mean active return when signals were generated in high-velocity (high-γ) market regimes.
nullopt if inputs are mismatched in length, too short, or numerically degenerate.
Definition at line 148 of file performance_metrics.cpp.
|
staticnoexcept |
Compute maximum drawdown of an equity curve.
MDD = max over t of { (peak_t − trough_t) / peak_t } where peak_t = max_{s ≤ t} equity_curve[s]
The equity curve is constructed by cumulative-summing the return series.
Maximum drawdown in [0, 1]. Returns nullopt on empty input.
Definition at line 124 of file performance_metrics.cpp.
|
staticnoexcept |
Compute annualised Sharpe ratio.
Sharpe = (mean(R) − r_f) / σ(R) × √ann
nullopt if series has fewer than 2 elements, σ = 0, or any NaN/Inf.
Definition at line 81 of file performance_metrics.cpp.
|
staticnoexcept |
Compute annualised Sortino ratio (downside-deviation denominator).
Sortino = (mean(R) − r_f) / σ_down(R) × √ann
where σ_down is the standard deviation of returns below r_f.
nullopt if series is too short, downside-vol is zero, or any NaN/Inf.
Definition at line 103 of file performance_metrics.cpp.