()
| 25 | |
| 26 | def test_risk_metrics_smoke(): |
| 27 | returns = [-0.02, 0.01, 0.015, -0.01, 0.005] |
| 28 | var_95 = openquant.risk.calculate_value_at_risk(returns, 0.05) |
| 29 | es_95 = openquant.risk.calculate_expected_shortfall(returns, 0.05) |
| 30 | cdar_95 = openquant.risk.calculate_conditional_drawdown_risk(returns, 0.05) |
| 31 | |
| 32 | assert var_95 == pytest.approx(-0.01) |
| 33 | assert es_95 == pytest.approx(-0.02) |
| 34 | assert isinstance(cdar_95, float) |
| 35 | |
| 36 | |
| 37 | def test_filters_indices_and_timestamps(): |
| 38 | close = [100.0, 101.2, 100.8, 102.4, 101.9, 103.1] |
nothing calls this directly
no test coverage detected