feat: add backtesting functionality with UI and API endpoints
CI / lint-test-build (push) Successful in 2m31s

- Introduced backtesting page and fragment in the dashboard for running backtests and viewing recent reports.
- Implemented backtest run logic with configuration options including event path, starting balances, trade capital, and fee profiles.
- Added recent backtest reports storage and retrieval.
- Created a new strategy module for statistical arbitrage experiments with validation on configuration parameters.
- Updated settings to include parameters for the statistical arbitrage strategy.
- Enhanced dashboard controls to support the new strategy mode.
- Added unit tests for backtesting functionality and strategy validation.
- Updated templates for backtesting UI integration.
This commit is contained in:
2026-06-02 09:28:22 +02:00
parent f612c8533a
commit 38e1d64437
17 changed files with 1089 additions and 165 deletions
+17
View File
@@ -53,3 +53,20 @@ def test_valid_security_configuration_passes() -> None:
)
assert settings.kraken_api_key_permissions == "query,trade"
def test_stat_arb_entry_zscore_must_exceed_exit_zscore() -> None:
with pytest.raises(ValidationError):
Settings(
_env_file=None,
STRATEGY_STAT_ARB_ENTRY_ZSCORE="0.5",
STRATEGY_STAT_ARB_EXIT_ZSCORE="0.5",
)
def test_stat_arb_lookback_window_must_be_at_least_two() -> None:
with pytest.raises(ValidationError):
Settings(
_env_file=None,
STRATEGY_STAT_ARB_LOOKBACK_WINDOW="1",
)