investing-algorithm-framework 7.22.2__tar.gz → 7.22.4__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-7.22.2 → investing_algorithm_framework-7.22.4}/PKG-INFO +1 -1
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/__init__.py +5 -4
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/__init__.py +1 -4
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/analysis/__init__.py +0 -4
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/app.py +74 -209
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/context.py +4 -5
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/strategy.py +31 -24
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/dependency_container.py +2 -2
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/__init__.py +5 -2
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/backtesting/__init__.py +5 -1
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/backtesting/backtest.py +21 -18
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/backtesting/backtest_metrics.py +11 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/backtesting/backtest_run.py +77 -21
- {investing_algorithm_framework-7.22.2/investing_algorithm_framework/app/analysis → investing_algorithm_framework-7.22.4/investing_algorithm_framework/domain/backtesting}/backtest_utils.py +52 -10
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/backtesting/combine_backtests.py +10 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/trade/trade.py +6 -5
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/__init__.py +3 -1
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/services/__init__.py +3 -1
- investing_algorithm_framework-7.22.4/investing_algorithm_framework/infrastructure/services/backtesting/backtest_service.py +1572 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/__init__.py +0 -2
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/pyproject.toml +1 -1
- investing_algorithm_framework-7.22.2/investing_algorithm_framework/services/backtesting/backtest_service.py +0 -719
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/LICENSE +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/README.md +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/algorithm/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/algorithm/algorithm.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/algorithm/algorithm_factory.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/analysis/backtest_data_ranges.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/analysis/permutation.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/analysis/ranking.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/analysis/strategy_id.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/app_hook.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/eventloop.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/ascii.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/backtest_report.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/charts/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/charts/equity_curve.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/charts/line_chart.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/charts/monthly_returns_heatmap.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/generate.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/tables/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/tables/key_metrics_table.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/tables/stop_loss_table.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/tables/time_metrics_table.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/tables/trade_metrics_table.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/tables/trades_table.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/tables/utils.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/reporting/templates/report_template.html.j2 +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/task.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/controllers/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/controllers/orders.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/controllers/positions.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/create_app.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/error_handler.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/responses.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/schemas/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/schemas/order.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/app/web/setup_cors.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/cli.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/deploy_to_aws_lambda.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/deploy_to_azure_function.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/initialize_app.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/.gitignore.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/app.py.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/app_aws_lambda_function.py.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/app_azure_function.py.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/app_web.py.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/aws_lambda_dockerfile.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/aws_lambda_dockerignore.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/aws_lambda_readme.md.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/aws_lambda_requirements.txt.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/azure_function_function_app.py.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/azure_function_host.json.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/azure_function_local.settings.json.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/azure_function_requirements.txt.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/data_providers.py.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/env.example.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/env_azure_function.example.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/market_data_providers.py.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/readme.md.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/requirements.txt.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/run_backtest.py.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/cli/templates/strategy.py.template +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/create_app.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/backtesting/backtest_date_range.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/backtesting/backtest_evaluation_focuss.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/backtesting/backtest_permutation_test.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/backtesting/backtest_summary_metrics.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/config.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/constants.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/data_provider.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/data_structures.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/exceptions.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/app_mode.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/base_model.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/data/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/data/data_source.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/data/data_type.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/event.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/market/market_credential.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/order/order.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/order/order_side.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/order/order_status.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/order/order_type.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/position/position.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/position/position_size.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/risk_rules/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/risk_rules/stop_loss_rule.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/risk_rules/take_profit_rule.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/snapshot_interval.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/strategy_profile.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/time_frame.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/tracing/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/tracing/trace.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/trade/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/trade/trade_status.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/trade/trade_stop_loss.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/models/trade/trade_take_profit.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/order_executor.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/portfolio_provider.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/services/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/services/rounding_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/services/state_handler.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/strategy.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/utils/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/utils/csv.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/utils/custom_tqdm.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/utils/dates.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/utils/jupyter_notebook_detection.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/utils/polars.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/utils/random.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/download_data.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/data_providers/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/data_providers/ccxt.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/data_providers/csv.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/data_providers/pandas.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/order/order.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/order/order_metadata.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/order_trade_association.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/portfolio/sql_portfolio.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/position/position.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/trades/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/trades/trade.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/trades/trade_stop_loss.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/models/trades/trade_take_profit.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/order_executors/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/order_executors/backtest_oder_executor.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/order_executors/ccxt_order_executor.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/portfolio_providers/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/portfolio_providers/ccxt_portfolio_provider.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/order_metadata_repository.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/repository.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/trade_repository.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/trade_stop_loss_repository.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/repositories/trade_take_profit_repository.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/services/aws/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/services/aws/state_handler.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/services/azure/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/infrastructure/services/azure/state_handler.py +0 -0
- {investing_algorithm_framework-7.22.2/investing_algorithm_framework → investing_algorithm_framework-7.22.4/investing_algorithm_framework/infrastructure}/services/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/configuration_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/data_providers/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/data_providers/data_provider_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/alpha.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/beta.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/cagr.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/calmar_ratio.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/drawdown.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/equity_curve.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/exposure.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/generate.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/mean_daily_return.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/price_efficiency.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/profit_factor.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/recovery.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/returns.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/risk_free_rate.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/sharpe_ratio.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/sortino_ratio.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/standard_deviation.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/trades.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/treynor_ratio.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/ulcer.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/value_at_risk.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/volatility.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/metrics/win_rate.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/order_service/order_backtest_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/order_service/order_executor_lookup.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/order_service/order_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/portfolios/backtest_portfolio_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/portfolios/portfolio_configuration_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/portfolios/portfolio_provider_lookup.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/portfolios/portfolio_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/portfolios/portfolio_snapshot_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/positions/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/positions/position_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/positions/position_snapshot_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/repository_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/trade_order_evaluator/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/trade_order_evaluator/backtest_trade_oder_evaluator.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/trade_order_evaluator/default_trade_order_evaluator.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/trade_order_evaluator/trade_order_evaluator.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/trade_service/__init__.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/trade_service/trade_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/trade_service/trade_stop_loss_service.py +0 -0
- {investing_algorithm_framework-7.22.2 → investing_algorithm_framework-7.22.4}/investing_algorithm_framework/services/trade_service/trade_take_profit_service.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from .app import App, Algorithm, generate_strategy_id, \
|
|
2
2
|
TradingStrategy, StatelessAction, Task, AppHook, Context, \
|
|
3
|
-
add_html_report, BacktestReport,
|
|
3
|
+
add_html_report, BacktestReport, \
|
|
4
4
|
pretty_print_trades, pretty_print_positions, \
|
|
5
5
|
pretty_print_orders, pretty_print_backtest, select_backtest_date_ranges, \
|
|
6
|
-
get_equity_curve_with_drawdown_chart,
|
|
6
|
+
get_equity_curve_with_drawdown_chart, \
|
|
7
7
|
get_rolling_sharpe_ratio_chart, rank_results, \
|
|
8
8
|
get_monthly_returns_heatmap_chart, create_weights, \
|
|
9
9
|
get_yearly_returns_bar_chart, get_entry_and_exit_signals, \
|
|
@@ -13,12 +13,13 @@ from .domain import ApiException, combine_backtests, PositionSize, \
|
|
|
13
13
|
TimeUnit, TimeInterval, Order, Portfolio, Backtest, DataError, \
|
|
14
14
|
Position, TimeFrame, INDEX_DATETIME, MarketCredential, TakeProfitRule, \
|
|
15
15
|
PortfolioConfiguration, RESOURCE_DIRECTORY, AWS_LAMBDA_LOGGING_CONFIG, \
|
|
16
|
-
Trade, APP_MODE, AppMode, DATETIME_FORMAT, \
|
|
16
|
+
Trade, APP_MODE, AppMode, DATETIME_FORMAT, load_backtests_from_directory, \
|
|
17
17
|
BacktestDateRange, convert_polars_to_pandas, BacktestRun, \
|
|
18
18
|
DEFAULT_LOGGING_CONFIG, DataType, DataProvider, StopLossRule, \
|
|
19
19
|
TradeStatus, generate_backtest_summary_metrics, \
|
|
20
20
|
APPLICATION_DIRECTORY, DataSource, OrderExecutor, PortfolioProvider, \
|
|
21
|
-
SnapshotInterval, AWS_S3_STATE_BUCKET_NAME, BacktestEvaluationFocus
|
|
21
|
+
SnapshotInterval, AWS_S3_STATE_BUCKET_NAME, BacktestEvaluationFocus, \
|
|
22
|
+
save_backtests_to_directory
|
|
22
23
|
from .infrastructure import AzureBlobStorageStateHandler, \
|
|
23
24
|
CSVOHLCVDataProvider, CCXTOHLCVDataProvider, PandasOHLCVDataProvider, \
|
|
24
25
|
AWSS3StorageStateHandler
|
|
@@ -14,8 +14,7 @@ from .reporting import add_html_report, \
|
|
|
14
14
|
get_yearly_returns_bar_chart, get_equity_curve_chart, \
|
|
15
15
|
get_ohlcv_data_completeness_chart, get_entry_and_exit_signals
|
|
16
16
|
from .analysis import select_backtest_date_ranges, rank_results, \
|
|
17
|
-
create_weights,
|
|
18
|
-
save_backtests_to_directory, generate_strategy_id
|
|
17
|
+
create_weights, generate_strategy_id
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
__all__ = [
|
|
@@ -43,7 +42,5 @@ __all__ = [
|
|
|
43
42
|
"create_weights",
|
|
44
43
|
"get_entry_and_exit_signals",
|
|
45
44
|
"get_equity_curve_chart",
|
|
46
|
-
"load_backtests_from_directory",
|
|
47
|
-
"save_backtests_to_directory",
|
|
48
45
|
"generate_strategy_id"
|
|
49
46
|
]
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
from .backtest_data_ranges import select_backtest_date_ranges
|
|
2
2
|
from .ranking import rank_results, create_weights, combine_backtest_metrics
|
|
3
3
|
from .permutation import create_ohlcv_permutation
|
|
4
|
-
from .backtest_utils import load_backtests_from_directory, \
|
|
5
|
-
save_backtests_to_directory
|
|
6
4
|
from .strategy_id import generate_strategy_id
|
|
7
5
|
|
|
8
6
|
__all__ = [
|
|
@@ -11,7 +9,5 @@ __all__ = [
|
|
|
11
9
|
"create_weights",
|
|
12
10
|
"create_ohlcv_permutation",
|
|
13
11
|
"combine_backtest_metrics",
|
|
14
|
-
"load_backtests_from_directory",
|
|
15
|
-
"save_backtests_to_directory",
|
|
16
12
|
"generate_strategy_id"
|
|
17
13
|
]
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import gc
|
|
2
|
-
import shutil
|
|
3
1
|
import inspect
|
|
4
2
|
import logging
|
|
5
3
|
import os
|
|
@@ -20,11 +18,11 @@ from investing_algorithm_framework.domain import DATABASE_NAME, TimeUnit, \
|
|
|
20
18
|
BACKTESTING_START_DATE, BACKTESTING_END_DATE, APP_MODE, MarketCredential, \
|
|
21
19
|
AppMode, BacktestDateRange, DATABASE_DIRECTORY_NAME, DataSource, \
|
|
22
20
|
BACKTESTING_INITIAL_AMOUNT, SNAPSHOT_INTERVAL, Backtest, DataError, \
|
|
23
|
-
PortfolioConfiguration, SnapshotInterval, DataType,
|
|
21
|
+
PortfolioConfiguration, SnapshotInterval, DataType, \
|
|
24
22
|
PortfolioProvider, OrderExecutor, ImproperlyConfigured, TimeFrame, \
|
|
25
23
|
DataProvider, INDEX_DATETIME, tqdm, BacktestPermutationTest, \
|
|
26
|
-
LAST_SNAPSHOT_DATETIME, BACKTESTING_FLAG, \
|
|
27
|
-
generate_backtest_summary_metrics
|
|
24
|
+
LAST_SNAPSHOT_DATETIME, BACKTESTING_FLAG, DATA_DIRECTORY, \
|
|
25
|
+
generate_backtest_summary_metrics
|
|
28
26
|
from investing_algorithm_framework.infrastructure import setup_sqlalchemy, \
|
|
29
27
|
create_all_tables, CCXTOrderExecutor, CCXTPortfolioProvider, \
|
|
30
28
|
BacktestOrderExecutor, CCXTOHLCVDataProvider, clear_db, \
|
|
@@ -34,9 +32,7 @@ from investing_algorithm_framework.services import OrderBacktestService, \
|
|
|
34
32
|
DefaultTradeOrderEvaluator, get_risk_free_rate_us
|
|
35
33
|
from .app_hook import AppHook
|
|
36
34
|
from .eventloop import EventLoopService
|
|
37
|
-
from .analysis import create_ohlcv_permutation
|
|
38
|
-
load_backtests_from_directory
|
|
39
|
-
|
|
35
|
+
from .analysis import create_ohlcv_permutation
|
|
40
36
|
|
|
41
37
|
logger = logging.getLogger("investing_algorithm_framework")
|
|
42
38
|
COLOR_RESET = '\033[0m'
|
|
@@ -1021,14 +1017,13 @@ class App:
|
|
|
1021
1017
|
List[Backtest]: List of Backtest instances for each strategy
|
|
1022
1018
|
that was backtested.
|
|
1023
1019
|
"""
|
|
1024
|
-
|
|
1025
|
-
strategy_ids = [strategy.id for strategy in strategies]
|
|
1026
|
-
strategy_id_selection = strategy_ids.copy()
|
|
1027
|
-
data_sources = []
|
|
1020
|
+
backtest_service = self.container.backtest_service()
|
|
1028
1021
|
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1022
|
+
if use_checkpoints and backtest_storage_directory is None:
|
|
1023
|
+
raise OperationalException(
|
|
1024
|
+
"backtest_storage_directory must be provided when "
|
|
1025
|
+
"use_checkpoints is set to True"
|
|
1026
|
+
)
|
|
1032
1027
|
|
|
1033
1028
|
if backtest_date_range is None and backtest_date_ranges is None:
|
|
1034
1029
|
raise OperationalException(
|
|
@@ -1036,198 +1031,54 @@ class App:
|
|
|
1036
1031
|
"provided"
|
|
1037
1032
|
)
|
|
1038
1033
|
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
logger.info("No risk free rate provided, retrieving it...")
|
|
1044
|
-
risk_free_rate = get_risk_free_rate_us()
|
|
1045
|
-
|
|
1046
|
-
if risk_free_rate is None:
|
|
1047
|
-
raise OperationalException(
|
|
1048
|
-
"Could not retrieve risk free rate for backtest metrics."
|
|
1049
|
-
"Please provide a risk free as an argument when running "
|
|
1050
|
-
"your backtest or make sure you have an internet "
|
|
1051
|
-
"connection"
|
|
1052
|
-
)
|
|
1053
|
-
|
|
1054
|
-
if backtest_date_range is not None:
|
|
1055
|
-
backtest_results = []
|
|
1056
|
-
if not skip_data_sources_initialization:
|
|
1057
|
-
self.initialize_data_sources_backtest(
|
|
1058
|
-
data_sources,
|
|
1059
|
-
backtest_date_range,
|
|
1060
|
-
show_progress=show_progress
|
|
1061
|
-
)
|
|
1062
|
-
|
|
1063
|
-
for strategy in tqdm(
|
|
1064
|
-
strategies, colour="green", desc="Running backtests"
|
|
1065
|
-
):
|
|
1066
|
-
backtests.append(
|
|
1067
|
-
self.run_vector_backtest(
|
|
1068
|
-
backtest_date_range=backtest_date_range,
|
|
1069
|
-
initial_amount=initial_amount,
|
|
1070
|
-
strategy=strategy,
|
|
1071
|
-
snapshot_interval=snapshot_interval,
|
|
1072
|
-
risk_free_rate=risk_free_rate,
|
|
1073
|
-
skip_data_sources_initialization=True,
|
|
1074
|
-
market=market,
|
|
1075
|
-
trading_symbol=trading_symbol,
|
|
1076
|
-
continue_on_error=continue_on_error,
|
|
1077
|
-
use_checkpoints=use_checkpoints,
|
|
1078
|
-
backtest_storage_directory=backtest_storage_directory,
|
|
1079
|
-
)
|
|
1080
|
-
)
|
|
1081
|
-
|
|
1082
|
-
# Apply filter function if set
|
|
1083
|
-
if filter_function is not None:
|
|
1084
|
-
backtests = filter_function(backtests, backtest_date_range)
|
|
1034
|
+
if not skip_data_sources_initialization:
|
|
1035
|
+
print("adding default data providers")
|
|
1036
|
+
data_provider_service = self.container.data_provider_service()
|
|
1037
|
+
data_provider_service.reset()
|
|
1085
1038
|
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
backtests=backtests,
|
|
1090
|
-
directory_path=backtest_storage_directory,
|
|
1039
|
+
for data_provider_tuple in self._data_providers:
|
|
1040
|
+
data_provider_service.add_data_provider(
|
|
1041
|
+
data_provider_tuple[0], priority=data_provider_tuple[1]
|
|
1091
1042
|
)
|
|
1092
1043
|
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
storage_directories = {}
|
|
1097
|
-
|
|
1098
|
-
# Make sure that the backtest date ranges are sorted by start date
|
|
1099
|
-
# and unique
|
|
1100
|
-
unique_date_ranges = set(backtest_date_ranges)
|
|
1101
|
-
backtest_date_ranges = sorted(
|
|
1102
|
-
unique_date_ranges, key=lambda x: x.start_date
|
|
1044
|
+
# Add the default data providers
|
|
1045
|
+
data_provider_service.add_data_provider(
|
|
1046
|
+
CCXTOHLCVDataProvider()
|
|
1103
1047
|
)
|
|
1104
1048
|
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
initial_amount=initial_amount,
|
|
1139
|
-
strategy=strategy,
|
|
1140
|
-
snapshot_interval=snapshot_interval,
|
|
1141
|
-
risk_free_rate=risk_free_rate,
|
|
1142
|
-
skip_data_sources_initialization=True,
|
|
1143
|
-
market=market,
|
|
1144
|
-
trading_symbol=trading_symbol,
|
|
1145
|
-
use_checkpoints=use_checkpoints,
|
|
1146
|
-
backtest_storage_directory=(
|
|
1147
|
-
backtest_storage_directory
|
|
1148
|
-
)
|
|
1149
|
-
)
|
|
1150
|
-
)
|
|
1151
|
-
|
|
1152
|
-
# Apply filter function after each date range to determine
|
|
1153
|
-
# which strategies continue to the next period
|
|
1154
|
-
if filter_function is not None:
|
|
1155
|
-
backtest_results = filter_function(
|
|
1156
|
-
backtest_results, backtest_date_range
|
|
1157
|
-
)
|
|
1158
|
-
strategy_id_selection = [
|
|
1159
|
-
backtest.metadata["id"] for backtest
|
|
1160
|
-
in backtest_results
|
|
1161
|
-
]
|
|
1162
|
-
active_strategies = [
|
|
1163
|
-
strategy for strategy in active_strategies
|
|
1164
|
-
if strategy.id in strategy_id_selection
|
|
1165
|
-
]
|
|
1166
|
-
|
|
1167
|
-
# Save the intermediate backtests to a temp storage location
|
|
1168
|
-
# if backtest_storage_directory is provided and clean up memory
|
|
1169
|
-
if backtest_storage_directory is not None:
|
|
1170
|
-
path = storage_directories[backtest_date_range]
|
|
1171
|
-
save_backtests_to_directory(
|
|
1172
|
-
backtests=backtest_results, directory_path=path,
|
|
1173
|
-
)
|
|
1174
|
-
|
|
1175
|
-
else:
|
|
1176
|
-
for backtest in backtest_results:
|
|
1177
|
-
backtests_ordered_by_strategy.setdefault(
|
|
1178
|
-
backtest.metadata["id"], []
|
|
1179
|
-
).append(backtest)
|
|
1180
|
-
|
|
1181
|
-
del backtest_results
|
|
1182
|
-
|
|
1183
|
-
# Free up memory
|
|
1184
|
-
gc.collect()
|
|
1185
|
-
|
|
1186
|
-
def load_backtest_filter_fn(bt: Backtest) -> bool:
|
|
1187
|
-
return bt.metadata["id"] in strategy_id_selection
|
|
1188
|
-
|
|
1189
|
-
# load all backtests from storage directories and combine them
|
|
1190
|
-
if backtest_storage_directory is not None:
|
|
1191
|
-
strategy_id_selection = [
|
|
1192
|
-
strategy.id for strategy in active_strategies
|
|
1193
|
-
]
|
|
1194
|
-
for backtest_range in storage_directories:
|
|
1195
|
-
|
|
1196
|
-
path = storage_directories[backtest_range]
|
|
1197
|
-
loaded_backtests = load_backtests_from_directory(
|
|
1198
|
-
directory_path=path,
|
|
1199
|
-
filter_function=load_backtest_filter_fn
|
|
1200
|
-
)
|
|
1201
|
-
|
|
1202
|
-
for backtest in loaded_backtests:
|
|
1203
|
-
backtests_ordered_by_strategy.setdefault(
|
|
1204
|
-
backtest.metadata["id"], []
|
|
1205
|
-
).append(backtest)
|
|
1206
|
-
|
|
1207
|
-
# Remove all temp storage directories
|
|
1208
|
-
shutil.rmtree(path)
|
|
1209
|
-
else:
|
|
1210
|
-
# Remove all strategies that are not in the final selection
|
|
1211
|
-
backtests_ordered_by_strategy = {
|
|
1212
|
-
strategy_id: backtests
|
|
1213
|
-
for strategy_id, backtests in
|
|
1214
|
-
backtests_ordered_by_strategy.items()
|
|
1215
|
-
if strategy_id in strategy_id_selection
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
for strategy in backtests_ordered_by_strategy:
|
|
1219
|
-
backtests.append(
|
|
1220
|
-
combine_backtests(backtests_ordered_by_strategy[strategy])
|
|
1221
|
-
)
|
|
1222
|
-
|
|
1223
|
-
if backtest_storage_directory is not None:
|
|
1224
|
-
# Save final combined backtests to storage directory
|
|
1225
|
-
save_backtests_to_directory(
|
|
1226
|
-
backtests=backtests,
|
|
1227
|
-
directory_path=backtest_storage_directory,
|
|
1228
|
-
)
|
|
1229
|
-
|
|
1230
|
-
return backtests
|
|
1049
|
+
if use_checkpoints:
|
|
1050
|
+
sdsi = skip_data_sources_initialization
|
|
1051
|
+
return backtest_service.run_vector_backtests_with_checkpoints(
|
|
1052
|
+
strategies=strategies,
|
|
1053
|
+
backtest_date_range=backtest_date_range,
|
|
1054
|
+
backtest_date_ranges=backtest_date_ranges,
|
|
1055
|
+
snapshot_interval=snapshot_interval,
|
|
1056
|
+
risk_free_rate=risk_free_rate,
|
|
1057
|
+
initial_amount=initial_amount,
|
|
1058
|
+
skip_data_sources_initialization=sdsi,
|
|
1059
|
+
show_progress=show_progress,
|
|
1060
|
+
market=market,
|
|
1061
|
+
trading_symbol=trading_symbol,
|
|
1062
|
+
continue_on_error=continue_on_error,
|
|
1063
|
+
backtest_storage_directory=backtest_storage_directory,
|
|
1064
|
+
filter_function=filter_function
|
|
1065
|
+
)
|
|
1066
|
+
sdsi = skip_data_sources_initialization
|
|
1067
|
+
return backtest_service.run_vector_backtests(
|
|
1068
|
+
strategies=strategies,
|
|
1069
|
+
backtest_date_range=backtest_date_range,
|
|
1070
|
+
backtest_date_ranges=backtest_date_ranges,
|
|
1071
|
+
snapshot_interval=snapshot_interval,
|
|
1072
|
+
risk_free_rate=risk_free_rate,
|
|
1073
|
+
initial_amount=initial_amount,
|
|
1074
|
+
skip_data_sources_initialization=sdsi,
|
|
1075
|
+
show_progress=show_progress,
|
|
1076
|
+
market=market,
|
|
1077
|
+
trading_symbol=trading_symbol,
|
|
1078
|
+
continue_on_error=continue_on_error,
|
|
1079
|
+
filter_function=filter_function,
|
|
1080
|
+
backtest_storage_directory=backtest_storage_directory,
|
|
1081
|
+
)
|
|
1231
1082
|
|
|
1232
1083
|
def run_vector_backtest(
|
|
1233
1084
|
self,
|
|
@@ -1237,18 +1088,18 @@ class App:
|
|
|
1237
1088
|
metadata: Optional[Dict[str, str]] = None,
|
|
1238
1089
|
risk_free_rate: Optional[float] = None,
|
|
1239
1090
|
skip_data_sources_initialization: bool = False,
|
|
1240
|
-
show_data_initialization_progress: bool = True,
|
|
1241
1091
|
initial_amount: float = None,
|
|
1242
1092
|
market: str = None,
|
|
1243
1093
|
trading_symbol: str = None,
|
|
1244
1094
|
continue_on_error: bool = False,
|
|
1245
1095
|
backtest_storage_directory: Optional[Union[str, Path]] = None,
|
|
1246
|
-
use_checkpoints: bool =
|
|
1096
|
+
use_checkpoints: bool = False,
|
|
1097
|
+
show_progress=False,
|
|
1247
1098
|
) -> Backtest:
|
|
1248
1099
|
"""
|
|
1249
1100
|
Run vectorized backtests for a strategy. The provided
|
|
1250
|
-
strategy needs to have its '
|
|
1251
|
-
'
|
|
1101
|
+
strategy needs to have its 'generate_buy_signals' and
|
|
1102
|
+
'generate_sell_signals' methods implemented to support vectorized
|
|
1252
1103
|
backtesting.
|
|
1253
1104
|
|
|
1254
1105
|
Args:
|
|
@@ -1279,8 +1130,6 @@ class App:
|
|
|
1279
1130
|
initialization step. This will speed up the backtesting
|
|
1280
1131
|
process, but make sure that the data sources are already
|
|
1281
1132
|
initialized before calling this method.
|
|
1282
|
-
show_data_initialization_progress (bool): Whether to show the
|
|
1283
|
-
progress bar when initializing data sources.
|
|
1284
1133
|
market (str): The market to use for the backtest. This is used
|
|
1285
1134
|
to create a portfolio configuration if no portfolio
|
|
1286
1135
|
configuration is provided in the strategy.
|
|
@@ -1307,6 +1156,9 @@ class App:
|
|
|
1307
1156
|
backtest exists, it will be loaded
|
|
1308
1157
|
instead of running a new backtest. This is useful for
|
|
1309
1158
|
long-running backtests that might take a while to complete.
|
|
1159
|
+
show_progress (bool): Whether to show progress bars during
|
|
1160
|
+
data source initialization. This is useful for long-running
|
|
1161
|
+
initialization processes.
|
|
1310
1162
|
|
|
1311
1163
|
Returns:
|
|
1312
1164
|
Backtest: Instance of Backtest
|
|
@@ -1328,7 +1180,7 @@ class App:
|
|
|
1328
1180
|
self.initialize_data_sources_backtest(
|
|
1329
1181
|
strategy.data_sources,
|
|
1330
1182
|
backtest_date_range,
|
|
1331
|
-
show_progress=
|
|
1183
|
+
show_progress=show_progress
|
|
1332
1184
|
)
|
|
1333
1185
|
|
|
1334
1186
|
if risk_free_rate is None:
|
|
@@ -1360,6 +1212,16 @@ class App:
|
|
|
1360
1212
|
)
|
|
1361
1213
|
else:
|
|
1362
1214
|
try:
|
|
1215
|
+
|
|
1216
|
+
if show_progress:
|
|
1217
|
+
start_date = backtest_date_range \
|
|
1218
|
+
.start_date.strftime('%Y-%m-%d')
|
|
1219
|
+
end_date = backtest_date_range.end_date.strftime(
|
|
1220
|
+
'%Y-%m-%d')
|
|
1221
|
+
print(
|
|
1222
|
+
f"Running backtests for {start_date} to {end_date}"
|
|
1223
|
+
)
|
|
1224
|
+
|
|
1363
1225
|
run = backtest_service.create_vector_backtest(
|
|
1364
1226
|
strategy=strategy,
|
|
1365
1227
|
backtest_date_range=backtest_date_range,
|
|
@@ -1369,6 +1231,7 @@ class App:
|
|
|
1369
1231
|
initial_amount=initial_amount
|
|
1370
1232
|
)
|
|
1371
1233
|
backtest = Backtest(
|
|
1234
|
+
algorithm_id=strategy.algorithm_id,
|
|
1372
1235
|
backtest_runs=[run],
|
|
1373
1236
|
risk_free_rate=risk_free_rate,
|
|
1374
1237
|
backtest_summary=generate_backtest_summary_metrics(
|
|
@@ -1380,8 +1243,10 @@ class App:
|
|
|
1380
1243
|
f"Error occurred during vector backtest for strategy "
|
|
1381
1244
|
f"{strategy.strategy_id}: {str(e)}"
|
|
1382
1245
|
)
|
|
1246
|
+
|
|
1383
1247
|
if continue_on_error:
|
|
1384
1248
|
backtest = Backtest(
|
|
1249
|
+
algorithm_id=strategy.algorithm_id,
|
|
1385
1250
|
backtest_runs=[],
|
|
1386
1251
|
risk_free_rate=risk_free_rate,
|
|
1387
1252
|
)
|
|
@@ -1196,11 +1196,10 @@ class Context:
|
|
|
1196
1196
|
portfolio=None,
|
|
1197
1197
|
status=None,
|
|
1198
1198
|
order_id=None
|
|
1199
|
-
) ->
|
|
1199
|
+
) -> Trade:
|
|
1200
1200
|
"""
|
|
1201
|
-
Function to
|
|
1202
|
-
that
|
|
1203
|
-
is specified, the trades with the specified market will be returned.
|
|
1201
|
+
Function to retrieve a trade. This function will return the first
|
|
1202
|
+
trade that matches the specified query parameters.
|
|
1204
1203
|
|
|
1205
1204
|
Args:
|
|
1206
1205
|
market: The market of the asset
|
|
@@ -1211,7 +1210,7 @@ class Context:
|
|
|
1211
1210
|
trading_symbol: The trading symbol of the asset
|
|
1212
1211
|
|
|
1213
1212
|
Returns:
|
|
1214
|
-
|
|
1213
|
+
Trade: A instance of a trade that matches the query parameters
|
|
1215
1214
|
"""
|
|
1216
1215
|
query_params = {}
|
|
1217
1216
|
|
|
@@ -16,7 +16,12 @@ class TradingStrategy:
|
|
|
16
16
|
strategy is a set of rules that defines when to buy or sell an asset.
|
|
17
17
|
|
|
18
18
|
Attributes:
|
|
19
|
-
|
|
19
|
+
algorithm_id (string): the unique id for your
|
|
20
|
+
combined strategy instances. An algorithm consists out of one or
|
|
21
|
+
more strategy instances that run together. The algorithm_id
|
|
22
|
+
is used to uniquely indentify the combined strategy instances.
|
|
23
|
+
This is id is used in various places in the framework, e.g. for
|
|
24
|
+
backtesting results, logging, monitoring etc.
|
|
20
25
|
time_unit (TimeUnit): the time unit of the strategy that defines
|
|
21
26
|
when the strategy should run e.g. HOUR, DAY, WEEK, MONTH
|
|
22
27
|
interval (int): the interval of the strategy that defines how often
|
|
@@ -34,7 +39,7 @@ class TradingStrategy:
|
|
|
34
39
|
store additional information about the strategy, such as its
|
|
35
40
|
author, version, description, params etc.
|
|
36
41
|
"""
|
|
37
|
-
|
|
42
|
+
algorithm_id: str
|
|
38
43
|
time_unit: TimeUnit = None
|
|
39
44
|
interval: int = None
|
|
40
45
|
worker_id: str = None
|
|
@@ -52,7 +57,7 @@ class TradingStrategy:
|
|
|
52
57
|
|
|
53
58
|
def __init__(
|
|
54
59
|
self,
|
|
55
|
-
|
|
60
|
+
algorithm_id=None,
|
|
56
61
|
strategy_id=None,
|
|
57
62
|
time_unit=None,
|
|
58
63
|
interval=None,
|
|
@@ -66,7 +71,29 @@ class TradingStrategy:
|
|
|
66
71
|
worker_id=None,
|
|
67
72
|
decorated=None
|
|
68
73
|
):
|
|
69
|
-
|
|
74
|
+
if metadata is None:
|
|
75
|
+
metadata = {}
|
|
76
|
+
|
|
77
|
+
self.metadata = metadata
|
|
78
|
+
|
|
79
|
+
if worker_id is not None:
|
|
80
|
+
self.worker_id = worker_id
|
|
81
|
+
elif self.decorated:
|
|
82
|
+
self.worker_id = decorated.__name__
|
|
83
|
+
else:
|
|
84
|
+
self.worker_id = self.__class__.__name__
|
|
85
|
+
|
|
86
|
+
if strategy_id is not None:
|
|
87
|
+
self.strategy_id = strategy_id
|
|
88
|
+
else:
|
|
89
|
+
self.strategy_id = self.worker_id
|
|
90
|
+
|
|
91
|
+
if algorithm_id is not None:
|
|
92
|
+
self.algorithm_id = algorithm_id
|
|
93
|
+
|
|
94
|
+
if "algorithm_id" in self.metadata:
|
|
95
|
+
self.algorithm_id = self.metadata["algorithm_id"]
|
|
96
|
+
|
|
70
97
|
if time_unit is not None:
|
|
71
98
|
self.time_unit = TimeUnit.from_value(time_unit)
|
|
72
99
|
else:
|
|
@@ -85,29 +112,9 @@ class TradingStrategy:
|
|
|
85
112
|
if data_sources is not None:
|
|
86
113
|
self.data_sources = data_sources
|
|
87
114
|
|
|
88
|
-
if metadata is None:
|
|
89
|
-
metadata = {}
|
|
90
|
-
|
|
91
|
-
self.metadata = metadata
|
|
92
|
-
|
|
93
|
-
if "id" not in self.metadata:
|
|
94
|
-
self.metadata["id"] = self.id
|
|
95
|
-
|
|
96
115
|
if decorated is not None:
|
|
97
116
|
self.decorated = decorated
|
|
98
117
|
|
|
99
|
-
if worker_id is not None:
|
|
100
|
-
self.worker_id = worker_id
|
|
101
|
-
elif self.decorated:
|
|
102
|
-
self.worker_id = decorated.__name__
|
|
103
|
-
else:
|
|
104
|
-
self.worker_id = self.__class__.__name__
|
|
105
|
-
|
|
106
|
-
if strategy_id is not None:
|
|
107
|
-
self.strategy_id = strategy_id
|
|
108
|
-
else:
|
|
109
|
-
self.strategy_id = self.worker_id
|
|
110
|
-
|
|
111
118
|
if position_sizes is not None:
|
|
112
119
|
self.position_sizes = position_sizes
|
|
113
120
|
|
|
@@ -3,13 +3,13 @@ from dependency_injector import containers, providers
|
|
|
3
3
|
from investing_algorithm_framework.app.algorithm import AlgorithmFactory
|
|
4
4
|
from investing_algorithm_framework.app.context import Context
|
|
5
5
|
from investing_algorithm_framework.infrastructure import SQLOrderRepository, \
|
|
6
|
-
SQLPositionRepository, SQLPortfolioRepository, \
|
|
6
|
+
SQLPositionRepository, SQLPortfolioRepository, BacktestService, \
|
|
7
7
|
SQLPortfolioSnapshotRepository, SQLTradeRepository, \
|
|
8
8
|
SQLPositionSnapshotRepository, SQLTradeStopLossRepository, \
|
|
9
9
|
SQLTradeTakeProfitRepository, SQLOrderMetadataRepository
|
|
10
10
|
from investing_algorithm_framework.services import OrderService, \
|
|
11
11
|
PositionService, PortfolioService, PortfolioConfigurationService, \
|
|
12
|
-
|
|
12
|
+
ConfigurationService, PortfolioSnapshotService, \
|
|
13
13
|
PositionSnapshotService, MarketCredentialService, TradeService, \
|
|
14
14
|
PortfolioSyncService, OrderExecutorLookup, PortfolioProviderLookup, \
|
|
15
15
|
DataProviderService, TradeTakeProfitService, TradeStopLossService
|
|
@@ -37,7 +37,8 @@ from .utils import random_string, append_dict_as_row_to_csv, \
|
|
|
37
37
|
from .backtesting import BacktestRun, BacktestSummaryMetrics, \
|
|
38
38
|
BacktestDateRange, Backtest, BacktestMetrics, combine_backtests, \
|
|
39
39
|
BacktestPermutationTest, BacktestEvaluationFocus, \
|
|
40
|
-
generate_backtest_summary_metrics
|
|
40
|
+
generate_backtest_summary_metrics, load_backtests_from_directory, \
|
|
41
|
+
save_backtests_to_directory
|
|
41
42
|
|
|
42
43
|
__all__ = [
|
|
43
44
|
"OrderStatus",
|
|
@@ -143,5 +144,7 @@ __all__ = [
|
|
|
143
144
|
'generate_backtest_summary_metrics',
|
|
144
145
|
'DataError',
|
|
145
146
|
'TakeProfitRule',
|
|
146
|
-
'StopLossRule'
|
|
147
|
+
'StopLossRule',
|
|
148
|
+
"load_backtests_from_directory",
|
|
149
|
+
"save_backtests_to_directory",
|
|
147
150
|
]
|
|
@@ -7,6 +7,8 @@ from .backtest_permutation_test import BacktestPermutationTest
|
|
|
7
7
|
from .backtest_evaluation_focuss import BacktestEvaluationFocus
|
|
8
8
|
from .combine_backtests import combine_backtests, \
|
|
9
9
|
generate_backtest_summary_metrics
|
|
10
|
+
from .backtest_utils import load_backtests_from_directory, \
|
|
11
|
+
save_backtests_to_directory
|
|
10
12
|
|
|
11
13
|
__all__ = [
|
|
12
14
|
"Backtest",
|
|
@@ -17,5 +19,7 @@ __all__ = [
|
|
|
17
19
|
"BacktestPermutationTest",
|
|
18
20
|
"BacktestEvaluationFocus",
|
|
19
21
|
"combine_backtests",
|
|
20
|
-
"generate_backtest_summary_metrics"
|
|
22
|
+
"generate_backtest_summary_metrics",
|
|
23
|
+
"load_backtests_from_directory",
|
|
24
|
+
"save_backtests_to_directory",
|
|
21
25
|
]
|