investing-algorithm-framework 9.0.0a2__tar.gz → 9.0.0a4__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-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/PKG-INFO +34 -15
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/README.md +22 -5
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/__init__.py +12 -1
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/algorithm_runner.py +236 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/app.py +533 -1779
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/context.py +26 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/eventloop.py +139 -42
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/charts/__init__.py +0 -2
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/reporting/charts/_finterion_render.py +71 -0
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py +54 -0
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/reporting/charts/equity_curve.py +38 -0
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +51 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/charts/monthly_returns_heatmap.py +15 -35
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py +45 -0
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +49 -0
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +40 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/controllers/__init__.py +6 -0
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/web/controllers/algorithm.py +155 -0
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/web/controllers/trades.py +28 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/schemas/__init__.py +3 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/schemas/backtest_result.py +2 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/schemas/order.py +1 -0
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/app/web/schemas/trade.py +21 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/cli.py +9 -3
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/deploy_to_aws_lambda.py +10 -1
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/deploy_to_azure_function.py +16 -4
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/app_aws_lambda_function.py.template +23 -1
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/azure_function_function_app.py.template +43 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/strategy.py.template +43 -14
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/dependency_container.py +5 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/data/data_source.py +12 -19
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/order/order.py +11 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/trade/trade.py +16 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/ccxt.py +315 -260
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/csv.py +8 -1
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/ohlcv_base.py +5 -2
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +5 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/order/order.py +2 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/trades/trade.py +12 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/services/aws/state_handler.py +12 -2
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/services/azure/state_handler.py +4 -1
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/services/backtesting/backtest_service.py +13 -36
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/services/backtesting/event_backtest_service.py +12 -31
- investing_algorithm_framework-9.0.0a4/investing_algorithm_framework/infrastructure/services/backtesting/schedule_generation.py +75 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/services/backtesting/vector_backtest_service.py +2 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/notebook/magic.py +50 -30
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/data_providers/data_provider_service.py +11 -5
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/trade_order_evaluator/backtest_trade_oder_evaluator.py +6 -3
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/trade_order_evaluator/default_trade_order_evaluator.py +7 -2
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/trade_order_evaluator/trade_order_evaluator.py +13 -8
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/trade_service/trade_service.py +6 -2
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/pyproject.toml +15 -13
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/reporting/backtest_report_old.py +0 -352
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py +0 -66
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/reporting/charts/equity_curve.py +0 -37
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +0 -74
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/reporting/charts/line_chart.py +0 -11
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py +0 -51
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +0 -79
- investing_algorithm_framework-9.0.0a2/investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +0 -55
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/LICENSE +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/analysis/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/analysis/backtest_data_ranges.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/analysis/backtest_window_analysis.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/analysis/bundle_inspection.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/analysis/markdown.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/analysis/ranking.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/analysis/robustness.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/analysis/top_selection.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/algorithm/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/algorithm/algorithm.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/algorithm/algorithm_factory.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/app_hook.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/ascii.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/backtest_report.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/generate.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/tables/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/tables/key_metrics_table.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/tables/stop_loss_table.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/tables/time_metrics_table.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/tables/trade_metrics_table.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/tables/trades_table.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/tables/utils.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/templates/dashboard.css +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/templates/dashboard.js +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/templates/dashboard_template.html.j2 +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/reporting/templates/report_template.html.j2 +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/strategy.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/task.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/controllers/backtest_results.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/controllers/orders.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/controllers/positions.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/create_app.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/error_handler.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/responses.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/app/web/setup_cors.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/index_command.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/initialize_app.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/mcp_server.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/migrate_store_command.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/.gitignore.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/app.py.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/app_azure_function.py.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/app_web.py.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/aws_lambda_dockerfile.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/aws_lambda_dockerignore.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/aws_lambda_readme.md.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/aws_lambda_requirements.txt.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/azure_function_host.json.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/azure_function_local.settings.json.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/azure_function_requirements.txt.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/data_providers.py.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/env.example.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/env_azure_function.example.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/market_data_providers.py.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/readme.md.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/requirements.txt.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/templates/run_backtest.py.template +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/cli/validate_backtest_checkpoints.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/create_app.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/algorithm_id.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest_date_range.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest_engine.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest_evaluation_focuss.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest_index_row.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest_metrics.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest_monte_carlo_test.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest_run.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest_summary_metrics.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest_utils.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/backtest_window.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/bundle.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/combine_backtests.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/consistency.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/execution_config.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/study.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/templates/backtest.html +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/templates/finterion-dark.png +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/templates/finterion-light.png +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/backtesting/universe.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/blotter.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/config.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/constants.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/data_provider.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/data_structures.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/datetime_parsing.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/exceptions.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/fx.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/app_mode.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/base_model.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/conflict_policy.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/data/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/data/data_type.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/event.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/market/market_credential.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/order/order_side.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/order/order_status.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/order/order_type.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/portfolio/sync.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/position/position.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/position/position_size.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/risk_rules/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/risk_rules/cooldown_rule.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/risk_rules/scaling_rule.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/risk_rules/stop_loss_rule.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/risk_rules/take_profit_rule.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/risk_rules/trading_cost.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/scheduling/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/scheduling/date_rule.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/scheduling/schedule.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/scheduling/scheduled_function.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/scheduling/time_rule.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/signal.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/signal_helpers.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/signal_series.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/snapshot_interval.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/strategy_profile.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/time_frame.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/tracing/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/tracing/trace.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/trade/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/trade/trade_status.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/trade/trade_stop_loss.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/models/trade/trade_take_profit.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/order_executor.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/pipeline/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/pipeline/custom_factor.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/pipeline/factor.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/pipeline/factors/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/pipeline/factors/builtin.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/pipeline/filter.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/pipeline/pipeline.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/portfolio_provider.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/services/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/services/rounding_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/services/state_handler.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/strategy.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/utils/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/utils/csv.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/utils/custom_tqdm.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/utils/dates.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/utils/jupyter_notebook_detection.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/utils/polars.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/utils/random.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/download_data.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/alpha_vantage.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/base_url.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/csv_url.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/json_url.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/pandas.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/parquet_url.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/polygon.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/data_providers/yahoo.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/order/trade_allocation.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/order_trade_association.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/portfolio/sql_portfolio.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/position/position.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/trades/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/trades/trade_stop_loss.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/models/trades/trade_take_profit.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/order_executors/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/order_executors/ccxt_order_executor.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/portfolio_providers/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/portfolio_providers/ccxt_portfolio_provider.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/repository.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/trade_allocation_repository.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/trade_repository.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/trade_stop_loss_repository.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/repositories/trade_take_profit_repository.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/services/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/services/aws/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/services/azure/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/services/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/infrastructure/services/backtesting/checkpoint_manifest.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/notebook/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/backtest_index/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/backtest_index/sqlite_index.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/backtest_store/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/backtest_store/base.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/backtest_store/decompose.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/backtest_store/local_dir_store.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/backtest_store/local_tiered_store.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/configuration_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/data_providers/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/data_providers/data.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/executors/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/executors/base.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/executors/limit.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/executors/market.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/_returns_helper.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/alpha.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/beta.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/cagr.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/calmar_ratio.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/consistency.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/drawdown.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/equity_curve.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/exposure.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/generate.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/mae_mfe.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/mean_daily_return.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/omega_ratio.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/price_efficiency.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/profit_factor.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/recovery.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/returns.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/risk_free_rate.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/sharpe_ratio.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/sortino_ratio.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/standard_deviation.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/trades.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/treynor_ratio.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/ulcer.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/value_at_risk.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/volatility.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/metrics/win_rate.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/order_service/order_backtest_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/order_service/order_executor_lookup.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/order_service/order_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/pipeline/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/pipeline/pipeline_engine.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/pipeline/vector_pipeline_engine.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/portfolios/backtest_portfolio_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/portfolios/broker_balance_tracker.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/portfolios/portfolio_configuration_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/portfolios/portfolio_provider_lookup.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/portfolios/portfolio_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/portfolios/portfolio_snapshot_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/positions/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/positions/position_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/positions/position_snapshot_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/repository_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/apply_risk_budget.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/attach_risk_rules.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/base.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/collect_signals.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/default.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/emit_orders.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/evaluate_pipelines.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/phase_state.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/record_cooldown.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/resolve_conflicts.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/strategy_phases/size_positions.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/trade_hooks/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/trade_hooks/trade_hook_dispatcher.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/trade_order_evaluator/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/trade_service/__init__.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/investing_algorithm_framework/services/trade_service/trade_stop_loss_service.py +0 -0
- {investing_algorithm_framework-9.0.0a2 → investing_algorithm_framework-9.0.0a4}/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: 9.0.
|
|
3
|
+
Version: 9.0.0a4
|
|
4
4
|
Summary: A framework for creating trading bots
|
|
5
5
|
Author: MDUYN
|
|
6
6
|
Requires-Python: >=3.10,<4.0
|
|
@@ -10,25 +10,27 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
11
|
Provides-Extra: all
|
|
12
12
|
Provides-Extra: alpha-vantage
|
|
13
|
+
Provides-Extra: aws
|
|
14
|
+
Provides-Extra: azure
|
|
15
|
+
Provides-Extra: notebook
|
|
13
16
|
Provides-Extra: polygon
|
|
14
17
|
Provides-Extra: yahoo
|
|
15
18
|
Requires-Dist: Flask (>=3.1.0)
|
|
16
19
|
Requires-Dist: Flask-Cors (>=3.0.9,<7.0.0)
|
|
17
|
-
Requires-Dist: Flask-Migrate (>=2.6.0)
|
|
18
20
|
Requires-Dist: SQLAlchemy (>=2.0.18)
|
|
19
21
|
Requires-Dist: alpha_vantage (>=3.0.0,<4.0.0) ; extra == "alpha-vantage" or extra == "all"
|
|
20
|
-
Requires-Dist: azure-identity (>=1.19.0,<2.0.0)
|
|
21
|
-
Requires-Dist: azure-mgmt-resource (>=23.2.0,<24.0.0)
|
|
22
|
-
Requires-Dist: azure-mgmt-storage (>=21.2.1,<22.0.0)
|
|
23
|
-
Requires-Dist: azure-mgmt-web (>=7.3.1,<8.0.0)
|
|
24
|
-
Requires-Dist: azure-storage-blob (>=12.24.0,<13.0.0)
|
|
25
|
-
Requires-Dist: boto3 (>=1.38.41,<2.0.0)
|
|
22
|
+
Requires-Dist: azure-identity (>=1.19.0,<2.0.0) ; extra == "azure" or extra == "all"
|
|
23
|
+
Requires-Dist: azure-mgmt-resource (>=23.2.0,<24.0.0) ; extra == "azure" or extra == "all"
|
|
24
|
+
Requires-Dist: azure-mgmt-storage (>=21.2.1,<22.0.0) ; extra == "azure" or extra == "all"
|
|
25
|
+
Requires-Dist: azure-mgmt-web (>=7.3.1,<8.0.0) ; extra == "azure" or extra == "all"
|
|
26
|
+
Requires-Dist: azure-storage-blob (>=12.24.0,<13.0.0) ; extra == "azure" or extra == "all"
|
|
27
|
+
Requires-Dist: boto3 (>=1.38.41,<2.0.0) ; extra == "aws" or extra == "all"
|
|
26
28
|
Requires-Dist: ccxt (>=4.2.48)
|
|
27
29
|
Requires-Dist: dependency-injector (>=4.40.0)
|
|
28
|
-
Requires-Dist:
|
|
30
|
+
Requires-Dist: finterion-charts (==1.4.0)
|
|
31
|
+
Requires-Dist: ipython (>=8.0.0) ; extra == "notebook" or extra == "all"
|
|
29
32
|
Requires-Dist: marshmallow (>=3.5.0)
|
|
30
33
|
Requires-Dist: msgpack (>=1.0.0)
|
|
31
|
-
Requires-Dist: plotly (>=6.1.2,<7.0.0)
|
|
32
34
|
Requires-Dist: polars[numpy,pandas] (>=0.20.10)
|
|
33
35
|
Requires-Dist: polygon-api-client (>=1.14.0,<2.0.0) ; extra == "polygon" or extra == "all"
|
|
34
36
|
Requires-Dist: pyarrow (>=14.0.0)
|
|
@@ -318,16 +320,33 @@ Every backtest produces a **self-contained HTML dashboard** — open it in any b
|
|
|
318
320
|
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:
|
|
319
321
|
|
|
320
322
|
```python
|
|
321
|
-
from investing_algorithm_framework import
|
|
323
|
+
from investing_algorithm_framework import (
|
|
324
|
+
BacktestReport, Study, Universe, BacktestWindow, BacktestEngine,
|
|
325
|
+
)
|
|
322
326
|
|
|
323
327
|
# --- Single event-driven backtest ---
|
|
324
|
-
|
|
325
|
-
|
|
328
|
+
event_study = Study(
|
|
329
|
+
universe=Universe(market="BITVAVO", trading_symbol="EUR"),
|
|
330
|
+
initial_capital=1000,
|
|
331
|
+
backtest_windows=[BacktestWindow(train_range=date_range)],
|
|
332
|
+
engines=[BacktestEngine.EVENT_DRIVEN],
|
|
333
|
+
)
|
|
334
|
+
backtests = app.run_backtest(strategy=strategy, study=event_study)
|
|
335
|
+
BacktestReport(backtests=backtests).save("event_report.html")
|
|
326
336
|
|
|
327
337
|
# --- A sweep of vector backtests (parameter grid / multi-window) ---
|
|
328
|
-
|
|
338
|
+
sweep_study = Study(
|
|
339
|
+
universe=Universe(market="BITVAVO", trading_symbol="EUR"),
|
|
340
|
+
initial_capital=1000,
|
|
341
|
+
backtest_windows=[
|
|
342
|
+
BacktestWindow(train_range=dr)
|
|
343
|
+
for dr in [range_2022, range_2023, range_2024]
|
|
344
|
+
],
|
|
345
|
+
engines=[BacktestEngine.VECTOR],
|
|
346
|
+
)
|
|
347
|
+
backtests = app.run_backtests(
|
|
329
348
|
strategies=[StrategyA(), StrategyB(), StrategyC()],
|
|
330
|
-
|
|
349
|
+
study=sweep_study,
|
|
331
350
|
n_workers=-1,
|
|
332
351
|
backtest_storage_directory="./my-backtests/", # persists .obtf bundles
|
|
333
352
|
show_progress=True,
|
|
@@ -274,16 +274,33 @@ Every backtest produces a **self-contained HTML dashboard** — open it in any b
|
|
|
274
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:
|
|
275
275
|
|
|
276
276
|
```python
|
|
277
|
-
from investing_algorithm_framework import
|
|
277
|
+
from investing_algorithm_framework import (
|
|
278
|
+
BacktestReport, Study, Universe, BacktestWindow, BacktestEngine,
|
|
279
|
+
)
|
|
278
280
|
|
|
279
281
|
# --- Single event-driven backtest ---
|
|
280
|
-
|
|
281
|
-
|
|
282
|
+
event_study = Study(
|
|
283
|
+
universe=Universe(market="BITVAVO", trading_symbol="EUR"),
|
|
284
|
+
initial_capital=1000,
|
|
285
|
+
backtest_windows=[BacktestWindow(train_range=date_range)],
|
|
286
|
+
engines=[BacktestEngine.EVENT_DRIVEN],
|
|
287
|
+
)
|
|
288
|
+
backtests = app.run_backtest(strategy=strategy, study=event_study)
|
|
289
|
+
BacktestReport(backtests=backtests).save("event_report.html")
|
|
282
290
|
|
|
283
291
|
# --- A sweep of vector backtests (parameter grid / multi-window) ---
|
|
284
|
-
|
|
292
|
+
sweep_study = Study(
|
|
293
|
+
universe=Universe(market="BITVAVO", trading_symbol="EUR"),
|
|
294
|
+
initial_capital=1000,
|
|
295
|
+
backtest_windows=[
|
|
296
|
+
BacktestWindow(train_range=dr)
|
|
297
|
+
for dr in [range_2022, range_2023, range_2024]
|
|
298
|
+
],
|
|
299
|
+
engines=[BacktestEngine.VECTOR],
|
|
300
|
+
)
|
|
301
|
+
backtests = app.run_backtests(
|
|
285
302
|
strategies=[StrategyA(), StrategyB(), StrategyC()],
|
|
286
|
-
|
|
303
|
+
study=sweep_study,
|
|
287
304
|
n_workers=-1,
|
|
288
305
|
backtest_storage_directory="./my-backtests/", # persists .obtf bundles
|
|
289
306
|
show_progress=True,
|
|
@@ -142,7 +142,18 @@ from .services import (
|
|
|
142
142
|
TradeTakeProfitService,
|
|
143
143
|
TradeStopLossService,
|
|
144
144
|
)
|
|
145
|
-
|
|
145
|
+
try:
|
|
146
|
+
from .notebook.magic import load_ipython_extension # noqa: F401
|
|
147
|
+
except ImportError:
|
|
148
|
+
# IPython is an optional dependency (install with
|
|
149
|
+
# `pip install investing-algorithm-framework[notebook]`) — don't
|
|
150
|
+
# let its absence break importing the framework itself.
|
|
151
|
+
def load_ipython_extension(ipython): # pragma: no cover
|
|
152
|
+
raise ImportError(
|
|
153
|
+
"IPython is required to use the %backtest magic. Install "
|
|
154
|
+
"it with `pip install investing-algorithm-framework"
|
|
155
|
+
"[notebook]`."
|
|
156
|
+
)
|
|
146
157
|
|
|
147
158
|
|
|
148
159
|
__all__ = [
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
import threading
|
|
5
|
+
from datetime import datetime, timezone
|
|
6
|
+
from typing import Optional
|
|
7
|
+
|
|
8
|
+
from investing_algorithm_framework.domain import OperationalException
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger("investing_algorithm_framework")
|
|
11
|
+
|
|
12
|
+
NOT_STARTED = "NOT_STARTED"
|
|
13
|
+
RUNNING = "RUNNING"
|
|
14
|
+
STOPPING = "STOPPING"
|
|
15
|
+
STOPPED = "STOPPED"
|
|
16
|
+
|
|
17
|
+
CONTROL_FILE_NAME = "algorithm_control.json"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class AlgorithmRunner:
|
|
21
|
+
"""
|
|
22
|
+
Thread-safe controller that runs an ``EventLoopService`` in a
|
|
23
|
+
background thread so the trading algorithm can be started and
|
|
24
|
+
stopped on demand (e.g. from the web API) without killing the
|
|
25
|
+
process that hosts it.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(self):
|
|
29
|
+
self._lock = threading.Lock()
|
|
30
|
+
self._thread: Optional[threading.Thread] = None
|
|
31
|
+
self._event_loop_service = None
|
|
32
|
+
self._run_kwargs = {}
|
|
33
|
+
self._status = NOT_STARTED
|
|
34
|
+
self._started_at = None
|
|
35
|
+
self._stopped_at = None
|
|
36
|
+
self._error = None
|
|
37
|
+
self._resource_directory = None
|
|
38
|
+
self._state_handler = None
|
|
39
|
+
|
|
40
|
+
def bind_persistence(self, resource_directory, state_handler=None) -> None:
|
|
41
|
+
"""
|
|
42
|
+
Wires where the enabled/disabled control flag is persisted.
|
|
43
|
+
|
|
44
|
+
This is what makes ``enable()``/``disable()`` meaningful for
|
|
45
|
+
*stateless* deployments (AWS Lambda, Azure Functions): the
|
|
46
|
+
flag file lives inside ``resource_directory``, the same
|
|
47
|
+
directory a configured ``state_handler`` already uploads/
|
|
48
|
+
downloads on every run. Passing the state handler here makes a
|
|
49
|
+
toggle take effect immediately (pushed on the spot) instead of
|
|
50
|
+
waiting for the next natural save.
|
|
51
|
+
"""
|
|
52
|
+
with self._lock:
|
|
53
|
+
self._resource_directory = resource_directory
|
|
54
|
+
self._state_handler = state_handler
|
|
55
|
+
|
|
56
|
+
def _control_file_path(self) -> Optional[str]:
|
|
57
|
+
if self._resource_directory is None:
|
|
58
|
+
return None
|
|
59
|
+
os.makedirs(self._resource_directory, exist_ok=True)
|
|
60
|
+
return os.path.join(self._resource_directory, CONTROL_FILE_NAME)
|
|
61
|
+
|
|
62
|
+
def get_control_state(self) -> dict:
|
|
63
|
+
"""Returns the persisted enabled/disabled control state."""
|
|
64
|
+
default = {"enabled": True, "reason": None, "updated_at": None}
|
|
65
|
+
path = self._control_file_path()
|
|
66
|
+
|
|
67
|
+
if path is None or not os.path.exists(path):
|
|
68
|
+
return default
|
|
69
|
+
|
|
70
|
+
try:
|
|
71
|
+
with open(path, "r") as f:
|
|
72
|
+
return {**default, **json.load(f)}
|
|
73
|
+
except (OSError, ValueError) as e:
|
|
74
|
+
logger.warning(f"Could not read algorithm control file: {e}")
|
|
75
|
+
return default
|
|
76
|
+
|
|
77
|
+
def is_enabled(self) -> bool:
|
|
78
|
+
"""Enabled by default when no control file has been written yet."""
|
|
79
|
+
return self.get_control_state().get("enabled", True)
|
|
80
|
+
|
|
81
|
+
def _persist_enabled(
|
|
82
|
+
self, enabled: bool, reason: Optional[str] = None
|
|
83
|
+
) -> None:
|
|
84
|
+
path = self._control_file_path()
|
|
85
|
+
|
|
86
|
+
if path is None:
|
|
87
|
+
return
|
|
88
|
+
|
|
89
|
+
state = {
|
|
90
|
+
"enabled": enabled,
|
|
91
|
+
"reason": reason,
|
|
92
|
+
"updated_at": datetime.now(timezone.utc).isoformat(),
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
with open(path, "w") as f:
|
|
96
|
+
json.dump(state, f)
|
|
97
|
+
|
|
98
|
+
if self._state_handler is not None:
|
|
99
|
+
try:
|
|
100
|
+
self._state_handler.save(self._resource_directory)
|
|
101
|
+
except Exception as e:
|
|
102
|
+
logger.warning(
|
|
103
|
+
"Could not push algorithm control state via the "
|
|
104
|
+
f"configured state handler: {e}"
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
def enable(self, reason: Optional[str] = None) -> None:
|
|
108
|
+
"""Persists 'enabled', independent of any in-process thread."""
|
|
109
|
+
self._persist_enabled(True, reason=reason)
|
|
110
|
+
|
|
111
|
+
def disable(self, reason: Optional[str] = None) -> None:
|
|
112
|
+
"""Persists 'disabled', independent of any in-process thread."""
|
|
113
|
+
self._persist_enabled(False, reason=reason)
|
|
114
|
+
|
|
115
|
+
def configure(self, event_loop_service, **run_kwargs) -> None:
|
|
116
|
+
"""
|
|
117
|
+
Wires the event loop service (and any kwargs for its
|
|
118
|
+
``start()`` method) that ``start``/``stop`` will control.
|
|
119
|
+
Safe to call again after a ``stop()`` to reconfigure before
|
|
120
|
+
the next ``start()``.
|
|
121
|
+
"""
|
|
122
|
+
with self._lock:
|
|
123
|
+
self._event_loop_service = event_loop_service
|
|
124
|
+
self._run_kwargs = run_kwargs
|
|
125
|
+
|
|
126
|
+
@property
|
|
127
|
+
def status(self) -> str:
|
|
128
|
+
with self._lock:
|
|
129
|
+
return self._status
|
|
130
|
+
|
|
131
|
+
@property
|
|
132
|
+
def is_running(self) -> bool:
|
|
133
|
+
return self.status == RUNNING
|
|
134
|
+
|
|
135
|
+
def get_status_report(self) -> dict:
|
|
136
|
+
with self._lock:
|
|
137
|
+
return {
|
|
138
|
+
"status": self._status,
|
|
139
|
+
"started_at": self._started_at.isoformat()
|
|
140
|
+
if self._started_at else None,
|
|
141
|
+
"stopped_at": self._stopped_at.isoformat()
|
|
142
|
+
if self._stopped_at else None,
|
|
143
|
+
"error": self._error,
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
def start(self) -> bool:
|
|
147
|
+
"""
|
|
148
|
+
Starts (or resumes) the algorithm loop in a background thread.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
bool: True if a new run was started, False if the
|
|
152
|
+
algorithm was already running.
|
|
153
|
+
|
|
154
|
+
Raises:
|
|
155
|
+
OperationalException: If the runner has not been
|
|
156
|
+
configured with an event loop service yet (i.e. the
|
|
157
|
+
app has never been run).
|
|
158
|
+
"""
|
|
159
|
+
with self._lock:
|
|
160
|
+
if self._event_loop_service is None:
|
|
161
|
+
raise OperationalException(
|
|
162
|
+
"The algorithm has not been initialized yet. Run "
|
|
163
|
+
"the app at least once before starting it "
|
|
164
|
+
"through the API."
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
if self._status == RUNNING:
|
|
168
|
+
self.enable()
|
|
169
|
+
return False
|
|
170
|
+
|
|
171
|
+
self._event_loop_service.reset_stop()
|
|
172
|
+
self._error = None
|
|
173
|
+
self._started_at = datetime.now(timezone.utc)
|
|
174
|
+
self._stopped_at = None
|
|
175
|
+
self._status = RUNNING
|
|
176
|
+
event_loop_service = self._event_loop_service
|
|
177
|
+
run_kwargs = self._run_kwargs
|
|
178
|
+
|
|
179
|
+
def _run():
|
|
180
|
+
try:
|
|
181
|
+
event_loop_service.start(**run_kwargs)
|
|
182
|
+
except Exception as e:
|
|
183
|
+
logger.error(f"Algorithm loop stopped with an error: {e}")
|
|
184
|
+
with self._lock:
|
|
185
|
+
self._error = str(e)
|
|
186
|
+
finally:
|
|
187
|
+
with self._lock:
|
|
188
|
+
self._status = STOPPED
|
|
189
|
+
self._stopped_at = datetime.now(timezone.utc)
|
|
190
|
+
|
|
191
|
+
self._thread = threading.Thread(
|
|
192
|
+
name="Algorithm Loop", target=_run, daemon=True
|
|
193
|
+
)
|
|
194
|
+
self._thread.start()
|
|
195
|
+
self.enable()
|
|
196
|
+
return True
|
|
197
|
+
|
|
198
|
+
def stop(
|
|
199
|
+
self,
|
|
200
|
+
wait: bool = False,
|
|
201
|
+
timeout: float = 10,
|
|
202
|
+
reason: Optional[str] = None,
|
|
203
|
+
) -> bool:
|
|
204
|
+
"""
|
|
205
|
+
Signals the running algorithm loop to stop after its current
|
|
206
|
+
iteration completes, and persists 'disabled' regardless of
|
|
207
|
+
whether a loop is currently running in-process (this is what a
|
|
208
|
+
stateless/serverless deployment, e.g. AWS Lambda or Azure
|
|
209
|
+
Functions, checks on its next scheduled invocation).
|
|
210
|
+
|
|
211
|
+
Args:
|
|
212
|
+
wait: If True, blocks until the background thread has
|
|
213
|
+
actually exited (bounded by ``timeout`` seconds).
|
|
214
|
+
timeout: Max seconds to wait for the thread to exit when
|
|
215
|
+
``wait`` is True.
|
|
216
|
+
reason: Optional human-readable reason, persisted alongside
|
|
217
|
+
the disabled state.
|
|
218
|
+
|
|
219
|
+
Returns:
|
|
220
|
+
bool: True if a running in-process loop was signaled to
|
|
221
|
+
stop, False if it was not running (the disabled state
|
|
222
|
+
is still persisted either way).
|
|
223
|
+
"""
|
|
224
|
+
self.disable(reason=reason)
|
|
225
|
+
|
|
226
|
+
with self._lock:
|
|
227
|
+
if self._status != RUNNING:
|
|
228
|
+
return False
|
|
229
|
+
self._status = STOPPING
|
|
230
|
+
self._event_loop_service.request_stop()
|
|
231
|
+
thread = self._thread
|
|
232
|
+
|
|
233
|
+
if wait and thread is not None:
|
|
234
|
+
thread.join(timeout=timeout)
|
|
235
|
+
|
|
236
|
+
return True
|