investing-algorithm-framework 8.10.0__tar.gz → 9.0.0a2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/PKG-INFO +106 -75
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/README.md +105 -74
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/__init__.py +153 -37
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/analysis/__init__.py +42 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/analysis/backtest_data_ranges.py +287 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/analysis/backtest_window_analysis.py +244 -81
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/analysis/bundle_inspection.py +124 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/analysis/markdown.py +1242 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/analysis/ranking.py +92 -12
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/analysis/robustness.py +173 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/analysis/top_selection.py +130 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/algorithm/algorithm_factory.py +13 -4
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/app.py +1460 -147
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/context.py +297 -17
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/eventloop.py +118 -208
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/ascii.py +6 -4
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/backtest_report.py +142 -23
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/templates/dashboard.css +2 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/templates/dashboard.js +25 -6
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/strategy.py +390 -537
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/task.py +16 -10
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/controllers/__init__.py +5 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/web/controllers/backtest_results.py +133 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/web/schemas/__init__.py +25 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/web/schemas/backtest_result.py +108 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/cli.py +25 -4
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/index_command.py +286 -17
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/initialize_app.py +1 -1
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/mcp_server.py +37 -12
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/validate_backtest_checkpoints.py +7 -3
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/dependency_container.py +5 -1
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/__init__.py +36 -5
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/backtesting/__init__.py +97 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/backtesting/backtest.py +1764 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/backtesting/backtest_engine.py +56 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/backtest_index_row.py +17 -1
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/backtest_metrics.py +144 -20
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/backtesting/backtest_permutation_test.py → investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/backtesting/backtest_monte_carlo_test.py +153 -34
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/backtesting/backtest_run.py +776 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/backtest_utils.py +43 -26
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/backtesting/backtest_window.py +268 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/backtesting/bundle.py +1306 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/combine_backtests.py +290 -30
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/backtesting/execution_config.py +163 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/backtesting/study.py +876 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/backtesting/universe.py +75 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/blotter.py +138 -1
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/__init__.py +18 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/models/conflict_policy.py +316 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/order/order.py +63 -9
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/order/order_side.py +7 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/order/order_status.py +13 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/risk_rules/cooldown_rule.py +5 -2
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/risk_rules/trading_cost.py +41 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/models/scheduling/__init__.py +25 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/models/scheduling/date_rule.py +141 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/models/scheduling/schedule.py +165 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/models/scheduling/scheduled_function.py +72 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/models/scheduling/time_rule.py +140 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/models/signal.py +185 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/models/signal_helpers.py +347 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/models/signal_series.py +107 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/domain/models/strategy_profile.py +50 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/trade/trade.py +93 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/trade/trade_stop_loss.py +41 -2
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/trade/trade_take_profit.py +71 -1
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/pipeline/__init__.py +1 -1
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/pipeline/factor.py +2 -2
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/pipeline/pipeline.py +65 -1
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +41 -1
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/trades/trade.py +47 -2
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/trades/trade_stop_loss.py +1 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/trades/trade_take_profit.py +1 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/trade_allocation_repository.py +2 -3
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/services/backtesting/backtest_service.py +362 -134
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/services/backtesting/event_backtest_service.py +27 -32
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/services/backtesting/vector_backtest_service.py +586 -43
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/notebook/magic.py +2 -3
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/__init__.py +9 -2
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/backtest_index/sqlite_index.py +302 -23
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/backtest_store/__init__.py +3 -3
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/backtest_store/base.py +1 -1
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/backtest_store/decompose.py +8 -4
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/backtest_store/local_dir_store.py +14 -11
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/backtest_store/local_tiered_store.py +20 -17
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/executors/__init__.py +29 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/executors/base.py +126 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/executors/limit.py +58 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/executors/market.py +58 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/__init__.py +11 -2
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/metrics/consistency.py +137 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/generate.py +156 -62
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/metrics/mae_mfe.py +95 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/metrics/omega_ratio.py +58 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/returns.py +11 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/trades.py +32 -1
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/metrics/ulcer.py +55 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/order_service/order_backtest_service.py +27 -4
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/order_service/order_service.py +1606 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/positions/position_service.py +142 -17
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/__init__.py +55 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/apply_risk_budget.py +93 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/attach_risk_rules.py +89 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/base.py +49 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/collect_signals.py +126 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/default.py +48 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/emit_orders.py +83 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/evaluate_pipelines.py +210 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/phase_state.py +168 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/record_cooldown.py +179 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/resolve_conflicts.py +228 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/strategy_phases/size_positions.py +298 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/trade_hooks/__init__.py +6 -0
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/services/trade_hooks/trade_hook_dispatcher.py +114 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/trade_order_evaluator/backtest_trade_oder_evaluator.py +26 -44
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/trade_order_evaluator/trade_order_evaluator.py +38 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/trade_service/trade_service.py +418 -102
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/trade_service/trade_stop_loss_service.py +1 -1
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/pyproject.toml +2 -1
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/analysis/__init__.py +0 -22
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/analysis/backtest_data_ranges.py +0 -202
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/analysis/markdown.py +0 -91
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/web/schemas/__init__.py +0 -12
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/backtesting/__init__.py +0 -49
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/backtesting/backtest.py +0 -866
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/backtesting/backtest_run.py +0 -828
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/backtesting/bundle.py +0 -772
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/models/strategy_profile.py +0 -33
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/metrics/consistency.py +0 -13
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/metrics/ulcer.py +0 -0
- investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/order_service/order_service.py +0 -880
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/LICENSE +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/algorithm/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/algorithm/algorithm.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/app_hook.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/backtest_report_old.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/charts/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/charts/equity_curve.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/charts/line_chart.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/charts/monthly_returns_heatmap.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/generate.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/tables/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/tables/key_metrics_table.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/tables/stop_loss_table.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/tables/time_metrics_table.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/tables/trade_metrics_table.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/tables/trades_table.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/tables/utils.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/templates/dashboard_template.html.j2 +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/reporting/templates/report_template.html.j2 +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/controllers/orders.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/controllers/positions.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/create_app.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/error_handler.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/responses.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/schemas/order.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/app/web/setup_cors.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/deploy_to_aws_lambda.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/deploy_to_azure_function.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/migrate_store_command.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/.gitignore.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/app.py.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/app_aws_lambda_function.py.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/app_azure_function.py.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/app_web.py.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/aws_lambda_dockerfile.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/aws_lambda_dockerignore.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/aws_lambda_readme.md.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/aws_lambda_requirements.txt.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/azure_function_function_app.py.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/azure_function_host.json.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/azure_function_local.settings.json.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/azure_function_requirements.txt.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/data_providers.py.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/env.example.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/env_azure_function.example.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/market_data_providers.py.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/readme.md.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/requirements.txt.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/run_backtest.py.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/cli/templates/strategy.py.template +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/create_app.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/algorithm_id.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/backtest_date_range.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/backtest_evaluation_focuss.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/backtest_summary_metrics.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/consistency.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/templates/backtest.html +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/templates/finterion-dark.png +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/backtesting/templates/finterion-light.png +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/config.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/constants.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/data_provider.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/data_structures.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/datetime_parsing.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/exceptions.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/fx.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/app_mode.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/base_model.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/data/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/data/data_source.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/data/data_type.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/event.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/market/market_credential.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/order/order_type.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/portfolio/sync.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/position/position.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/position/position_size.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/risk_rules/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/risk_rules/scaling_rule.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/risk_rules/stop_loss_rule.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/risk_rules/take_profit_rule.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/snapshot_interval.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/time_frame.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/tracing/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/tracing/trace.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/trade/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/models/trade/trade_status.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/order_executor.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/pipeline/custom_factor.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/pipeline/factors/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/pipeline/factors/builtin.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/pipeline/filter.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/portfolio_provider.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/services/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/services/rounding_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/services/state_handler.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/strategy.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/utils/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/utils/csv.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/utils/custom_tqdm.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/utils/dates.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/utils/jupyter_notebook_detection.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/utils/polars.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/utils/random.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/download_data.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/alpha_vantage.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/base_url.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/ccxt.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/csv.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/csv_url.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/json_url.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/ohlcv_base.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/pandas.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/parquet_url.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/polygon.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/data_providers/yahoo.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/order/order.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/order/trade_allocation.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/order_trade_association.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/portfolio/sql_portfolio.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/position/position.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/models/trades/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/order_executors/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/order_executors/ccxt_order_executor.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/portfolio_providers/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/portfolio_providers/ccxt_portfolio_provider.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/repository.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/trade_repository.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/trade_stop_loss_repository.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/repositories/trade_take_profit_repository.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/services/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/services/aws/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/services/aws/state_handler.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/services/azure/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/services/azure/state_handler.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/services/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/infrastructure/services/backtesting/checkpoint_manifest.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/notebook/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/backtest_index/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/configuration_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/data_providers/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/data_providers/data.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/data_providers/data_provider_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/_returns_helper.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/alpha.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/beta.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/cagr.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/calmar_ratio.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/drawdown.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/equity_curve.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/exposure.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/mean_daily_return.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/price_efficiency.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/profit_factor.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/recovery.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/risk_free_rate.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/sharpe_ratio.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/sortino_ratio.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/standard_deviation.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/treynor_ratio.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/value_at_risk.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/volatility.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/metrics/win_rate.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/order_service/order_executor_lookup.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/pipeline/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/pipeline/pipeline_engine.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/pipeline/vector_pipeline_engine.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/portfolios/backtest_portfolio_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/portfolios/broker_balance_tracker.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/portfolios/portfolio_configuration_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/portfolios/portfolio_provider_lookup.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/portfolios/portfolio_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/portfolios/portfolio_snapshot_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/positions/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/positions/position_snapshot_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/repository_service.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/trade_order_evaluator/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/trade_order_evaluator/default_trade_order_evaluator.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/trade_service/__init__.py +0 -0
- {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0a2}/investing_algorithm_framework/services/trade_service/trade_take_profit_service.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: investing-algorithm-framework
|
|
3
|
-
Version:
|
|
3
|
+
Version: 9.0.0a2
|
|
4
4
|
Summary: A framework for creating trading bots
|
|
5
5
|
Author: MDUYN
|
|
6
6
|
Requires-Python: >=3.10,<4.0
|
|
@@ -103,37 +103,63 @@ Description-Content-Type: text/markdown
|
|
|
103
103
|
|
|
104
104
|
## Introduction
|
|
105
105
|
|
|
106
|
+
> **v9.0.0 alpha is out!** The pre-release of v9.0 is now available on
|
|
107
|
+
> PyPI as an alpha pre-release. Since pip doesn't install pre-releases by
|
|
108
|
+
> default, pin the version explicitly or pass `--pre`:
|
|
109
|
+
> ```bash
|
|
110
|
+
> pip install investing-algorithm-framework==9.0.0a2
|
|
111
|
+
> ```
|
|
112
|
+
> You can find the blog post here: [v9.0 Release](docusaurus/blog/2026-08-02-v9.0-release.md).
|
|
113
|
+
|
|
106
114
|
`Investing Algorithm Framework` is a Python framework that covers the entire quant workflow: define a strategy once, vector-backtest thousands of parameter variants to find promising signals, narrow down with a storage layer that ranks 10k+ results in milliseconds, validate the winners in a realistic event-driven simulation, compare everything in a single interactive HTML dashboard, and deploy the best performer live, all with the same `TradingStrategy` class, no code rewrites between stages.
|
|
107
115
|
|
|
108
116
|
Most quant frameworks stop at "here's your backtest result." You get a number, maybe a chart, and then you're on your own figuring out which strategy variant is actually better, whether the result is robust across time windows, and how to go from research to production. This framework closes that gap.
|
|
109
117
|
|
|
110
118
|
> **Want to see this in practice?** Check out the [`examples/tutorial/`](examples/tutorial/README.md): a series of runnable notebooks that walk you through every stage: defining a strategy, visualizing its signals, sweeping parameters across rolling windows, detecting overfitting with Monte Carlo permutation tests, filtering and ranking with the storage layer, and deploying the winner.
|
|
111
119
|
|
|
120
|
+
<details open>
|
|
121
|
+
<summary>
|
|
122
|
+
<strong>What's New in v9.0</strong>
|
|
123
|
+
</summary> <br>
|
|
124
|
+
|
|
125
|
+
Full details: [v9.0 release notes](docusaurus/blog/2026-08-02-v9.0-release.md) · [CHANGELOG](CHANGELOG.md) · [OBTF spec](https://github.com/Quant-Commons/Open-Backtest-Format)
|
|
126
|
+
|
|
127
|
+
- **New Open Backtest Format (.OBTF)**: OBTF packs studies, universes, windows, vector/event runs, summaries, metrics, trades, orders, positions, snapshots, execution assumptions and Monte Carlo tests into a single versioned `.obtf` file per algorithm (zstd + MessagePack + Parquet under the hood), so your results are portable, future-proof, and never scattered across folders again.
|
|
128
|
+
- **Dual engine native**: vector and event engines now run as first-class citizens of every backtest, so you can sweep thousands of signal ideas and validate the winners under realistic execution *in the same bundle*, with zero risk of one engine's save wiping out the other's results. Now a .obtf bundle is a complete record of your vector and event backtests of a single strategy.
|
|
129
|
+
- **Short and Long Signals support**: a couple of new methods (`generate_short_signals` / `generate_cover_signals`) are all it takes to unlock full short-selling: SHORT/COVER order routing, correct P&L and collateral handling, and fill-based trade creation across vector, event, and live trading.
|
|
130
|
+
- **Enhanced Study definitions**: reusable `Study`, `Universe` and `BacktestWindow` building blocks give you rolling, anchored, holdout and walk-forward k-fold validation, cross-sectional pipelines, signal cooldowns, and Monte Carlo–backed ranking, so you can trust your edge before you trade it.
|
|
131
|
+
- **Custom commision nd slippage models*: pluggable slippage and commission models (percentage, fixed, bps, volume-aware) snapshot every study's cost assumptions via `ExecutionConfig` and attribute fees down to the order and trade level, so your numbers hold up in the real world.
|
|
132
|
+
- **State of the art backtest storage and indexings**: a swappable `BacktestStore`, SQLite indexing across engines, studies, universes and lineage, content-addressed OHLCV deduplication, and a full `iaf` CLI for migrating, indexing, ranking and pruning results, so a growing research pipeline never becomes a mess.
|
|
133
|
+
- **See more, faster**: an expanded metrics suite (CAGR, Sharpe, Sortino, Calmar, VaR/CVaR, drawdown/recovery, benchmark comparisons) paired with per-engine, per-study HTML reports and pooled or per-universe summaries, so you spot the winning strategy at a glance.
|
|
134
|
+
- **Portfolio sync operations**: recurring or one-off per-market deposit schedules, environment-based credential resolution make it easier to manage live portfolios.
|
|
135
|
+
|
|
136
|
+
> ⚠️ **v9.0 is an alpha release** with breaking API and persisted-data changes from v8. Legacy readers and selected compatibility properties remain available to assist migration, but new output is written in the v9 OBTF model — validate strategy behavior, execution assumptions and stored backtests before adopting in production.
|
|
137
|
+
|
|
138
|
+
</details>
|
|
139
|
+
|
|
112
140
|
<details open>
|
|
113
141
|
<summary>
|
|
114
142
|
<strong>Features</strong>
|
|
115
143
|
</summary> <br>
|
|
116
144
|
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
- 📉 **[Benchmark Comparison](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)
|
|
129
|
-
- 📄 **[One-Click HTML Report](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
- � **[Per-Market Deposit Schedules & Portfolio Sync](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/portfolio-sync)** — Declare recurring or one-shot external cash flows on a market with `deposit_schedule=` / `auto_sync=True`. Backtests simulate the deposits; live mode reconciles with the broker — same `context.sync_portfolio()` API in both modes.
|
|
145
|
+
- 🔁 **Long & Short signals support for Live trading & Backtesting**: Build strategies as a pipeline of entry/exit signals, position sizing, and order generation, each independently overridable. Long-only by default; opt into shorts by overriding two methods. The same strategy class runs unchanged in vector backtests, event-driven backtests, and live.
|
|
146
|
+
- 🗂️ **Open Backtest Format storage** — One `{algorithm_id}.ofbt` per algorithm holds every study (in-sample sweep, time-OOS, universe-OOS, walk-forward, stress test) as a first-class slot with its own universe, windows, engine runs and summary. See [Open-Backtest-Format](https://github.com/Quant-Commons/Open-Backtest-Format) for the reference spec.
|
|
147
|
+
- 📊 **[30+ Metrics](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/metrics)**: CAGR, Sharpe, Sortino, Calmar, VaR, CVaR, Max DD, Recovery & more
|
|
148
|
+
- 🧮 **[Cross-Sectional Pipelines](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/pipelines)**: Rank, filter and score entire universes of symbols every iteration with a tidy factor table
|
|
149
|
+
- ⚡ **[Vector Backtesting for Signal Analysis](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/vector-backtesting)**: Quickly test your strategy logic on historical data to see how signals would have behaved before committing to full event-driven backtests
|
|
150
|
+
- 🏃 **[Event-Driven Backtesting](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/event-backtesting)**: Once promising strategies are identified via vector backtests, run full event-driven backtests to simulate realistic execution and portfolio management
|
|
151
|
+
- 🔀 **[Permutation Testing / Monte Carlo Simulations](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Assess the statistical robustness of your strategies by running them across randomized market scenarios to see how often your results could occur by chance
|
|
152
|
+
- 🚀 **[Deployment](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/deployment)**: Once the best strategy is identified through backtesting and comparison, deploy it to production locally or in the cloud (AWS Lambda / Azure Functions) to start live trading
|
|
153
|
+
- ⚔️ **[Multi-Strategy Comparison](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Rank, filter & compare strategies in a single interactive report
|
|
154
|
+
- 🪟 **[Multi-Window Robustness](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Test across different time periods with window coverage analysis
|
|
155
|
+
- 📈 **[Charts & Performance Analysis](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Equity curves, rolling Sharpe, drawdown & return distributions, monthly heatmaps, yearly returns, and good/average/bad/very-bad return scenario projections — all rendered side-by-side per strategy
|
|
156
|
+
- 📉 **[Benchmark Comparison](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Beat-rate analysis vs Buy & Hold, DCA, risk-free & custom benchmarks
|
|
157
|
+
- 📄 **[One-Click HTML Report](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Self-contained file, no server, dark & light theme, shareable
|
|
158
|
+
- 🗄️ **[Tiered Backtest Storage Layer](examples/storage_layer_demo/README.md)**: Manage thousands of `.obtf` bundles with a Tier-1 SQLite index (sub-100 ms ranks/filters over 10k+ backtests), a swappable `BacktestStore` protocol (`LocalDirStore`, `LocalTieredStore`), content-addressed Tier-3 OHLCV deduplication, and a CLI (`iaf index` / `iaf list` / `iaf rank` / `iaf migrate-store`) that plugs straight into the HTML dashboard.
|
|
159
|
+
- 🌐 **[Load External Data](https://coding-kitties.github.io/investing-algorithm-framework/Data/external-data)**: Fetch CSV, JSON, or Parquet from any URL with caching and auto-refresh
|
|
160
|
+
- 🪙 **[Per-Market Deposit Schedules & Portfolio Sync](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/portfolio-sync)**: Declare recurring or one-shot external cash flows on a market with `deposit_schedule=` / `auto_sync=True`. Backtests simulate the deposits; live mode reconciles with the broker — same `context.sync_portfolio()` API in both modes.
|
|
134
161
|
- 📝 **[Record Custom Variables](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/recording-variables)** — Track any indicator or metric during backtests with `context.record()`
|
|
135
162
|
- ⏱️ **Signal Cooldowns**: Throttle whipsaw with declarative `CooldownRule`s: per-symbol or portfolio-wide, side-aware (`trigger="sell"`, `blocks="buy"`), enforced identically by the vector and event-driven engines
|
|
136
|
-
- 🚀 **[Build → Backtest → Deploy](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/application-setup)** — Local dev, cloud deploy (AWS / Azure), or monetize on Finterion
|
|
137
163
|
|
|
138
164
|
</details>
|
|
139
165
|
|
|
@@ -163,6 +189,7 @@ from investing_algorithm_framework import (
|
|
|
163
189
|
TakeProfitRule,
|
|
164
190
|
CooldownRule,
|
|
165
191
|
TradingCost,
|
|
192
|
+
SignalSide,
|
|
166
193
|
)
|
|
167
194
|
|
|
168
195
|
|
|
@@ -207,11 +234,17 @@ class MyStrategy(TradingStrategy):
|
|
|
207
234
|
TradingCost(symbol="ETH", fee_percentage=0.1),
|
|
208
235
|
]
|
|
209
236
|
|
|
210
|
-
def
|
|
237
|
+
def generate_signals(self, context, data):
|
|
238
|
+
"""Event-mode entry point — live, paper trading, event backtests."""
|
|
211
239
|
...
|
|
240
|
+
# yield Signal(symbol="BTC", side=SignalSide.OPEN_LONG, source="my_rule")
|
|
241
|
+
# yield Signal(symbol="BTC", side=SignalSide.CLOSE_LONG, source="my_rule")
|
|
242
|
+
# Optional — short selling is opt-in: also yield OPEN_SHORT / CLOSE_SHORT.
|
|
212
243
|
|
|
213
|
-
def
|
|
244
|
+
def generate_signal_series(self, data):
|
|
245
|
+
"""Vector-mode entry point — only needed for vector backtests."""
|
|
214
246
|
...
|
|
247
|
+
# yield SignalSeries(symbol="BTC", side=SignalSide.OPEN_LONG, series=entry_series)
|
|
215
248
|
```
|
|
216
249
|
|
|
217
250
|
→ [Strategy docs](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/strategies)
|
|
@@ -282,7 +315,7 @@ Every backtest produces a **self-contained HTML dashboard** — open it in any b
|
|
|
282
315
|
</a>
|
|
283
316
|
</p>
|
|
284
317
|
|
|
285
|
-
Every backtest API — vector or event-driven — returns the same `Backtest` object, which the `BacktestReport` consumes directly. So whether you're iterating over an in-memory list or a folder of persisted `.
|
|
318
|
+
Every backtest API — vector or event-driven — returns the same `Backtest` object, which the `BacktestReport` consumes directly. So whether you're iterating over an in-memory list or a folder of persisted `.obtf` bundles, the path to the dashboard is the same:
|
|
286
319
|
|
|
287
320
|
```python
|
|
288
321
|
from investing_algorithm_framework import BacktestReport
|
|
@@ -296,7 +329,7 @@ backtests = app.run_vector_backtests(
|
|
|
296
329
|
strategies=[StrategyA(), StrategyB(), StrategyC()],
|
|
297
330
|
backtest_date_ranges=[range_2022, range_2023, range_2024],
|
|
298
331
|
n_workers=-1,
|
|
299
|
-
backtest_storage_directory="./my-backtests/", # persists .
|
|
332
|
+
backtest_storage_directory="./my-backtests/", # persists .obtf bundles
|
|
300
333
|
show_progress=True,
|
|
301
334
|
)
|
|
302
335
|
BacktestReport(backtests=backtests).save("sweep_report.html")
|
|
@@ -349,9 +382,9 @@ BacktestReport(backtests=winners).save("top25_by_sharpe.html")
|
|
|
349
382
|
<strong>Backtest Storage Layer — scale to thousands of backtests</strong>
|
|
350
383
|
</summary> <br>
|
|
351
384
|
|
|
352
|
-
Once you start sweeping parameter grids and walk-forward windows, a flat folder of `.
|
|
385
|
+
Once you start sweeping parameter grids and walk-forward windows, a flat folder of `.obtf` bundles stops scaling: every comparison re-decodes multi-MB Parquet metric blobs just to read a Sharpe number. The storage layer fixes that with three tiers behind a single `BacktestStore` protocol:
|
|
353
386
|
|
|
354
|
-
- **Tier-1 — SQLite index (`index.sqlite`)**: one row per bundle with every scalar from `BacktestSummaryMetrics` promoted to its own column. Ranking 10k+ bundles becomes a sub-100 ms SQL query — no `.
|
|
387
|
+
- **Tier-1 — SQLite index (`index.sqlite`)**: one row per bundle with every scalar from `BacktestSummaryMetrics` promoted to its own column. Ranking 10k+ bundles becomes a sub-100 ms SQL query — no `.obtf` is opened.
|
|
355
388
|
- **Tier-2 — `BacktestStore` adapters**: `LocalDirStore` (flat folder of bundles) or `LocalTieredStore` (hive-partitioned layout). Same handle-based API, swap the implementation without touching call sites.
|
|
356
389
|
- **Tier-3 — content-addressed OHLCV chunks**: SHA-256 deduped per-symbol OHLCV blobs shared across every bundle that references them. `garbage_collect_ohlcv()` reclaims orphans.
|
|
357
390
|
|
|
@@ -368,7 +401,7 @@ from investing_algorithm_framework.services.backtest_store import (
|
|
|
368
401
|
LocalDirStore,
|
|
369
402
|
)
|
|
370
403
|
|
|
371
|
-
# 1. Build (or refresh) the Tier-1 SQLite index over a folder of .
|
|
404
|
+
# 1. Build (or refresh) the Tier-1 SQLite index over a folder of .obtf bundles.
|
|
372
405
|
build_index("./my-backtests/") # equivalent to: iaf index ./my-backtests/
|
|
373
406
|
|
|
374
407
|
# 2. Pick the top 20 by Sharpe straight from SQLite — no Parquet decoded.
|
|
@@ -534,8 +567,9 @@ import pandas as pd
|
|
|
534
567
|
from pyindicators import ema, rsi, crossover, crossunder
|
|
535
568
|
|
|
536
569
|
from investing_algorithm_framework import (
|
|
537
|
-
TradingStrategy, DataSource, TimeUnit, DataType,
|
|
570
|
+
TradingStrategy, DataSource, TimeUnit, Schedule, DataType,
|
|
538
571
|
PositionSize, ScalingRule, StopLossRule, CooldownRule,
|
|
572
|
+
SignalSide, signals_from_column, signal_series_from_column,
|
|
539
573
|
)
|
|
540
574
|
|
|
541
575
|
|
|
@@ -547,8 +581,7 @@ class RSIEMACrossoverStrategy(TradingStrategy):
|
|
|
547
581
|
Sell when RSI is overbought AND a recent EMA crossunder occurred.
|
|
548
582
|
Scale into winners, trail a stop loss, and let the framework handle the rest.
|
|
549
583
|
"""
|
|
550
|
-
|
|
551
|
-
interval = 2
|
|
584
|
+
schedule = Schedule.every(2, TimeUnit.HOUR)
|
|
552
585
|
symbols = ["BTC", "ETH"]
|
|
553
586
|
data_sources = [
|
|
554
587
|
DataSource(
|
|
@@ -601,57 +634,54 @@ class RSIEMACrossoverStrategy(TradingStrategy):
|
|
|
601
634
|
CooldownRule(trigger="any", blocks="any", bars=2),
|
|
602
635
|
]
|
|
603
636
|
|
|
604
|
-
def
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
637
|
+
def _add_signal_columns(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
638
|
+
df = ema(df, period=12, source_column="Close",
|
|
639
|
+
result_column="ema_short")
|
|
640
|
+
df = ema(df, period=26, source_column="Close",
|
|
641
|
+
result_column="ema_long")
|
|
642
|
+
df = crossover(df, first_column="ema_short",
|
|
643
|
+
second_column="ema_long",
|
|
644
|
+
result_column="ema_crossover")
|
|
645
|
+
df = crossunder(df, first_column="ema_short",
|
|
646
|
+
second_column="ema_long",
|
|
647
|
+
result_column="ema_crossunder")
|
|
648
|
+
df = rsi(df, period=14, source_column="Close", result_column="rsi")
|
|
649
|
+
|
|
650
|
+
df["entry"] = (
|
|
651
|
+
(df["rsi"] < 30)
|
|
652
|
+
& (df["ema_crossover"].rolling(window=10).max() > 0)
|
|
653
|
+
).fillna(False)
|
|
654
|
+
df["exit"] = (
|
|
655
|
+
(df["rsi"] >= 70)
|
|
656
|
+
& (df["ema_crossunder"].rolling(window=10).max() > 0)
|
|
657
|
+
).fillna(False)
|
|
658
|
+
return df
|
|
659
|
+
|
|
660
|
+
def generate_signals(self, context, data: Dict[str, Any]):
|
|
661
|
+
"""Event-mode entry point — live, paper trading, event backtests."""
|
|
609
662
|
for symbol in self.symbols:
|
|
610
|
-
df = data[f"{symbol}_ohlcv"]
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
result_column="ema_crossover")
|
|
619
|
-
rsi_data = rsi(df, period=14, source_column="Close",
|
|
620
|
-
result_column="rsi")
|
|
621
|
-
|
|
622
|
-
rsi_oversold = rsi_data["rsi"] < 30
|
|
623
|
-
recent_crossover = (
|
|
624
|
-
ema_cross["ema_crossover"].rolling(window=10).max() > 0
|
|
663
|
+
df = self._add_signal_columns(data[f"{symbol}_ohlcv"])
|
|
664
|
+
yield from signals_from_column(
|
|
665
|
+
df, "entry", side=SignalSide.OPEN_LONG, symbol=symbol,
|
|
666
|
+
source="rsi_ema_crossover",
|
|
667
|
+
)
|
|
668
|
+
yield from signals_from_column(
|
|
669
|
+
df, "exit", side=SignalSide.CLOSE_LONG, symbol=symbol,
|
|
670
|
+
source="rsi_ema_crossover",
|
|
625
671
|
)
|
|
626
|
-
signals[symbol] = (rsi_oversold & recent_crossover).fillna(False)
|
|
627
|
-
|
|
628
|
-
return signals
|
|
629
|
-
|
|
630
|
-
def generate_sell_signals(
|
|
631
|
-
self, data: Dict[str, Any]
|
|
632
|
-
) -> Dict[str, pd.Series]:
|
|
633
|
-
signals = {}
|
|
634
672
|
|
|
673
|
+
def generate_signal_series(self, data: Dict[str, Any]):
|
|
674
|
+
"""Vector-mode entry point — only needed for vector backtests."""
|
|
635
675
|
for symbol in self.symbols:
|
|
636
|
-
df = data[f"{symbol}_ohlcv"]
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
result_column="ema_crossunder")
|
|
645
|
-
rsi_data = rsi(df, period=14, source_column="Close",
|
|
646
|
-
result_column="rsi")
|
|
647
|
-
|
|
648
|
-
rsi_overbought = rsi_data["rsi"] >= 70
|
|
649
|
-
recent_crossunder = (
|
|
650
|
-
ema_cross["ema_crossunder"].rolling(window=10).max() > 0
|
|
676
|
+
df = self._add_signal_columns(data[f"{symbol}_ohlcv"])
|
|
677
|
+
yield signal_series_from_column(
|
|
678
|
+
df, "entry", side=SignalSide.OPEN_LONG, symbol=symbol,
|
|
679
|
+
source="rsi_ema_crossover",
|
|
680
|
+
)
|
|
681
|
+
yield signal_series_from_column(
|
|
682
|
+
df, "exit", side=SignalSide.CLOSE_LONG, symbol=symbol,
|
|
683
|
+
source="rsi_ema_crossover",
|
|
651
684
|
)
|
|
652
|
-
signals[symbol] = (rsi_overbought & recent_crossunder).fillna(False)
|
|
653
|
-
|
|
654
|
-
return signals
|
|
655
685
|
```
|
|
656
686
|
|
|
657
687
|
Create as many strategy variants as you want — different parameters, different indicators, different symbols — then backtest them all and compare in a single report.
|
|
@@ -750,6 +780,7 @@ python -m unittest discover -s tests
|
|
|
750
780
|
|
|
751
781
|
- [Open an issue](https://github.com/coding-kitties/investing-algorithm-framework/issues/new) for bugs or ideas
|
|
752
782
|
- Read the [Contributing Guide](https://coding-kitties.github.io/investing-algorithm-framework/Contributing%20Guide/contributing)
|
|
783
|
+
- Read the [Architecture references](/docs/architecture/README.md)
|
|
753
784
|
- PRs go against the `dev` branch
|
|
754
785
|
|
|
755
786
|
## Resources
|
|
@@ -59,37 +59,63 @@
|
|
|
59
59
|
|
|
60
60
|
## Introduction
|
|
61
61
|
|
|
62
|
+
> **v9.0.0 alpha is out!** The pre-release of v9.0 is now available on
|
|
63
|
+
> PyPI as an alpha pre-release. Since pip doesn't install pre-releases by
|
|
64
|
+
> default, pin the version explicitly or pass `--pre`:
|
|
65
|
+
> ```bash
|
|
66
|
+
> pip install investing-algorithm-framework==9.0.0a2
|
|
67
|
+
> ```
|
|
68
|
+
> You can find the blog post here: [v9.0 Release](docusaurus/blog/2026-08-02-v9.0-release.md).
|
|
69
|
+
|
|
62
70
|
`Investing Algorithm Framework` is a Python framework that covers the entire quant workflow: define a strategy once, vector-backtest thousands of parameter variants to find promising signals, narrow down with a storage layer that ranks 10k+ results in milliseconds, validate the winners in a realistic event-driven simulation, compare everything in a single interactive HTML dashboard, and deploy the best performer live, all with the same `TradingStrategy` class, no code rewrites between stages.
|
|
63
71
|
|
|
64
72
|
Most quant frameworks stop at "here's your backtest result." You get a number, maybe a chart, and then you're on your own figuring out which strategy variant is actually better, whether the result is robust across time windows, and how to go from research to production. This framework closes that gap.
|
|
65
73
|
|
|
66
74
|
> **Want to see this in practice?** Check out the [`examples/tutorial/`](examples/tutorial/README.md): a series of runnable notebooks that walk you through every stage: defining a strategy, visualizing its signals, sweeping parameters across rolling windows, detecting overfitting with Monte Carlo permutation tests, filtering and ranking with the storage layer, and deploying the winner.
|
|
67
75
|
|
|
76
|
+
<details open>
|
|
77
|
+
<summary>
|
|
78
|
+
<strong>What's New in v9.0</strong>
|
|
79
|
+
</summary> <br>
|
|
80
|
+
|
|
81
|
+
Full details: [v9.0 release notes](docusaurus/blog/2026-08-02-v9.0-release.md) · [CHANGELOG](CHANGELOG.md) · [OBTF spec](https://github.com/Quant-Commons/Open-Backtest-Format)
|
|
82
|
+
|
|
83
|
+
- **New Open Backtest Format (.OBTF)**: OBTF packs studies, universes, windows, vector/event runs, summaries, metrics, trades, orders, positions, snapshots, execution assumptions and Monte Carlo tests into a single versioned `.obtf` file per algorithm (zstd + MessagePack + Parquet under the hood), so your results are portable, future-proof, and never scattered across folders again.
|
|
84
|
+
- **Dual engine native**: vector and event engines now run as first-class citizens of every backtest, so you can sweep thousands of signal ideas and validate the winners under realistic execution *in the same bundle*, with zero risk of one engine's save wiping out the other's results. Now a .obtf bundle is a complete record of your vector and event backtests of a single strategy.
|
|
85
|
+
- **Short and Long Signals support**: a couple of new methods (`generate_short_signals` / `generate_cover_signals`) are all it takes to unlock full short-selling: SHORT/COVER order routing, correct P&L and collateral handling, and fill-based trade creation across vector, event, and live trading.
|
|
86
|
+
- **Enhanced Study definitions**: reusable `Study`, `Universe` and `BacktestWindow` building blocks give you rolling, anchored, holdout and walk-forward k-fold validation, cross-sectional pipelines, signal cooldowns, and Monte Carlo–backed ranking, so you can trust your edge before you trade it.
|
|
87
|
+
- **Custom commision nd slippage models*: pluggable slippage and commission models (percentage, fixed, bps, volume-aware) snapshot every study's cost assumptions via `ExecutionConfig` and attribute fees down to the order and trade level, so your numbers hold up in the real world.
|
|
88
|
+
- **State of the art backtest storage and indexings**: a swappable `BacktestStore`, SQLite indexing across engines, studies, universes and lineage, content-addressed OHLCV deduplication, and a full `iaf` CLI for migrating, indexing, ranking and pruning results, so a growing research pipeline never becomes a mess.
|
|
89
|
+
- **See more, faster**: an expanded metrics suite (CAGR, Sharpe, Sortino, Calmar, VaR/CVaR, drawdown/recovery, benchmark comparisons) paired with per-engine, per-study HTML reports and pooled or per-universe summaries, so you spot the winning strategy at a glance.
|
|
90
|
+
- **Portfolio sync operations**: recurring or one-off per-market deposit schedules, environment-based credential resolution make it easier to manage live portfolios.
|
|
91
|
+
|
|
92
|
+
> ⚠️ **v9.0 is an alpha release** with breaking API and persisted-data changes from v8. Legacy readers and selected compatibility properties remain available to assist migration, but new output is written in the v9 OBTF model — validate strategy behavior, execution assumptions and stored backtests before adopting in production.
|
|
93
|
+
|
|
94
|
+
</details>
|
|
95
|
+
|
|
68
96
|
<details open>
|
|
69
97
|
<summary>
|
|
70
98
|
<strong>Features</strong>
|
|
71
99
|
</summary> <br>
|
|
72
100
|
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
- 📉 **[Benchmark Comparison](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)
|
|
85
|
-
- 📄 **[One-Click HTML Report](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
- � **[Per-Market Deposit Schedules & Portfolio Sync](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/portfolio-sync)** — Declare recurring or one-shot external cash flows on a market with `deposit_schedule=` / `auto_sync=True`. Backtests simulate the deposits; live mode reconciles with the broker — same `context.sync_portfolio()` API in both modes.
|
|
101
|
+
- 🔁 **Long & Short signals support for Live trading & Backtesting**: Build strategies as a pipeline of entry/exit signals, position sizing, and order generation, each independently overridable. Long-only by default; opt into shorts by overriding two methods. The same strategy class runs unchanged in vector backtests, event-driven backtests, and live.
|
|
102
|
+
- 🗂️ **Open Backtest Format storage** — One `{algorithm_id}.ofbt` per algorithm holds every study (in-sample sweep, time-OOS, universe-OOS, walk-forward, stress test) as a first-class slot with its own universe, windows, engine runs and summary. See [Open-Backtest-Format](https://github.com/Quant-Commons/Open-Backtest-Format) for the reference spec.
|
|
103
|
+
- 📊 **[30+ Metrics](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/metrics)**: CAGR, Sharpe, Sortino, Calmar, VaR, CVaR, Max DD, Recovery & more
|
|
104
|
+
- 🧮 **[Cross-Sectional Pipelines](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/pipelines)**: Rank, filter and score entire universes of symbols every iteration with a tidy factor table
|
|
105
|
+
- ⚡ **[Vector Backtesting for Signal Analysis](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/vector-backtesting)**: Quickly test your strategy logic on historical data to see how signals would have behaved before committing to full event-driven backtests
|
|
106
|
+
- 🏃 **[Event-Driven Backtesting](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/event-backtesting)**: Once promising strategies are identified via vector backtests, run full event-driven backtests to simulate realistic execution and portfolio management
|
|
107
|
+
- 🔀 **[Permutation Testing / Monte Carlo Simulations](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Assess the statistical robustness of your strategies by running them across randomized market scenarios to see how often your results could occur by chance
|
|
108
|
+
- 🚀 **[Deployment](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/deployment)**: Once the best strategy is identified through backtesting and comparison, deploy it to production locally or in the cloud (AWS Lambda / Azure Functions) to start live trading
|
|
109
|
+
- ⚔️ **[Multi-Strategy Comparison](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Rank, filter & compare strategies in a single interactive report
|
|
110
|
+
- 🪟 **[Multi-Window Robustness](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Test across different time periods with window coverage analysis
|
|
111
|
+
- 📈 **[Charts & Performance Analysis](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Equity curves, rolling Sharpe, drawdown & return distributions, monthly heatmaps, yearly returns, and good/average/bad/very-bad return scenario projections — all rendered side-by-side per strategy
|
|
112
|
+
- 📉 **[Benchmark Comparison](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Beat-rate analysis vs Buy & Hold, DCA, risk-free & custom benchmarks
|
|
113
|
+
- 📄 **[One-Click HTML Report](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)**: Self-contained file, no server, dark & light theme, shareable
|
|
114
|
+
- 🗄️ **[Tiered Backtest Storage Layer](examples/storage_layer_demo/README.md)**: Manage thousands of `.obtf` bundles with a Tier-1 SQLite index (sub-100 ms ranks/filters over 10k+ backtests), a swappable `BacktestStore` protocol (`LocalDirStore`, `LocalTieredStore`), content-addressed Tier-3 OHLCV deduplication, and a CLI (`iaf index` / `iaf list` / `iaf rank` / `iaf migrate-store`) that plugs straight into the HTML dashboard.
|
|
115
|
+
- 🌐 **[Load External Data](https://coding-kitties.github.io/investing-algorithm-framework/Data/external-data)**: Fetch CSV, JSON, or Parquet from any URL with caching and auto-refresh
|
|
116
|
+
- 🪙 **[Per-Market Deposit Schedules & Portfolio Sync](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/portfolio-sync)**: Declare recurring or one-shot external cash flows on a market with `deposit_schedule=` / `auto_sync=True`. Backtests simulate the deposits; live mode reconciles with the broker — same `context.sync_portfolio()` API in both modes.
|
|
90
117
|
- 📝 **[Record Custom Variables](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/recording-variables)** — Track any indicator or metric during backtests with `context.record()`
|
|
91
118
|
- ⏱️ **Signal Cooldowns**: Throttle whipsaw with declarative `CooldownRule`s: per-symbol or portfolio-wide, side-aware (`trigger="sell"`, `blocks="buy"`), enforced identically by the vector and event-driven engines
|
|
92
|
-
- 🚀 **[Build → Backtest → Deploy](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/application-setup)** — Local dev, cloud deploy (AWS / Azure), or monetize on Finterion
|
|
93
119
|
|
|
94
120
|
</details>
|
|
95
121
|
|
|
@@ -119,6 +145,7 @@ from investing_algorithm_framework import (
|
|
|
119
145
|
TakeProfitRule,
|
|
120
146
|
CooldownRule,
|
|
121
147
|
TradingCost,
|
|
148
|
+
SignalSide,
|
|
122
149
|
)
|
|
123
150
|
|
|
124
151
|
|
|
@@ -163,11 +190,17 @@ class MyStrategy(TradingStrategy):
|
|
|
163
190
|
TradingCost(symbol="ETH", fee_percentage=0.1),
|
|
164
191
|
]
|
|
165
192
|
|
|
166
|
-
def
|
|
193
|
+
def generate_signals(self, context, data):
|
|
194
|
+
"""Event-mode entry point — live, paper trading, event backtests."""
|
|
167
195
|
...
|
|
196
|
+
# yield Signal(symbol="BTC", side=SignalSide.OPEN_LONG, source="my_rule")
|
|
197
|
+
# yield Signal(symbol="BTC", side=SignalSide.CLOSE_LONG, source="my_rule")
|
|
198
|
+
# Optional — short selling is opt-in: also yield OPEN_SHORT / CLOSE_SHORT.
|
|
168
199
|
|
|
169
|
-
def
|
|
200
|
+
def generate_signal_series(self, data):
|
|
201
|
+
"""Vector-mode entry point — only needed for vector backtests."""
|
|
170
202
|
...
|
|
203
|
+
# yield SignalSeries(symbol="BTC", side=SignalSide.OPEN_LONG, series=entry_series)
|
|
171
204
|
```
|
|
172
205
|
|
|
173
206
|
→ [Strategy docs](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/strategies)
|
|
@@ -238,7 +271,7 @@ Every backtest produces a **self-contained HTML dashboard** — open it in any b
|
|
|
238
271
|
</a>
|
|
239
272
|
</p>
|
|
240
273
|
|
|
241
|
-
Every backtest API — vector or event-driven — returns the same `Backtest` object, which the `BacktestReport` consumes directly. So whether you're iterating over an in-memory list or a folder of persisted `.
|
|
274
|
+
Every backtest API — vector or event-driven — returns the same `Backtest` object, which the `BacktestReport` consumes directly. So whether you're iterating over an in-memory list or a folder of persisted `.obtf` bundles, the path to the dashboard is the same:
|
|
242
275
|
|
|
243
276
|
```python
|
|
244
277
|
from investing_algorithm_framework import BacktestReport
|
|
@@ -252,7 +285,7 @@ backtests = app.run_vector_backtests(
|
|
|
252
285
|
strategies=[StrategyA(), StrategyB(), StrategyC()],
|
|
253
286
|
backtest_date_ranges=[range_2022, range_2023, range_2024],
|
|
254
287
|
n_workers=-1,
|
|
255
|
-
backtest_storage_directory="./my-backtests/", # persists .
|
|
288
|
+
backtest_storage_directory="./my-backtests/", # persists .obtf bundles
|
|
256
289
|
show_progress=True,
|
|
257
290
|
)
|
|
258
291
|
BacktestReport(backtests=backtests).save("sweep_report.html")
|
|
@@ -305,9 +338,9 @@ BacktestReport(backtests=winners).save("top25_by_sharpe.html")
|
|
|
305
338
|
<strong>Backtest Storage Layer — scale to thousands of backtests</strong>
|
|
306
339
|
</summary> <br>
|
|
307
340
|
|
|
308
|
-
Once you start sweeping parameter grids and walk-forward windows, a flat folder of `.
|
|
341
|
+
Once you start sweeping parameter grids and walk-forward windows, a flat folder of `.obtf` bundles stops scaling: every comparison re-decodes multi-MB Parquet metric blobs just to read a Sharpe number. The storage layer fixes that with three tiers behind a single `BacktestStore` protocol:
|
|
309
342
|
|
|
310
|
-
- **Tier-1 — SQLite index (`index.sqlite`)**: one row per bundle with every scalar from `BacktestSummaryMetrics` promoted to its own column. Ranking 10k+ bundles becomes a sub-100 ms SQL query — no `.
|
|
343
|
+
- **Tier-1 — SQLite index (`index.sqlite`)**: one row per bundle with every scalar from `BacktestSummaryMetrics` promoted to its own column. Ranking 10k+ bundles becomes a sub-100 ms SQL query — no `.obtf` is opened.
|
|
311
344
|
- **Tier-2 — `BacktestStore` adapters**: `LocalDirStore` (flat folder of bundles) or `LocalTieredStore` (hive-partitioned layout). Same handle-based API, swap the implementation without touching call sites.
|
|
312
345
|
- **Tier-3 — content-addressed OHLCV chunks**: SHA-256 deduped per-symbol OHLCV blobs shared across every bundle that references them. `garbage_collect_ohlcv()` reclaims orphans.
|
|
313
346
|
|
|
@@ -324,7 +357,7 @@ from investing_algorithm_framework.services.backtest_store import (
|
|
|
324
357
|
LocalDirStore,
|
|
325
358
|
)
|
|
326
359
|
|
|
327
|
-
# 1. Build (or refresh) the Tier-1 SQLite index over a folder of .
|
|
360
|
+
# 1. Build (or refresh) the Tier-1 SQLite index over a folder of .obtf bundles.
|
|
328
361
|
build_index("./my-backtests/") # equivalent to: iaf index ./my-backtests/
|
|
329
362
|
|
|
330
363
|
# 2. Pick the top 20 by Sharpe straight from SQLite — no Parquet decoded.
|
|
@@ -490,8 +523,9 @@ import pandas as pd
|
|
|
490
523
|
from pyindicators import ema, rsi, crossover, crossunder
|
|
491
524
|
|
|
492
525
|
from investing_algorithm_framework import (
|
|
493
|
-
TradingStrategy, DataSource, TimeUnit, DataType,
|
|
526
|
+
TradingStrategy, DataSource, TimeUnit, Schedule, DataType,
|
|
494
527
|
PositionSize, ScalingRule, StopLossRule, CooldownRule,
|
|
528
|
+
SignalSide, signals_from_column, signal_series_from_column,
|
|
495
529
|
)
|
|
496
530
|
|
|
497
531
|
|
|
@@ -503,8 +537,7 @@ class RSIEMACrossoverStrategy(TradingStrategy):
|
|
|
503
537
|
Sell when RSI is overbought AND a recent EMA crossunder occurred.
|
|
504
538
|
Scale into winners, trail a stop loss, and let the framework handle the rest.
|
|
505
539
|
"""
|
|
506
|
-
|
|
507
|
-
interval = 2
|
|
540
|
+
schedule = Schedule.every(2, TimeUnit.HOUR)
|
|
508
541
|
symbols = ["BTC", "ETH"]
|
|
509
542
|
data_sources = [
|
|
510
543
|
DataSource(
|
|
@@ -557,57 +590,54 @@ class RSIEMACrossoverStrategy(TradingStrategy):
|
|
|
557
590
|
CooldownRule(trigger="any", blocks="any", bars=2),
|
|
558
591
|
]
|
|
559
592
|
|
|
560
|
-
def
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
593
|
+
def _add_signal_columns(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
594
|
+
df = ema(df, period=12, source_column="Close",
|
|
595
|
+
result_column="ema_short")
|
|
596
|
+
df = ema(df, period=26, source_column="Close",
|
|
597
|
+
result_column="ema_long")
|
|
598
|
+
df = crossover(df, first_column="ema_short",
|
|
599
|
+
second_column="ema_long",
|
|
600
|
+
result_column="ema_crossover")
|
|
601
|
+
df = crossunder(df, first_column="ema_short",
|
|
602
|
+
second_column="ema_long",
|
|
603
|
+
result_column="ema_crossunder")
|
|
604
|
+
df = rsi(df, period=14, source_column="Close", result_column="rsi")
|
|
605
|
+
|
|
606
|
+
df["entry"] = (
|
|
607
|
+
(df["rsi"] < 30)
|
|
608
|
+
& (df["ema_crossover"].rolling(window=10).max() > 0)
|
|
609
|
+
).fillna(False)
|
|
610
|
+
df["exit"] = (
|
|
611
|
+
(df["rsi"] >= 70)
|
|
612
|
+
& (df["ema_crossunder"].rolling(window=10).max() > 0)
|
|
613
|
+
).fillna(False)
|
|
614
|
+
return df
|
|
615
|
+
|
|
616
|
+
def generate_signals(self, context, data: Dict[str, Any]):
|
|
617
|
+
"""Event-mode entry point — live, paper trading, event backtests."""
|
|
565
618
|
for symbol in self.symbols:
|
|
566
|
-
df = data[f"{symbol}_ohlcv"]
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
result_column="ema_crossover")
|
|
575
|
-
rsi_data = rsi(df, period=14, source_column="Close",
|
|
576
|
-
result_column="rsi")
|
|
577
|
-
|
|
578
|
-
rsi_oversold = rsi_data["rsi"] < 30
|
|
579
|
-
recent_crossover = (
|
|
580
|
-
ema_cross["ema_crossover"].rolling(window=10).max() > 0
|
|
619
|
+
df = self._add_signal_columns(data[f"{symbol}_ohlcv"])
|
|
620
|
+
yield from signals_from_column(
|
|
621
|
+
df, "entry", side=SignalSide.OPEN_LONG, symbol=symbol,
|
|
622
|
+
source="rsi_ema_crossover",
|
|
623
|
+
)
|
|
624
|
+
yield from signals_from_column(
|
|
625
|
+
df, "exit", side=SignalSide.CLOSE_LONG, symbol=symbol,
|
|
626
|
+
source="rsi_ema_crossover",
|
|
581
627
|
)
|
|
582
|
-
signals[symbol] = (rsi_oversold & recent_crossover).fillna(False)
|
|
583
|
-
|
|
584
|
-
return signals
|
|
585
|
-
|
|
586
|
-
def generate_sell_signals(
|
|
587
|
-
self, data: Dict[str, Any]
|
|
588
|
-
) -> Dict[str, pd.Series]:
|
|
589
|
-
signals = {}
|
|
590
628
|
|
|
629
|
+
def generate_signal_series(self, data: Dict[str, Any]):
|
|
630
|
+
"""Vector-mode entry point — only needed for vector backtests."""
|
|
591
631
|
for symbol in self.symbols:
|
|
592
|
-
df = data[f"{symbol}_ohlcv"]
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
result_column="ema_crossunder")
|
|
601
|
-
rsi_data = rsi(df, period=14, source_column="Close",
|
|
602
|
-
result_column="rsi")
|
|
603
|
-
|
|
604
|
-
rsi_overbought = rsi_data["rsi"] >= 70
|
|
605
|
-
recent_crossunder = (
|
|
606
|
-
ema_cross["ema_crossunder"].rolling(window=10).max() > 0
|
|
632
|
+
df = self._add_signal_columns(data[f"{symbol}_ohlcv"])
|
|
633
|
+
yield signal_series_from_column(
|
|
634
|
+
df, "entry", side=SignalSide.OPEN_LONG, symbol=symbol,
|
|
635
|
+
source="rsi_ema_crossover",
|
|
636
|
+
)
|
|
637
|
+
yield signal_series_from_column(
|
|
638
|
+
df, "exit", side=SignalSide.CLOSE_LONG, symbol=symbol,
|
|
639
|
+
source="rsi_ema_crossover",
|
|
607
640
|
)
|
|
608
|
-
signals[symbol] = (rsi_overbought & recent_crossunder).fillna(False)
|
|
609
|
-
|
|
610
|
-
return signals
|
|
611
641
|
```
|
|
612
642
|
|
|
613
643
|
Create as many strategy variants as you want — different parameters, different indicators, different symbols — then backtest them all and compare in a single report.
|
|
@@ -706,6 +736,7 @@ python -m unittest discover -s tests
|
|
|
706
736
|
|
|
707
737
|
- [Open an issue](https://github.com/coding-kitties/investing-algorithm-framework/issues/new) for bugs or ideas
|
|
708
738
|
- Read the [Contributing Guide](https://coding-kitties.github.io/investing-algorithm-framework/Contributing%20Guide/contributing)
|
|
739
|
+
- Read the [Architecture references](/docs/architecture/README.md)
|
|
709
740
|
- PRs go against the `dev` branch
|
|
710
741
|
|
|
711
742
|
## Resources
|