investing-algorithm-framework 7.0.0__tar.gz → 7.0.2__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.0.0 → investing_algorithm_framework-7.0.2}/PKG-INFO +1 -1
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/analysis/ranking.py +2 -2
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/ascii.py +1 -1
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/tables/key_metrics_table.py +5 -2
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/tables/trade_metrics_table.py +5 -5
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/__init__.py +2 -1
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/backtesting/backtest_metrics.py +6 -6
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/trade/trade.py +5 -1
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/generate.py +2 -2
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/pyproject.toml +1 -1
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/LICENSE +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/README.md +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/algorithm/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/algorithm/algorithm.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/algorithm/algorithm_factory.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/analysis/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/analysis/backtest_data_ranges.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/app.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/app_hook.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/context.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/eventloop.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/backtest_report.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/charts/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/charts/monthly_returns_heatmap.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/generate.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/tables/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/tables/stop_loss_table.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/tables/time_metrics_table.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/tables/trades_table.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/tables/utils.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/reporting/templates/report_template.html.j2 +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/strategy.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/task.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/controllers/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/controllers/orders.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/controllers/positions.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/create_app.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/error_handler.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/responses.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/schemas/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/schemas/order.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/app/web/setup_cors.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/cli.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/deploy_to_aws_lambda.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/deploy_to_azure_function.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/initialize_app.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/.gitignore.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/app.py.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/app_aws_lambda_function.py.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/app_azure_function.py.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/app_web.py.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/aws_lambda_dockerfile.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/aws_lambda_dockerignore.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/aws_lambda_readme.md.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/aws_lambda_requirements.txt.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/azure_function_function_app.py.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/azure_function_host.json.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/azure_function_local.settings.json.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/azure_function_requirements.txt.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/data_providers.py.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/env.example.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/env_azure_function.example.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/market_data_providers.py.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/readme.md.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/requirements.txt.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/run_backtest.py.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/cli/templates/strategy.py.template +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/create_app.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/dependency_container.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/backtesting/backtest.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/backtesting/backtest_date_range.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/backtesting/backtest_position.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/backtesting/backtest_results.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/config.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/constants.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/data_provider.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/data_structures.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/exceptions.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/app_mode.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/base_model.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/data/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/data/data_source.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/data/data_type.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/event.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/market/market_credential.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/order/order.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/order/order_side.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/order/order_status.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/order/order_type.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/position/position.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/snapshot_interval.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/strategy_profile.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/time_frame.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/tracing/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/tracing/trace.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/trade/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/trade/trade_risk_type.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/trade/trade_status.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/trade/trade_stop_loss.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/models/trade/trade_take_profit.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/order_executor.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/portfolio_provider.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/services/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/services/observable.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/services/observer.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/services/rounding_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/services/state_handler.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/strategy.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/utils/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/utils/csv.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/utils/custom_tqdm.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/utils/dates.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/utils/jupyter_notebook_detection.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/utils/polars.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/utils/random.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/download_data.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/data_providers/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/data_providers/ccxt.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/data_providers/csv.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/data_providers/pandas.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/order/order.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/order/order_metadata.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/order_trade_association.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/portfolio/sql_portfolio.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/position/position.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/trades/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/trades/trade.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/trades/trade_stop_loss.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/models/trades/trade_take_profit.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/order_executors/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/order_executors/backtest_oder_executor.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/order_executors/ccxt_order_executor.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/portfolio_providers/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/portfolio_providers/ccxt_portfolio_provider.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/order_metadata_repository.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/repository.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/trade_repository.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/trade_stop_loss_repository.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/repositories/trade_take_profit_repository.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/services/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/services/aws/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/services/aws/state_handler.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/services/azure/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/services/azure/state_handler.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/services/performance_service/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/services/performance_service/backtest_performance_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/services/performance_service/performance_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/unit_of_work/in_memory.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/infrastructure/unit_of_work/sqlalchemy.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/backtesting/backtest_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/configuration_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/data_providers/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/data_providers/data_provider_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/alpha.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/beta.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/cagr.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/calmar_ratio.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/drawdown.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/equity_curve.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/exposure.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/mean_daily_return.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/price_efficiency.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/profit_factor.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/recovery.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/returns.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/risk_free_rate.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/sharpe_ratio.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/sortino_ratio.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/standard_deviation.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/treynor_ratio.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/ulcer.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/value_at_risk.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/volatility.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/metrics/win_rate.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/order_service/order_backtest_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/order_service/order_executor_lookup.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/order_service/order_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/portfolios/backtest_portfolio_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/portfolios/portfolio_configuration_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/portfolios/portfolio_provider_lookup.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/portfolios/portfolio_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/portfolios/portfolio_snapshot_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/positions/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/positions/position_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/positions/position_snapshot_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/repository_service.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/trade_order_evaluator/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/trade_order_evaluator/backtest_trade_oder_evaluator.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/trade_order_evaluator/default_trade_order_evaluator.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/trade_order_evaluator/trade_order_evaluator.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/trade_service/__init__.py +0 -0
- {investing_algorithm_framework-7.0.0 → investing_algorithm_framework-7.0.2}/investing_algorithm_framework/services/trade_service/trade_service.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from investing_algorithm_framework.domain import Backtest
|
|
2
2
|
|
|
3
3
|
defaults_ranking_weights = {
|
|
4
|
-
"
|
|
4
|
+
"total_net_gain": 2.0,
|
|
5
5
|
"sharpe_ratio": 1.0,
|
|
6
6
|
"sortino_ratio": 1.0,
|
|
7
7
|
"win_rate": 1.0,
|
|
@@ -17,7 +17,7 @@ def compute_score(metrics: dict, weights: dict) -> float:
|
|
|
17
17
|
score = 0
|
|
18
18
|
for key, weight in weights.items():
|
|
19
19
|
|
|
20
|
-
# Metrics are
|
|
20
|
+
# Metrics are attributes to the backtest
|
|
21
21
|
if not hasattr(metrics, key):
|
|
22
22
|
continue
|
|
23
23
|
|
|
@@ -810,7 +810,7 @@ def pretty_print_backtest(
|
|
|
810
810
|
.:-=*%%%%. {COLOR_PURPLE}+={COLOR_RESET} .%%# {COLOR_PURPLE}-+.-{COLOR_RESET}%%%%=-:.. {COLOR_YELLOW}Number of orders:{COLOR_RESET}{COLOR_GREEN} {backtest_results.number_of_orders}{COLOR_RESET}
|
|
811
811
|
.:=+#%%%%%*###%%%%#*+#%%%%%%*+-: {COLOR_YELLOW}Initial balance:{COLOR_RESET}{COLOR_GREEN} {backtest_results.initial_unallocated}{COLOR_RESET}
|
|
812
812
|
+%%%%%%%%%%%%%%%%%%%= {COLOR_YELLOW}Final balance:{COLOR_RESET}{COLOR_GREEN} {float(backtest_metrics.final_value):.{price_precision}f}{COLOR_RESET}
|
|
813
|
-
:++ .=#%%%%%%%%%%%%%*- {COLOR_YELLOW}Total net gain:{COLOR_RESET}{COLOR_GREEN} {float(backtest_metrics.
|
|
813
|
+
:++ .=#%%%%%%%%%%%%%*- {COLOR_YELLOW}Total net gain:{COLOR_RESET}{COLOR_GREEN} {float(backtest_metrics.total_net_gain):.{price_precision}f} {float(backtest_metrics.total_net_gain_percentage):.{percentage_precision}f}%{COLOR_RESET}
|
|
814
814
|
:++: :+%%%%%%#-. {COLOR_YELLOW}Growth:{COLOR_RESET}{COLOR_GREEN} {float(backtest_results.growth):.{price_precision}f} {float(backtest_results.growth_percentage):.{percentage_precision}f}%{COLOR_RESET}
|
|
815
815
|
:++: .%%%%%#= {COLOR_YELLOW}Number of trades:{COLOR_RESET}{COLOR_GREEN} {backtest_results.number_of_trades}{COLOR_RESET}
|
|
816
816
|
:++: .%%%%%#= {COLOR_YELLOW}Number of trades closed:{COLOR_RESET}{COLOR_GREEN} {backtest_results.number_of_trades_closed}{COLOR_RESET}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import pandas as pd
|
|
2
2
|
|
|
3
|
-
from .utils import safe_format,
|
|
3
|
+
from .utils import safe_format, safe_format_percentage
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def highlight_sharpe_and_sortino(row):
|
|
@@ -153,7 +153,10 @@ def create_html_key_metrics_table(results, report):
|
|
|
153
153
|
format_str = "{:.2f}"
|
|
154
154
|
|
|
155
155
|
# Format some values to percentages and floats
|
|
156
|
-
copy_results['Total Return'] =
|
|
156
|
+
copy_results['Total Return'] = (
|
|
157
|
+
f"{safe_format(copy_results['total_net_gain'], format_str)} "
|
|
158
|
+
f"({safe_format_percentage(copy_results['total_net_gain_percentage'], format_str)}%)"
|
|
159
|
+
)
|
|
157
160
|
copy_results['CAGR'] = f"{safe_format_percentage(copy_results['cagr'],format_str)}%"
|
|
158
161
|
copy_results['Sharpe Ratio'] = safe_format(copy_results['sharpe_ratio'], format_str)
|
|
159
162
|
copy_results['Sortino Ratio'] = safe_format(copy_results['sortino_ratio'], format_str)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import pandas as pd
|
|
2
2
|
|
|
3
|
+
from investing_algorithm_framework.domain import DEFAULT_DATETIME_FORMAT
|
|
3
4
|
from .utils import safe_format, safe_format_date, safe_format_percentage
|
|
4
5
|
|
|
5
6
|
|
|
@@ -75,17 +76,16 @@ def create_html_trade_metrics_table(results, report):
|
|
|
75
76
|
copy_results["Best Trade"] = "N/A"
|
|
76
77
|
copy_results['Best Trade Date'] = "N/A"
|
|
77
78
|
else:
|
|
78
|
-
copy_results['Best Trade'] = f"{
|
|
79
|
-
copy_results['Best Trade Date'] =
|
|
80
|
-
|
|
79
|
+
copy_results['Best Trade'] = f"{best_trade['net_gain']:.2f} {report.trading_symbol}"
|
|
80
|
+
copy_results['Best Trade Date'] = safe_format_date(best_trade["opened_at"], format_str=DEFAULT_DATETIME_FORMAT)
|
|
81
81
|
worst_trade = copy_results['worst_trade']
|
|
82
82
|
|
|
83
83
|
if worst_trade is None:
|
|
84
84
|
copy_results["Worst Trade"] = "N/A"
|
|
85
85
|
copy_results['Worst Trade Date'] = "N/A"
|
|
86
86
|
else:
|
|
87
|
-
copy_results['Worst Trade'] = f"{
|
|
88
|
-
copy_results['Worst Trade Date'] =
|
|
87
|
+
copy_results['Worst Trade'] = f"{worst_trade['net_gain']:.2f} {report.trading_symbol}"
|
|
88
|
+
copy_results['Worst Trade Date'] = safe_format_date(worst_trade['opened_at'], format_str=DEFAULT_DATETIME_FORMAT)
|
|
89
89
|
|
|
90
90
|
copy_results['Trades Average Gain'] = f"{safe_format(copy_results['trades_average_gain'][0], string_format)} {report.trading_symbol} {copy_results['trades_average_gain'][1]:.2f}%"
|
|
91
91
|
copy_results['Trades Average Loss'] = f"{safe_format(copy_results['trades_average_loss'][0], string_format)} {report.trading_symbol} {copy_results['trades_average_loss'][1]:.2f}%"
|
|
@@ -11,7 +11,7 @@ from .constants import ITEMIZE, ITEMIZED, PER_PAGE, PAGE, ENVIRONMENT, \
|
|
|
11
11
|
APP_MODE, DATABASE_DIRECTORY_NAME, BACKTESTING_INITIAL_AMOUNT, \
|
|
12
12
|
APPLICATION_DIRECTORY, SNAPSHOT_INTERVAL, AWS_S3_STATE_BUCKET_NAME, \
|
|
13
13
|
LAST_SNAPSHOT_DATETIME, DATA_DIRECTORY, INDEX_DATETIME, \
|
|
14
|
-
DATETIME_FORMAT_FILE_NAME
|
|
14
|
+
DATETIME_FORMAT_FILE_NAME, DEFAULT_DATETIME_FORMAT
|
|
15
15
|
from .data_provider import DataProvider
|
|
16
16
|
from .data_structures import PeekableQueue
|
|
17
17
|
from .decimal_parsing import parse_decimal_to_string, parse_string_to_decimal
|
|
@@ -142,4 +142,5 @@ __all__ = [
|
|
|
142
142
|
"DATETIME_FORMAT_FILE_NAME",
|
|
143
143
|
"is_jupyter_notebook",
|
|
144
144
|
"tqdm",
|
|
145
|
+
"DEFAULT_DATETIME_FORMAT",
|
|
145
146
|
]
|
|
@@ -30,8 +30,8 @@ class BacktestMetrics:
|
|
|
30
30
|
over the backtest period.
|
|
31
31
|
final_value (float): The final value of the portfolio at the end
|
|
32
32
|
of the backtest.
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
total_net_gain (float): The total return of the backtest.
|
|
34
|
+
total_net_gain_percentage (float): The total return percentage
|
|
35
35
|
cagr (float): The compound annual growth rate of the backtest.
|
|
36
36
|
sharpe_ratio (float): The Sharpe ratio of the backtest, indicating
|
|
37
37
|
risk-adjusted return.
|
|
@@ -102,8 +102,8 @@ class BacktestMetrics:
|
|
|
102
102
|
equity_curve: List[Tuple[float, datetime]] = field(default_factory=list)
|
|
103
103
|
growth: float = 0.0
|
|
104
104
|
growth_percentage: float = 0.0
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
total_net_gain: float = 0.0
|
|
106
|
+
total_net_gain_percentage: float = 0.0
|
|
107
107
|
final_value: float = 0.0
|
|
108
108
|
cagr: float = 0.0
|
|
109
109
|
sharpe_ratio: float = 0.0
|
|
@@ -155,8 +155,8 @@ class BacktestMetrics:
|
|
|
155
155
|
"backtest_end_date": self.backtest_end_date.isoformat(),
|
|
156
156
|
"equity_curve": [(value, date.isoformat())
|
|
157
157
|
for value, date in self.equity_curve],
|
|
158
|
-
"
|
|
159
|
-
"
|
|
158
|
+
"total_net_gain": self.total_net_gain,
|
|
159
|
+
"total_net_gain_percentage": self.total_net_gain_percentage,
|
|
160
160
|
"final_value": self.final_value,
|
|
161
161
|
"cagr": self.cagr,
|
|
162
162
|
"sharpe_ratio": self.sharpe_ratio,
|
|
@@ -250,7 +250,11 @@ class Trade(BaseModel):
|
|
|
250
250
|
cost = self.available_amount * self.open_price
|
|
251
251
|
gain = (self.available_amount * self.last_reported_price) - cost
|
|
252
252
|
gain += self.net_gain
|
|
253
|
-
|
|
253
|
+
|
|
254
|
+
if cost != 0:
|
|
255
|
+
return (gain / cost) * 100
|
|
256
|
+
|
|
257
|
+
return 0
|
|
254
258
|
|
|
255
259
|
def to_dict(self, datetime_format=None):
|
|
256
260
|
|
|
@@ -46,8 +46,8 @@ def create_backtest_metrics(
|
|
|
46
46
|
backtest_end_date=backtest_results.backtest_end_date,
|
|
47
47
|
equity_curve=get_equity_curve(backtest_results.portfolio_snapshots),
|
|
48
48
|
final_value=get_final_value(backtest_results.portfolio_snapshots),
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
total_net_gain=total_return[0],
|
|
50
|
+
total_net_gain_percentage=total_return[1],
|
|
51
51
|
cagr=get_cagr(backtest_results.portfolio_snapshots),
|
|
52
52
|
sharpe_ratio=get_sharpe_ratio(
|
|
53
53
|
backtest_results.portfolio_snapshots,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|