investing-algorithm-framework 8.9.0__tar.gz → 9.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- investing_algorithm_framework-9.0.0/PKG-INFO +799 -0
- investing_algorithm_framework-9.0.0/README.md +749 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/__init__.py +598 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/__init__.py +42 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/backtest_data_ranges.py +287 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/backtest_window_analysis.py +537 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/bundle_inspection.py +124 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/markdown.py +1328 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/analysis/ranking.py +92 -12
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/robustness.py +173 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/top_selection.py +130 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/__init__.py +4 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/algorithm/algorithm.py +10 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/algorithm/algorithm_factory.py +13 -4
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/algorithm_runner.py +315 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/app.py +3635 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/confluence_scoring_strategy.py +312 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/confluence_signal_support.py +195 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/context.py +645 -41
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/eventloop.py +1424 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/native_schedule.py +55 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/ascii.py +6 -4
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/backtest_report.py +236 -27
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/charts/__init__.py +0 -2
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/_finterion_render.py +71 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py +54 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/equity_curve.py +38 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +51 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/charts/monthly_returns_heatmap.py +15 -35
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py +45 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +49 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +40 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/generate.py +2 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/templates/dashboard.css +2 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/templates/dashboard.js +123 -72
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/strategy.py +564 -561
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/task.py +16 -10
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/__init__.py +5 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/controllers/__init__.py +22 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/controllers/algorithm.py +204 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/controllers/orders.py +11 -5
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/controllers/portfolio.py +73 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/controllers/positions.py +11 -5
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/controllers/run_reports.py +31 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/controllers/trades.py +38 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/create_app.py +17 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/error_handler.py +17 -11
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/responses.py +7 -4
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/schemas/__init__.py +25 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/schemas/order.py +1 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/schemas/portfolio_order_cost.py +12 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/schemas/portfolio_order_cost_specification.py +11 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/schemas/run_report.py +25 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/schemas/trade.py +21 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/setup_cors.py +12 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/cli.py +34 -7
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/deploy_to_aws_lambda.py +10 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/deploy_to_azure_function.py +16 -4
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/cli/index_command.py +799 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/initialize_app.py +1 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/mcp_server.py +37 -12
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/app_aws_lambda_function.py.template +23 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/azure_function_function_app.py.template +43 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/cli/templates/run_backtest.py.template +29 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/strategy.py.template +43 -14
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/validate_backtest_checkpoints.py +7 -3
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/dependency_container.py +19 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/__init__.py +136 -11
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/__init__.py +107 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest.py +1781 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest_engine.py +56 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_evaluation_focuss.py +2 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_index_row.py +17 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_metrics.py +208 -73
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/backtesting/backtest_permutation_test.py → investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest_monte_carlo_test.py +164 -37
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest_run.py +726 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest_run_configuration.py +220 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_summary_metrics.py +81 -7
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_utils.py +457 -95
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest_window.py +268 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/bundle.py +1522 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/combine_backtests.py +429 -50
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/execution_config.py +199 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/history.py +237 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/record_schemas.py +139 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/records.py +606 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/run_report_storage.py +104 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/study.py +878 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/universe.py +75 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/blotter.py +244 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/config.py +21 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/constants.py +1 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/data_provider.py +19 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/indicators.py +520 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/__init__.py +124 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/conflict_policy.py +316 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/confluence.py +882 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/confluence_frame.py +251 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/confluence_native.py +71 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/confluence_score.py +926 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/data/data_source.py +12 -19
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/decision_trace.py +248 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/order/order.py +81 -10
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/order/order_side.py +7 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/order/order_status.py +13 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/portfolio/__init__.py +4 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/portfolio/paper_trading_mode.py +21 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +13 -2
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +246 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +30 -1
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/portfolio/position_mode.py +6 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/position/position.py +155 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/position/position_size.py +19 -2
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/position/position_snapshot.py +100 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/risk_rules/__init__.py +2 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/risk_rules/cooldown_rule.py +30 -13
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/risk_rules/exposure_rule.py +53 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/risk_rules/scaling_rule.py +33 -4
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/risk_rules/stop_loss_rule.py +84 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/risk_rules/take_profit_rule.py +37 -1
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/risk_rules/trading_cost.py +181 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/run_report.py +307 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/scheduling/__init__.py +25 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/scheduling/date_rule.py +141 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/scheduling/schedule.py +242 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/scheduling/scheduled_function.py +72 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/scheduling/time_rule.py +140 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/score_card.py +13 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/signal.py +219 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/signal_helpers.py +347 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/signal_series.py +121 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/strategy_profile.py +50 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/time_frame.py +139 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/trade/trade.py +109 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/trade/trade_stop_loss.py +82 -4
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/trade/trade_take_profit.py +110 -2
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/native_event.py +89 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/optimization.py +535 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/order_executor.py +21 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/__init__.py +1 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/factor.py +2 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/pipeline.py +65 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/portfolio_provider.py +10 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/rounding_service.py +4 -5
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/__init__.py +3 -1
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/amounts.py +16 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/cash.py +12 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/custom_tqdm.py +52 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/dates.py +96 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/immutable.py +26 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/polars.py +9 -4
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/rule_symbols.py +19 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/__init__.py +9 -4
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/ccxt.py +376 -271
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/csv.py +8 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/ohlcv_base.py +24 -4
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +325 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/__init__.py +2 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/order/order.py +8 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +6 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/portfolio/sql_portfolio.py +18 -4
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/models/position/position.py +180 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +4 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/models/run_report/__init__.py +3 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/models/run_report/run_report.py +127 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/trades/trade.py +66 -3
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/trades/trade_stop_loss.py +5 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/trades/trade_take_profit.py +5 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/order_executors/__init__.py +2 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/order_executors/ccxt_order_executor.py +77 -4
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/order_executors/paper_trading_order_executor.py +138 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/portfolio_providers/__init__.py +2 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/portfolio_providers/ccxt_portfolio_provider.py +73 -4
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/portfolio_providers/paper_trading_portfolio_provider.py +47 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/__init__.py +3 -1
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/repositories/event_memory.py +479 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/repositories/event_snapshot_archive.py +356 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +15 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/repository.py +33 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/repositories/run_report_repository.py +65 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/trade_allocation_repository.py +6 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/trade_repository.py +10 -4
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/aws/state_handler.py +12 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/azure/state_handler.py +4 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/backtesting/backtest_service.py +1449 -733
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/backtesting/event_backtest_service.py +64 -48
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/event_workers.py +94 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/optimization.py +764 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/schedule_generation.py +75 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/vector_backtest_service.py +2451 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/vector_native.py +289 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/vector_resources.py +301 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/vector_session_index.py +174 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/notebook/magic.py +63 -34
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/__init__.py +11 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_index/sqlite_index.py +304 -23
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_store/__init__.py +7 -3
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_store/base.py +31 -1
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_store/decompose.py +8 -4
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_store/local_dir_store.py +14 -11
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_store/local_tiered_store.py +114 -17
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/backtest_store/recording.py +124 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/backtest_store/streaming.py +359 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/configuration_service.py +6 -9
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/confluence_indicator_engine.py +247 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/confluence_reporting.py +98 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/data_providers/data_provider_service.py +86 -31
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/data_providers/prepared_market_data.py +195 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/executors/__init__.py +29 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/executors/base.py +127 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/executors/limit.py +58 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/executors/market.py +58 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/indicator_engine.py +1304 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/__init__.py +11 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/_returns_helper.py +3 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/calmar_ratio.py +6 -2
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/consistency.py +137 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/drawdown.py +29 -27
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/generate.py +185 -63
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/inputs.py +65 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/mae_mfe.py +95 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/native.py +65 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/omega_ratio.py +58 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/returns.py +28 -17
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/sortino_ratio.py +17 -5
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/standard_deviation.py +26 -26
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/trades.py +101 -1
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/ulcer.py +55 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/native_accounting.py +74 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/order_service/order_backtest_service.py +27 -4
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/order_service/order_executor_lookup.py +2 -2
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/order_service/order_service.py +2145 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/portfolio_configuration_service.py +22 -2
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/portfolio_service.py +117 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +11 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/positions/position_service.py +141 -28
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/positions/position_snapshot_service.py +4 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/run_reports/__init__.py +3 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/run_reports/run_report_service.py +29 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/run_reports/snapshot.py +409 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/__init__.py +57 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/apply_risk_budget.py +126 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/attach_risk_rules.py +103 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/base.py +49 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/collect_signals.py +132 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/default.py +52 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/emit_orders.py +92 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/evaluate_indicators.py +37 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/evaluate_pipelines.py +210 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/phase_state.py +186 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/record_cooldown.py +199 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/resolve_conflicts.py +349 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/size_positions.py +343 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_hooks/__init__.py +6 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_hooks/trade_hook_dispatcher.py +114 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_order_evaluator/backtest_trade_oder_evaluator.py +122 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_order_evaluator/default_trade_order_evaluator.py +154 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_order_evaluator/native.py +65 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_order_evaluator/trade_order_evaluator.py +450 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_service/trade_service.py +1660 -0
- investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_service/trade_stop_loss_service.py +54 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/trade_service/trade_take_profit_service.py +21 -6
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/pyproject.toml +22 -15
- investing_algorithm_framework-8.9.0/PKG-INFO +0 -721
- investing_algorithm_framework-8.9.0/README.md +0 -676
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/__init__.py +0 -287
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/analysis/__init__.py +0 -22
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/analysis/backtest_data_ranges.py +0 -202
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/analysis/backtest_window_analysis.py +0 -364
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/analysis/markdown.py +0 -91
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/app.py +0 -2686
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/eventloop.py +0 -970
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/reporting/backtest_report_old.py +0 -352
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py +0 -66
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/reporting/charts/equity_curve.py +0 -37
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +0 -74
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/reporting/charts/line_chart.py +0 -11
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py +0 -51
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +0 -79
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +0 -55
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/web/__init__.py +0 -5
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/web/controllers/__init__.py +0 -13
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -20
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/web/create_app.py +0 -20
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/web/schemas/__init__.py +0 -12
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/app/web/setup_cors.py +0 -6
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/cli/index_command.py +0 -387
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/cli/templates/run_backtest.py.template +0 -20
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/backtesting/__init__.py +0 -49
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/backtesting/backtest.py +0 -866
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/backtesting/backtest_run.py +0 -828
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/backtesting/bundle.py +0 -772
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/models/__init__.py +0 -56
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -111
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/models/position/position.py +0 -68
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -47
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/models/risk_rules/stop_loss_rule.py +0 -51
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/models/risk_rules/trading_cost.py +0 -89
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/models/strategy_profile.py +0 -33
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/models/time_frame.py +0 -178
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/utils/custom_tqdm.py +0 -22
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/domain/utils/dates.py +0 -56
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +0 -188
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/infrastructure/models/position/position.py +0 -65
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/infrastructure/services/backtesting/checkpoint_manifest.py +0 -240
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/infrastructure/services/backtesting/vector_backtest_service.py +0 -1137
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/services/metrics/consistency.py +0 -13
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/services/metrics/ulcer.py +0 -0
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/services/order_service/order_service.py +0 -880
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/services/trade_order_evaluator/backtest_trade_oder_evaluator.py +0 -338
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/services/trade_order_evaluator/default_trade_order_evaluator.py +0 -51
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/services/trade_order_evaluator/trade_order_evaluator.py +0 -93
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/services/trade_service/trade_service.py +0 -1145
- investing_algorithm_framework-8.9.0/investing_algorithm_framework/services/trade_service/trade_stop_loss_service.py +0 -39
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/LICENSE +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/algorithm/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/app_hook.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/key_metrics_table.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/stop_loss_table.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/time_metrics_table.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/trade_metrics_table.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/trades_table.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/utils.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/templates/dashboard_template.html.j2 +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/templates/report_template.html.j2 +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/migrate_store_command.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/.gitignore.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/app.py.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/app_azure_function.py.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/app_web.py.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/aws_lambda_dockerfile.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/aws_lambda_dockerignore.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/aws_lambda_readme.md.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/aws_lambda_requirements.txt.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/azure_function_host.json.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/azure_function_local.settings.json.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/azure_function_requirements.txt.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/data_providers.py.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/env.example.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/env_azure_function.example.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/market_data_providers.py.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/readme.md.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/requirements.txt.template +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/create_app.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/algorithm_id.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_date_range.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/consistency.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/templates/backtest.html +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/templates/finterion-dark.png +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/templates/finterion-light.png +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/data_structures.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/datetime_parsing.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/exceptions.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/fx.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/app_mode.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/base_model.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/data/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/data/data_type.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/event.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/market/market_credential.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/order/order_type.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/portfolio/sync.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/snapshot_interval.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/tracing/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/tracing/trace.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/trade/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/trade/trade_status.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/custom_factor.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/factors/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/factors/builtin.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/filter.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/state_handler.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/strategy.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/csv.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/jupyter_notebook_detection.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/random.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/download_data.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/alpha_vantage.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/base_url.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/csv_url.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/json_url.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/pandas.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/parquet_url.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/polygon.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/yahoo.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/order/trade_allocation.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/order_trade_association.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/trades/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/trade_stop_loss_repository.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/trade_take_profit_repository.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/aws/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/azure/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/notebook/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_index/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/data_providers/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/data_providers/data.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/alpha.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/beta.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/cagr.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/equity_curve.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/exposure.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/mean_daily_return.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/price_efficiency.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/profit_factor.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/recovery.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/risk_free_rate.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/sharpe_ratio.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/treynor_ratio.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/value_at_risk.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/volatility.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/win_rate.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/pipeline/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/pipeline/pipeline_engine.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/pipeline/vector_pipeline_engine.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/backtest_portfolio_service.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/broker_balance_tracker.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/portfolio_provider_lookup.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/portfolio_snapshot_service.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/positions/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/repository_service.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/trade_order_evaluator/__init__.py +0 -0
- {investing_algorithm_framework-8.9.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/trade_service/__init__.py +0 -0
|
@@ -0,0 +1,799 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: investing-algorithm-framework
|
|
3
|
+
Version: 9.0.0
|
|
4
|
+
Summary: A framework for creating trading bots
|
|
5
|
+
Author: MDUYN
|
|
6
|
+
Requires-Python: >=3.10,<4.0
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Provides-Extra: all
|
|
12
|
+
Provides-Extra: alpha-vantage
|
|
13
|
+
Provides-Extra: aws
|
|
14
|
+
Provides-Extra: azure
|
|
15
|
+
Provides-Extra: notebook
|
|
16
|
+
Provides-Extra: polygon
|
|
17
|
+
Provides-Extra: yahoo
|
|
18
|
+
Requires-Dist: SQLAlchemy (>=2.0.18)
|
|
19
|
+
Requires-Dist: alpha_vantage (>=3.0.0,<4.0.0) ; extra == "alpha-vantage" or extra == "all"
|
|
20
|
+
Requires-Dist: azure-identity (>=1.19.0,<2.0.0) ; extra == "azure" or extra == "all"
|
|
21
|
+
Requires-Dist: azure-mgmt-resource (>=23.2.0,<24.0.0) ; extra == "azure" or extra == "all"
|
|
22
|
+
Requires-Dist: azure-mgmt-storage (>=21.2.1,<22.0.0) ; extra == "azure" or extra == "all"
|
|
23
|
+
Requires-Dist: azure-mgmt-web (>=7.3.1,<8.0.0) ; extra == "azure" or extra == "all"
|
|
24
|
+
Requires-Dist: azure-storage-blob (>=12.24.0,<13.0.0) ; extra == "azure" or extra == "all"
|
|
25
|
+
Requires-Dist: boto3 (>=1.38.41,<2.0.0) ; extra == "aws" or extra == "all"
|
|
26
|
+
Requires-Dist: ccxt (>=4.2.48)
|
|
27
|
+
Requires-Dist: dependency-injector (>=4.40.0)
|
|
28
|
+
Requires-Dist: fastapi (>=0.110.0)
|
|
29
|
+
Requires-Dist: finterion-charts (==1.5.0)
|
|
30
|
+
Requires-Dist: ipython (>=8.0.0) ; extra == "notebook" or extra == "all"
|
|
31
|
+
Requires-Dist: jinja2 (>=3.1.6)
|
|
32
|
+
Requires-Dist: marshmallow (>=3.5.0)
|
|
33
|
+
Requires-Dist: msgpack (>=1.0.0)
|
|
34
|
+
Requires-Dist: polars[numpy,pandas] (>=0.20.10)
|
|
35
|
+
Requires-Dist: polygon-api-client (>=1.14.0,<2.0.0) ; extra == "polygon" or extra == "all"
|
|
36
|
+
Requires-Dist: psutil (>=5.9.0)
|
|
37
|
+
Requires-Dist: pyarrow (>=14.0.0)
|
|
38
|
+
Requires-Dist: python-dateutil (>=2.8.2)
|
|
39
|
+
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
40
|
+
Requires-Dist: schedule (>=1.1.0)
|
|
41
|
+
Requires-Dist: tabulate (>=0.9.0)
|
|
42
|
+
Requires-Dist: tqdm (>=4.66.1)
|
|
43
|
+
Requires-Dist: uvicorn[standard] (>=0.29.0)
|
|
44
|
+
Requires-Dist: werkzeug (>=3.0.0)
|
|
45
|
+
Requires-Dist: wrapt (>=1.16.0)
|
|
46
|
+
Requires-Dist: yfinance (>=0.2.61,<0.3.0) ; extra == "yahoo" or extra == "all"
|
|
47
|
+
Requires-Dist: zstandard (>=0.20.0)
|
|
48
|
+
Description-Content-Type: text/markdown
|
|
49
|
+
|
|
50
|
+
<h1 align="center">
|
|
51
|
+
Investing Algorithm Framework
|
|
52
|
+
</h1>
|
|
53
|
+
|
|
54
|
+
<p align="center">
|
|
55
|
+
<i>Build strategies, backtest at scale, compare results, and deploy the winner without rewriting your strategy.</i>
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
<h4 align="center">
|
|
59
|
+
<a href="https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/test.yml?query=branch%3Amain"><img src="https://img.shields.io/github/actions/workflow/status/coding-kitties/investing-algorithm-framework/test.yml?branch=main&label=linux&style=flat-square&logo=linux&logoColor=white" alt="Linux build"></a>
|
|
60
|
+
<a href="https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/test.yml?query=branch%3Amain"><img src="https://img.shields.io/github/actions/workflow/status/coding-kitties/investing-algorithm-framework/test.yml?branch=main&label=macos&style=flat-square&logo=apple&logoColor=white" alt="macOS build"></a>
|
|
61
|
+
<a href="https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/test.yml?query=branch%3Amain"><img src="https://img.shields.io/github/actions/workflow/status/coding-kitties/investing-algorithm-framework/test.yml?branch=main&label=windows&style=flat-square&logo=windows&logoColor=white" alt="Windows build"></a>
|
|
62
|
+
<a href="https://pypi.org/project/investing-algorithm-framework/"><img src="https://img.shields.io/pypi/v/investing-algorithm-framework.svg?style=flat-square" alt="PyPI version"></a>
|
|
63
|
+
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/apache%202.0-blue.svg?style=flat-square&label=license" alt="Apache 2.0 license"></a>
|
|
64
|
+
</h4>
|
|
65
|
+
|
|
66
|
+
<a href="https://finterion.com/community/forum"><img src="https://finterion.com/api/forum-badge.svg" alt="Finterion forum" height="30"></a>
|
|
67
|
+
|
|
68
|
+
<p align="center">
|
|
69
|
+
<picture>
|
|
70
|
+
<source media="(prefers-color-scheme: dark)" srcset="static/features/hero-dark.svg">
|
|
71
|
+
<source media="(prefers-color-scheme: light)" srcset="static/features/hero-light.svg">
|
|
72
|
+
<img src="static/features/hero-dark.svg" alt="Investing Algorithm Framework features overview" style="max-width: 100%;">
|
|
73
|
+
</picture>
|
|
74
|
+
</p>
|
|
75
|
+
|
|
76
|
+
<p align="center">
|
|
77
|
+
<sub>Proudly sponsored by</sub>
|
|
78
|
+
<br>
|
|
79
|
+
<a href="https://www.finterion.com/" target="_blank">
|
|
80
|
+
<picture>
|
|
81
|
+
<source media="(prefers-color-scheme: dark)" srcset="static/sponsors/finterion-dark.png">
|
|
82
|
+
<source media="(prefers-color-scheme: light)" srcset="static/sponsors/finterion-light.png">
|
|
83
|
+
<img src="static/sponsors/finterion-light.png" alt="Finterion" width="180">
|
|
84
|
+
</picture>
|
|
85
|
+
</a>
|
|
86
|
+
</p>
|
|
87
|
+
|
|
88
|
+
Investing Algorithm Framework is a Python framework for the complete quantitative
|
|
89
|
+
trading workflow. Define a strategy once, explore it with vector backtests,
|
|
90
|
+
validate it in an event-driven simulation, inspect the results in an interactive
|
|
91
|
+
dashboard, and run the same strategy in paper or live trading.
|
|
92
|
+
|
|
93
|
+
> **v9.0.0 alpha is available.** Install the prerelease explicitly:
|
|
94
|
+
>
|
|
95
|
+
> ```bash
|
|
96
|
+
> pip install investing-algorithm-framework==9.0.0a22
|
|
97
|
+
> ```
|
|
98
|
+
>
|
|
99
|
+
> See the [v9.0 release notes](docusaurus/blog/2026-08-02-v9.0-release.md)
|
|
100
|
+
> and [changelog](CHANGELOG.md). This README targets **v9 and later**;
|
|
101
|
+
> its APIs and examples may not work with earlier versions.
|
|
102
|
+
|
|
103
|
+
### Feature Highlights
|
|
104
|
+
|
|
105
|
+
- 🧠 **[Advanced strategy definitions](#3-confluence-scoring-declare-indicators-and-decisions):** Combine declarative indicators and data streams, confluence-scored entry and exit decisions, and position sizing and risk rules.
|
|
106
|
+
- 🔁 **[Long and short trading](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/orders):** Define entry and exit signals once and run the same strategy in vector backtests, event-driven backtests, paper trading, and live trading.
|
|
107
|
+
- ⚡ **[Vector backtesting](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/vector-backtesting):** Evaluate signals and sweep thousands of strategy variants quickly with Polars-powered execution.
|
|
108
|
+
- 🏃 **[Event-driven backtesting](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/event-backtesting):** Validate candidates bar by bar with realistic orders, fills, costs, and portfolio management.
|
|
109
|
+
- 🪟 **[Studies, universes, and backtest windows](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/studies):** Define the assets, assumptions, and rolling, anchored, holdout, walk-forward, time-OOS, or universe-OOS periods for each experiment.
|
|
110
|
+
- 🗂️ **[Open Backtest Format](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/open-backtest-format):** Keep complete vector and event results in portable, versioned `.obtf` bundles.
|
|
111
|
+
- 🗄️ **[Tiered storage and indexing](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-storage):** Rank and filter 10,000+ backtests through SQLite without decoding full result bundles.
|
|
112
|
+
- 📊 **[80+ performance metrics](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/metrics):** Analyze CAGR, Sharpe, Sortino, Calmar, VaR/CVaR, drawdown, recovery, and benchmark-relative returns.
|
|
113
|
+
- 📈 **[Interactive dashboard](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports):** Compare strategies, inspect trades and charts, review window coverage, and save a self-contained HTML report.
|
|
114
|
+
- 🔀 **[Monte Carlo testing](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/permutation-testing):** Measure how often randomized market paths match or outperform a strategy's observed results.
|
|
115
|
+
- 🧮 **[Cross-sectional pipelines](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/pipelines):** Rank, filter, and score entire universes of symbols during each strategy iteration.
|
|
116
|
+
- 🧠 **[Confluence scoring cards](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/confluence-cards):** Build explainable decisions from requirements, weighted evidence, vetoes, and score thresholds.
|
|
117
|
+
- 🛡️ **[Declarative risk rules](https://coding-kitties.github.io/investing-algorithm-framework/Risk%20Rules/overview):** Configure sizing, exposure limits, scaling, stop losses, take profits, and signal cooldowns.
|
|
118
|
+
- 💸 **[Execution cost models](https://coding-kitties.github.io/investing-algorithm-framework/Risk%20Rules/trading-cost):** Apply percentage, fixed, basis-point, or volume-aware commission and slippage assumptions.
|
|
119
|
+
- 🔐 **[Portfolio and credentials management](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/portfolio-configuration):** Configure markets, balances, fees, paper trading, and environment-based credentials without hardcoding secrets.
|
|
120
|
+
- 🚀 **[Flexible deployment](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/deployment):** Run locally, self-host, deploy to AWS Lambda or Azure Functions, or publish through Finterion.
|
|
121
|
+
- 🌐 **[Extensible integrations](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/custom-data-providers):** Add custom data providers, order executors, storage adapters, metrics, strategies, and optimizers.
|
|
122
|
+
- 🤖 **[Built-in MCP server](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/mcp-server):** Let compatible AI tools query backtests, compare strategies, inspect trades, and manage research notes.
|
|
123
|
+
- ↔️ **[Position modes: NETTING vs. HEDGE](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/position-modes):** Choose one net direction per symbol or maintain independent long and short legs with separate risk controls and P&L.
|
|
124
|
+
|
|
125
|
+
<a id="strategy-definition"></a>
|
|
126
|
+
<details>
|
|
127
|
+
<summary><strong>Strategy Definition</strong></summary>
|
|
128
|
+
<br>
|
|
129
|
+
|
|
130
|
+
There are three ways to define a strategy: use `TradingStrategy` for direct
|
|
131
|
+
orders or custom signals, or its `ConfluenceScoringStrategy` subclass for
|
|
132
|
+
declarative indicator-driven decisions. All declare their data and schedule;
|
|
133
|
+
choose how much of the trading logic you want to manage yourself:
|
|
134
|
+
|
|
135
|
+
> **Recommended: start with `ConfluenceScoringStrategy`.** We recommend it over
|
|
136
|
+
> the other two approaches because it:
|
|
137
|
+
> - Provides both event and vector signal hooks, avoiding duplicated signal logic.
|
|
138
|
+
> - Keeps indicator calculations, scoring rules, and thresholds declarative.
|
|
139
|
+
> - Records explainable decision traces in event mode.
|
|
140
|
+
> - Uses the shared sizing, risk, execution, and cooldown pipeline.
|
|
141
|
+
>
|
|
142
|
+
> Use custom signals or direct orders as escape hatches when your strategy needs
|
|
143
|
+
> behavior that the declarative API cannot express.
|
|
144
|
+
|
|
145
|
+
| Style | Define | Execution modes |
|
|
146
|
+
| --- | --- | --- |
|
|
147
|
+
| **Direct orders** | Override `run_strategy` and place orders through `Context`. | Event backtests, paper, and live trading |
|
|
148
|
+
| **Custom signals** | Implement `generate_signals` and `generate_signal_series`; let the framework size and execute orders. | Both backtest engines, paper, and live trading |
|
|
149
|
+
| **Confluence scoring (recommended)** | Subclass `ConfluenceScoringStrategy` and declare indicators and scored entry/exit cards. | Both backtest engines, paper, and live trading |
|
|
150
|
+
|
|
151
|
+
### 1. Direct orders: control the event loop
|
|
152
|
+
|
|
153
|
+
> **No vector backtesting:** this approach supports event-driven backtests,
|
|
154
|
+
> paper trading, and live trading only. Use custom signals or confluence cards
|
|
155
|
+
> below if you need vector backtesting.
|
|
156
|
+
|
|
157
|
+
Use `run_strategy` when you need direct control over order conditions, sizing,
|
|
158
|
+
and routing. This replaces the default signal-processing pipeline: declaring
|
|
159
|
+
strategy risk rules alone does not apply that pipeline to your custom orders.
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
from investing_algorithm_framework import (
|
|
163
|
+
DataSource, OrderSide, Schedule, TimeUnit, TradingStrategy,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class DirectOrderStrategy(TradingStrategy):
|
|
168
|
+
schedule = Schedule.every(2, TimeUnit.HOUR)
|
|
169
|
+
symbols = ["BTC"]
|
|
170
|
+
data_sources = [DataSource(
|
|
171
|
+
identifier="BTC_ohlcv", symbol="BTC/EUR", data_type="OHLCV", time_frame="2h",
|
|
172
|
+
market="BITVAVO", pandas=True, warmup_window=30,
|
|
173
|
+
)]
|
|
174
|
+
|
|
175
|
+
def run_strategy(self, context, data):
|
|
176
|
+
frame = data["BTC_ohlcv"]
|
|
177
|
+
price = float(frame["Close"].iloc[-1])
|
|
178
|
+
average = float(frame["Close"].rolling(20).mean().iloc[-1])
|
|
179
|
+
|
|
180
|
+
if price > average and not context.has_position("BTC"):
|
|
181
|
+
context.create_limit_order(
|
|
182
|
+
target_symbol="BTC", price=price, order_side=OrderSide.BUY,
|
|
183
|
+
percentage_of_portfolio=20,
|
|
184
|
+
)
|
|
185
|
+
elif price < average and context.has_position("BTC"):
|
|
186
|
+
context.create_limit_order(
|
|
187
|
+
target_symbol="BTC", price=price, order_side=OrderSide.SELL,
|
|
188
|
+
percentage_of_position=100,
|
|
189
|
+
)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
The vector engine does not call `run_strategy`. For vector backtesting, express
|
|
193
|
+
the strategy as signal series instead.
|
|
194
|
+
|
|
195
|
+
### 2. Custom signals: share logic across both engines
|
|
196
|
+
|
|
197
|
+
Emit trading intent rather than orders. The framework applies its normal
|
|
198
|
+
conflict resolution, sizing, risk, execution, and cooldown phases.
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
from investing_algorithm_framework import (
|
|
202
|
+
DataSource, PositionSize, Schedule, SignalSide, TimeUnit, TradingStrategy,
|
|
203
|
+
signal_series_from_column, signals_from_column,
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
class MovingAverageSignalStrategy(TradingStrategy):
|
|
208
|
+
schedule = Schedule.every(2, TimeUnit.HOUR)
|
|
209
|
+
symbols = ["BTC"]
|
|
210
|
+
data_sources = [DataSource(
|
|
211
|
+
identifier="BTC_ohlcv", symbol="BTC/EUR", data_type="OHLCV", time_frame="2h",
|
|
212
|
+
market="BITVAVO", pandas=True, warmup_window=30,
|
|
213
|
+
)]
|
|
214
|
+
position_sizes = [PositionSize(symbol="BTC", percentage_of_portfolio=20)]
|
|
215
|
+
|
|
216
|
+
def _with_signals(self, data):
|
|
217
|
+
frame = data["BTC_ohlcv"].copy()
|
|
218
|
+
average = frame["Close"].rolling(20).mean()
|
|
219
|
+
frame["open_long"] = frame["Close"] > average
|
|
220
|
+
frame["close_long"] = frame["Close"] < average
|
|
221
|
+
return frame
|
|
222
|
+
|
|
223
|
+
def generate_signals(self, context, data):
|
|
224
|
+
frame = self._with_signals(data)
|
|
225
|
+
yield from signals_from_column(
|
|
226
|
+
frame, "open_long", side=SignalSide.OPEN_LONG, symbol="BTC",
|
|
227
|
+
)
|
|
228
|
+
yield from signals_from_column(
|
|
229
|
+
frame, "close_long", side=SignalSide.CLOSE_LONG, symbol="BTC",
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
def generate_signal_series(self, data):
|
|
233
|
+
frame = self._with_signals(data)
|
|
234
|
+
yield signal_series_from_column(
|
|
235
|
+
frame, "open_long", side=SignalSide.OPEN_LONG, symbol="BTC",
|
|
236
|
+
)
|
|
237
|
+
yield signal_series_from_column(
|
|
238
|
+
frame, "close_long", side=SignalSide.CLOSE_LONG, symbol="BTC",
|
|
239
|
+
)
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
`generate_signals` evaluates the latest bar for event backtests, paper trading,
|
|
243
|
+
and live trading. `generate_signal_series` evaluates the full window for vector
|
|
244
|
+
backtests. Implement both to support both engines, sharing indicator logic to
|
|
245
|
+
keep their decisions consistent.
|
|
246
|
+
|
|
247
|
+
### 3. Confluence scoring: declare indicators and decisions
|
|
248
|
+
|
|
249
|
+
Inherit from `ConfluenceScoringStrategy` and declare `indicator_configs` plus
|
|
250
|
+
`confluence_cards`. The base class calculates the indicators and supplies both
|
|
251
|
+
signal hooks: no custom `prepare_signal_data`, `generate_signals`, or
|
|
252
|
+
`generate_signal_series` is needed.
|
|
253
|
+
|
|
254
|
+
This example uses `pyindicators` (`pip install pyindicators`). Pass its indicator
|
|
255
|
+
function as `calculate`, and declare the parameters and output columns explicitly.
|
|
256
|
+
Precomputation is appropriate here because RSI uses only present and past data.
|
|
257
|
+
|
|
258
|
+
```python
|
|
259
|
+
from pyindicators import rsi
|
|
260
|
+
|
|
261
|
+
from investing_algorithm_framework import (
|
|
262
|
+
ConfluenceScoringStrategy, ConfluenceScoreConfig, CooldownRule,
|
|
263
|
+
DataSource, IndicatorConfig, IndicatorRule, PositionSize, Schedule,
|
|
264
|
+
SignalSide, StopLossRule, TakeProfitRule, TimeUnit,
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
class RSIConfluenceStrategy(ConfluenceScoringStrategy):
|
|
269
|
+
schedule = Schedule.every(2, TimeUnit.HOUR)
|
|
270
|
+
symbols = ["BTC"]
|
|
271
|
+
data_sources = [
|
|
272
|
+
DataSource(
|
|
273
|
+
identifier="BTC_ohlcv",
|
|
274
|
+
symbol="BTC/EUR",
|
|
275
|
+
data_type="OHLCV",
|
|
276
|
+
time_frame="2h",
|
|
277
|
+
market="BITVAVO",
|
|
278
|
+
pandas=True,
|
|
279
|
+
warmup_window=100,
|
|
280
|
+
)
|
|
281
|
+
]
|
|
282
|
+
|
|
283
|
+
indicator_configs = [
|
|
284
|
+
IndicatorConfig(
|
|
285
|
+
id="rsi",
|
|
286
|
+
calculate=rsi,
|
|
287
|
+
timeframe="2h",
|
|
288
|
+
data_source="BTC_ohlcv",
|
|
289
|
+
parameters={
|
|
290
|
+
"source_column": "Close", "period": 14, "result_column": "rsi",
|
|
291
|
+
},
|
|
292
|
+
output_columns=["rsi"],
|
|
293
|
+
minimum_history=15,
|
|
294
|
+
history="continuous",
|
|
295
|
+
execution="precompute",
|
|
296
|
+
),
|
|
297
|
+
]
|
|
298
|
+
confluence_cards = [
|
|
299
|
+
ConfluenceScoreConfig(
|
|
300
|
+
id=name,
|
|
301
|
+
side=side,
|
|
302
|
+
symbols=["BTC"],
|
|
303
|
+
rules={"rsi_threshold": IndicatorRule(
|
|
304
|
+
indicator_id="rsi",
|
|
305
|
+
output_column="rsi",
|
|
306
|
+
threshold=threshold,
|
|
307
|
+
comparison=comparison,
|
|
308
|
+
group_weights={"primary": 1},
|
|
309
|
+
lookback_period=1,
|
|
310
|
+
)},
|
|
311
|
+
group_aggregation={"primary": "sum"},
|
|
312
|
+
group_thresholds={"primary": 1},
|
|
313
|
+
)
|
|
314
|
+
for name, side, threshold, comparison in (
|
|
315
|
+
("long_entry", SignalSide.OPEN_LONG, 30, "le"),
|
|
316
|
+
("long_exit", SignalSide.CLOSE_LONG, 70, "ge"),
|
|
317
|
+
("short_entry", SignalSide.OPEN_SHORT, 70, "ge"),
|
|
318
|
+
("short_exit", SignalSide.CLOSE_SHORT, 30, "le"),
|
|
319
|
+
)
|
|
320
|
+
]
|
|
321
|
+
|
|
322
|
+
position_sizes = [PositionSize(symbol="BTC", percentage_of_portfolio=20)]
|
|
323
|
+
stop_losses = [
|
|
324
|
+
StopLossRule(
|
|
325
|
+
symbol="BTC",
|
|
326
|
+
percentage_threshold=5,
|
|
327
|
+
sell_percentage=100,
|
|
328
|
+
)
|
|
329
|
+
]
|
|
330
|
+
take_profits = [
|
|
331
|
+
TakeProfitRule(
|
|
332
|
+
symbol="BTC",
|
|
333
|
+
percentage_threshold=10,
|
|
334
|
+
sell_percentage=100,
|
|
335
|
+
)
|
|
336
|
+
]
|
|
337
|
+
cooldowns = [CooldownRule(trigger="any", blocks="any", bars=2)]
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
The framework evaluates each card's explicit `side` and score threshold, then
|
|
341
|
+
routes qualifying signals through the same sizing, risk, execution, and cooldown
|
|
342
|
+
pipeline as custom signals. Event mode also records decision traces. The four
|
|
343
|
+
cards above cover long entry and exit plus short entry and cover.
|
|
344
|
+
|
|
345
|
+
See the [declarative confluence strategy example](examples/framework_features/two_hour_confluence_strategy.py)
|
|
346
|
+
for callable indicators, staged scale-ins, and execution-engine limitations.
|
|
347
|
+
|
|
348
|
+
Fees and slippage belong to the portfolio or backtest study because they describe
|
|
349
|
+
a venue or scenario rather than signal logic.
|
|
350
|
+
|
|
351
|
+
See the [strategy guide](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/strategies),
|
|
352
|
+
the [basic example](docusaurus/docs/Getting%20Started/strategies.md#basic-strategy-structure),
|
|
353
|
+
and the [strategy showcase](examples/algorithm_examples/strategies_showcase/README.md).
|
|
354
|
+
|
|
355
|
+
</details>
|
|
356
|
+
|
|
357
|
+
<a id="backtesting"></a>
|
|
358
|
+
<details>
|
|
359
|
+
<summary><strong>Backtesting</strong></summary>
|
|
360
|
+
<br>
|
|
361
|
+
|
|
362
|
+
Backtests use a `Study` to describe the experiment and a
|
|
363
|
+
`BacktestRunConfiguration` to control execution and persistence.
|
|
364
|
+
|
|
365
|
+
```python
|
|
366
|
+
from investing_algorithm_framework import BacktestRunConfiguration
|
|
367
|
+
|
|
368
|
+
results = app.run_backtests(
|
|
369
|
+
strategies=strategies,
|
|
370
|
+
study=training_study,
|
|
371
|
+
run_configuration=BacktestRunConfiguration(
|
|
372
|
+
backtest_storage_directory="./my-backtests",
|
|
373
|
+
n_workers=8,
|
|
374
|
+
memory_budget_mb=16_384,
|
|
375
|
+
min_available_memory_mb=4_096,
|
|
376
|
+
),
|
|
377
|
+
)
|
|
378
|
+
|
|
379
|
+
print(results.df)
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Both engines return a disk-backed `BacktestIndex`. Use the index for scalar
|
|
383
|
+
filtering and ranking, then load selected full results with
|
|
384
|
+
`results.iter_backtests()` or `results.load_backtests()`.
|
|
385
|
+
|
|
386
|
+
### Vector Backtesting
|
|
387
|
+
|
|
388
|
+
The Polars-powered vector engine evaluates signal series in bulk. Use it for
|
|
389
|
+
rapid signal research, parameter sweeps, large candidate sets, and early-stage
|
|
390
|
+
filtering before running more expensive simulations.
|
|
391
|
+
|
|
392
|
+
<p align="center">
|
|
393
|
+
<picture>
|
|
394
|
+
<source media="(prefers-color-scheme: dark)" srcset="static/features/vector-backtest-dark.svg">
|
|
395
|
+
<source media="(prefers-color-scheme: light)" srcset="static/features/vector-backtest-light.svg">
|
|
396
|
+
<img src="static/features/vector-backtest-dark.svg" alt="Vector backtest engine" style="max-width: 100%;">
|
|
397
|
+
</picture>
|
|
398
|
+
</p>
|
|
399
|
+
|
|
400
|
+
### Event-Driven Backtesting
|
|
401
|
+
|
|
402
|
+
The event engine processes market data bar by bar through the same strategy and
|
|
403
|
+
order path used in live trading. Use it to validate execution behavior, fills,
|
|
404
|
+
costs, portfolio changes, and interactions between strategies.
|
|
405
|
+
|
|
406
|
+
<p align="center">
|
|
407
|
+
<picture>
|
|
408
|
+
<source media="(prefers-color-scheme: dark)" srcset="static/features/event-backtest-dark.svg">
|
|
409
|
+
<source media="(prefers-color-scheme: light)" srcset="static/features/event-backtest-light.svg">
|
|
410
|
+
<img src="static/features/event-backtest-dark.svg" alt="Event-driven backtest engine" style="max-width: 100%;">
|
|
411
|
+
</picture>
|
|
412
|
+
</p>
|
|
413
|
+
|
|
414
|
+
### Robustness Studies
|
|
415
|
+
|
|
416
|
+
`Study`, `Universe`, and `BacktestWindow` support single-window tests, rolling
|
|
417
|
+
windows, anchored windows, holdouts, walk-forward k-fold validation, and
|
|
418
|
+
out-of-sample testing across time periods or universes. Execution assumptions
|
|
419
|
+
are captured with each study so results remain reproducible.
|
|
420
|
+
|
|
421
|
+
See the [vector backtesting guide](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/vector-backtesting),
|
|
422
|
+
the [event backtesting guide](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/event-backtesting),
|
|
423
|
+
and the [tutorial notebooks](examples/tutorial/README.md).
|
|
424
|
+
|
|
425
|
+
</details>
|
|
426
|
+
|
|
427
|
+
<a id="backtest-storage"></a>
|
|
428
|
+
<details>
|
|
429
|
+
<summary><strong>Backtest Storage</strong></summary>
|
|
430
|
+
<br>
|
|
431
|
+
|
|
432
|
+
Each algorithm is stored as a versioned `.obtf` bundle using the
|
|
433
|
+
[Open Backtest Format](https://github.com/Quant-Commons/Open-Backtest-Format).
|
|
434
|
+
A bundle can contain studies, universes, windows, vector and event runs,
|
|
435
|
+
summaries, metrics, trades, orders, positions, snapshots, execution assumptions,
|
|
436
|
+
and Monte Carlo results.
|
|
437
|
+
|
|
438
|
+
The storage layer scales from local research to large result collections:
|
|
439
|
+
|
|
440
|
+
| Tier | Purpose |
|
|
441
|
+
| --- | --- |
|
|
442
|
+
| SQLite index | Rank and filter scalar metrics across 10,000+ results without decoding bundles |
|
|
443
|
+
| `BacktestStore` | Swap flat `LocalDirStore` and partitioned `LocalTieredStore` layouts |
|
|
444
|
+
| OHLCV chunks | Deduplicate content-addressed market data shared by multiple bundles |
|
|
445
|
+
|
|
446
|
+
```bash
|
|
447
|
+
iaf index ./my-backtests/
|
|
448
|
+
iaf rank ./my-backtests/ --by sharpe_ratio \
|
|
449
|
+
--where "summary_number_of_trades > 50" -n 20
|
|
450
|
+
iaf list ./my-backtests/ --sort calmar_ratio --json
|
|
451
|
+
iaf migrate-store --from local-dir --src ./my-backtests/ \
|
|
452
|
+
--to local-tiered --dst ./tiered/
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
See the [storage layer example](examples/storage_layer_demo/README.md).
|
|
456
|
+
|
|
457
|
+
</details>
|
|
458
|
+
|
|
459
|
+
<a id="deployment"></a>
|
|
460
|
+
<details>
|
|
461
|
+
<summary><strong>Deployment</strong></summary>
|
|
462
|
+
<br>
|
|
463
|
+
|
|
464
|
+
The same strategy can run locally, in a container, as a web service, or in a
|
|
465
|
+
serverless function. Portfolio state, orders, trades, and positions can persist
|
|
466
|
+
across runs.
|
|
467
|
+
|
|
468
|
+
### Live Trading
|
|
469
|
+
|
|
470
|
+
Connect to supported exchanges through CCXT or implement an `OrderExecutor` for
|
|
471
|
+
a broker, FIX gateway, or custom venue. Live mode evaluates schedules, loads
|
|
472
|
+
market data, creates orders, and maintains portfolio state continuously.
|
|
473
|
+
|
|
474
|
+
### Paper Trading
|
|
475
|
+
|
|
476
|
+
Paper trading exercises the live strategy path without sending real orders.
|
|
477
|
+
Use it after event-driven validation to verify schedules, data feeds, credentials,
|
|
478
|
+
and operational behavior in current market conditions.
|
|
479
|
+
|
|
480
|
+
### Self-Hosted and Serverless
|
|
481
|
+
|
|
482
|
+
Run the application on your own machine or infrastructure, package it in Docker,
|
|
483
|
+
or scaffold AWS Lambda and Azure Functions projects from the CLI:
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
pip install investing-algorithm-framework
|
|
487
|
+
investing-algorithm-framework init
|
|
488
|
+
investing-algorithm-framework init --type aws_lambda
|
|
489
|
+
investing-algorithm-framework init --type azure_function
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
### Finterion
|
|
493
|
+
|
|
494
|
+
Publish validated strategies to the
|
|
495
|
+
[Finterion marketplace](https://www.finterion.com/) so investors can subscribe
|
|
496
|
+
to them. The Finterion plugin handles the framework integration.
|
|
497
|
+
|
|
498
|
+
<p align="center">
|
|
499
|
+
<a href="https://www.finterion.com/" target="_blank">
|
|
500
|
+
<picture>
|
|
501
|
+
<source media="(prefers-color-scheme: dark)" srcset="static/features/marketplace-dark.svg">
|
|
502
|
+
<source media="(prefers-color-scheme: light)" srcset="static/features/marketplace-light.svg">
|
|
503
|
+
<img src="static/features/marketplace-dark.svg" alt="Finterion marketplace integration" style="max-width: 100%;">
|
|
504
|
+
</picture>
|
|
505
|
+
</a>
|
|
506
|
+
</p>
|
|
507
|
+
|
|
508
|
+
See the [deployment guide](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/deployment)
|
|
509
|
+
and [Finterion plugin](https://github.com/Finterion/finterion-investing-algorithm-framework-plugin).
|
|
510
|
+
|
|
511
|
+
</details>
|
|
512
|
+
|
|
513
|
+
<a id="portfolio-and-credentials-management"></a>
|
|
514
|
+
<details>
|
|
515
|
+
<summary><strong>Portfolio and Credentials Management</strong></summary>
|
|
516
|
+
<br>
|
|
517
|
+
|
|
518
|
+
`app.add_market()` configures a portfolio and its market credentials together.
|
|
519
|
+
Set the trading currency, starting balance, fees, slippage, position mode, and
|
|
520
|
+
paper-trading behavior in one place:
|
|
521
|
+
|
|
522
|
+
```python
|
|
523
|
+
app.add_market(
|
|
524
|
+
market="BITVAVO",
|
|
525
|
+
trading_symbol="EUR",
|
|
526
|
+
initial_balance=10_000,
|
|
527
|
+
fee_percentage=0.1,
|
|
528
|
+
paper_trading=True,
|
|
529
|
+
)
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
Keep secrets outside source code with market-scoped environment variables:
|
|
533
|
+
|
|
534
|
+
```bash
|
|
535
|
+
BITVAVO_API_KEY=<your-api-key>
|
|
536
|
+
BITVAVO_SECRET_KEY=<your-api-secret>
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
Explicit credentials from a secret manager can be registered with
|
|
540
|
+
`MarketCredential`. Deployment-level `BITVAVO_OVERRIDE_*` variables can enforce
|
|
541
|
+
credentials, paper mode, and managed balance regardless of values supplied by
|
|
542
|
+
the application.
|
|
543
|
+
|
|
544
|
+
Portfolio state, orders, positions, and trades persist across runs. Optional
|
|
545
|
+
portfolio synchronization reconciles broker balances and supports recurring or
|
|
546
|
+
one-off deposit schedules. Local paper trading requires no real credentials.
|
|
547
|
+
|
|
548
|
+
See [Portfolio Configuration](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/portfolio-configuration),
|
|
549
|
+
[Credential Management](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/credentials),
|
|
550
|
+
and [Portfolio Synchronization](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/portfolio-sync).
|
|
551
|
+
|
|
552
|
+
</details>
|
|
553
|
+
|
|
554
|
+
<a id="dashboard"></a>
|
|
555
|
+
<details>
|
|
556
|
+
<summary><strong>Dashboard</strong></summary>
|
|
557
|
+
<br>
|
|
558
|
+
|
|
559
|
+
`BacktestReport` creates a self-contained interactive HTML dashboard. Compare
|
|
560
|
+
strategies, inspect equity and drawdown curves, review trades, analyze monthly
|
|
561
|
+
and yearly returns, check window coverage, and add research notes without
|
|
562
|
+
running a separate server.
|
|
563
|
+
|
|
564
|
+
<p align="center">
|
|
565
|
+
<picture>
|
|
566
|
+
<source media="(prefers-color-scheme: dark)" srcset="static/features/dashboard-dark.svg">
|
|
567
|
+
<source media="(prefers-color-scheme: light)" srcset="static/features/dashboard-light.svg">
|
|
568
|
+
<img src="static/features/dashboard-dark.svg" alt="Backtest analysis dashboard" style="max-width: 100%;">
|
|
569
|
+
</picture>
|
|
570
|
+
</p>
|
|
571
|
+
|
|
572
|
+
```python
|
|
573
|
+
from investing_algorithm_framework import BacktestReport
|
|
574
|
+
|
|
575
|
+
# Materialize only the selected results when working with a large index.
|
|
576
|
+
BacktestReport(
|
|
577
|
+
backtests=results.load_backtests(workers=1),
|
|
578
|
+
).save("backtest-report.html")
|
|
579
|
+
|
|
580
|
+
# Or reopen a directory of persisted bundles later.
|
|
581
|
+
BacktestReport.open(
|
|
582
|
+
directory_path="./my-backtests/",
|
|
583
|
+
workers=-1,
|
|
584
|
+
show_progress=True,
|
|
585
|
+
).save("backtest-report.html")
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
The built-in MCP server lets compatible AI tools query stored backtests, compare
|
|
589
|
+
strategies, inspect trades, and work with report notes through
|
|
590
|
+
`investing-algorithm-framework mcp`.
|
|
591
|
+
|
|
592
|
+
See the [report guide](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/backtest-reports)
|
|
593
|
+
and [MCP server guide](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/mcp-server).
|
|
594
|
+
|
|
595
|
+
</details>
|
|
596
|
+
|
|
597
|
+
<a id="advanced-features"></a>
|
|
598
|
+
<details>
|
|
599
|
+
<summary><strong>Advanced Features</strong></summary>
|
|
600
|
+
<br>
|
|
601
|
+
|
|
602
|
+
- **Backtest optimization:** plug in an ask/tell `StrategyOptimizer`, budget candidate evaluations, and resume saved search state.
|
|
603
|
+
- **Long and short trading:** use open/close signals for either side with fill-based P&L and collateral handling.
|
|
604
|
+
- **Cross-sectional pipelines:** rank, filter, and score a universe of symbols on each iteration.
|
|
605
|
+
- **Confluence cards:** combine primary conditions, weighted evidence, requirements, vetoes, and score thresholds.
|
|
606
|
+
- **Decision traces:** retain indicator values, rule outcomes, and scores for signals and no-op decisions.
|
|
607
|
+
- **Risk rules:** configure position sizing, exposure limits, scaling, stop losses, take profits, and signal cooldowns.
|
|
608
|
+
- **Execution models:** use percentage, fixed, basis-point, or volume-aware commission and slippage models.
|
|
609
|
+
- **Monte Carlo testing:** estimate whether performance could plausibly occur by chance.
|
|
610
|
+
- **Metrics and benchmarks:** analyze CAGR, Sharpe, Sortino, Calmar, VaR/CVaR, drawdown, recovery, and benchmark-relative performance.
|
|
611
|
+
- **External data and custom variables:** load cached CSV, JSON, or Parquet data and record strategy-specific values.
|
|
612
|
+
- **Portfolio synchronization:** model recurring or one-off deposits and reconcile live balances with a broker.
|
|
613
|
+
- **Bounded execution:** control workers, memory admission, checkpoints, progress, and failure handling for large sweeps.
|
|
614
|
+
|
|
615
|
+
See the [advanced concepts documentation](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/)
|
|
616
|
+
and [backtest optimization guide](docusaurus/docs/Advanced%20Concepts/backtest-optimization.md).
|
|
617
|
+
|
|
618
|
+
</details>
|
|
619
|
+
|
|
620
|
+
<a id="position-modes"></a>
|
|
621
|
+
<details>
|
|
622
|
+
<summary><strong>Position Modes: NETTING vs. HEDGE</strong></summary>
|
|
623
|
+
<br>
|
|
624
|
+
|
|
625
|
+
Portfolios use `PositionMode.NETTING` by default: each symbol has one net
|
|
626
|
+
direction, so a long and short cannot coexist. Enable `PositionMode.HEDGE` to
|
|
627
|
+
maintain independent long and short legs for the same symbol, each with its own
|
|
628
|
+
entry, scaling, stop-loss, take-profit, cooldown, and P&L.
|
|
629
|
+
|
|
630
|
+
```python
|
|
631
|
+
from investing_algorithm_framework import PositionMode
|
|
632
|
+
|
|
633
|
+
app.add_market(
|
|
634
|
+
market="BITVAVO",
|
|
635
|
+
trading_symbol="EUR",
|
|
636
|
+
initial_balance=10_000,
|
|
637
|
+
position_mode=PositionMode.HEDGE,
|
|
638
|
+
)
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
Both backtest engines support `OPEN_LONG`, `CLOSE_LONG`, `OPEN_SHORT`, and
|
|
642
|
+
`CLOSE_SHORT` independently in HEDGE mode. In NETTING mode,
|
|
643
|
+
`flip_on_opposite_signal=True` can close the current direction and open the
|
|
644
|
+
opposite direction on the same bar.
|
|
645
|
+
|
|
646
|
+
Live HEDGE trading requires an `OrderExecutor` and `PortfolioProvider` that
|
|
647
|
+
explicitly support it. The built-in CCXT adapters support NETTING only, so use
|
|
648
|
+
custom HEDGE-capable adapters for live execution.
|
|
649
|
+
|
|
650
|
+
See [Position Modes: NETTING vs. HEDGE](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/position-modes).
|
|
651
|
+
|
|
652
|
+
</details>
|
|
653
|
+
|
|
654
|
+
<a id="pipelines"></a>
|
|
655
|
+
<details>
|
|
656
|
+
<summary><strong>Pipelines</strong></summary>
|
|
657
|
+
<br>
|
|
658
|
+
|
|
659
|
+
Pipelines compute factors across many symbols in one pass and return a tidy
|
|
660
|
+
cross-sectional table on each strategy iteration. Use them to define a tradeable
|
|
661
|
+
universe, rank candidates, normalize factors, and construct multi-factor or
|
|
662
|
+
risk-neutral signals without manually looping over symbols.
|
|
663
|
+
|
|
664
|
+
```python
|
|
665
|
+
from investing_algorithm_framework import AverageDollarVolume, Pipeline, Returns
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
class MomentumScreener(Pipeline):
|
|
669
|
+
dollar_volume = AverageDollarVolume(window=30)
|
|
670
|
+
momentum = Returns(window=30)
|
|
671
|
+
|
|
672
|
+
universe = dollar_volume.top(100)
|
|
673
|
+
alpha = momentum.rank(mask=universe)
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
class MomentumStrategy(TradingStrategy):
|
|
677
|
+
pipelines = [MomentumScreener]
|
|
678
|
+
|
|
679
|
+
def generate_signals(self, context, data):
|
|
680
|
+
candidates = data["MomentumScreener"]
|
|
681
|
+
leaders = candidates.sort("alpha", descending=True).head(10)
|
|
682
|
+
# Yield Signal objects for the selected symbols.
|
|
683
|
+
...
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
Built-in factors include returns, liquidity, moving averages, RSI, volatility,
|
|
687
|
+
cross-sectional means, rolling beta, and neutralization. Factors compose with
|
|
688
|
+
arithmetic, ranking, filtering, z-scoring, demeaning, winsorization, and grouped
|
|
689
|
+
transforms.
|
|
690
|
+
|
|
691
|
+
See the [Pipelines guide](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/pipelines),
|
|
692
|
+
[event backtest integration](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/pipelines-event-backtest),
|
|
693
|
+
[vector backtest integration](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/pipelines-vector-backtest),
|
|
694
|
+
and [live integration](https://coding-kitties.github.io/investing-algorithm-framework/Advanced%20Concepts/pipelines-live).
|
|
695
|
+
|
|
696
|
+
</details>
|
|
697
|
+
|
|
698
|
+
<a id="monte-carlo-testing"></a>
|
|
699
|
+
<details>
|
|
700
|
+
<summary><strong>Monte Carlo Testing</strong></summary>
|
|
701
|
+
<br>
|
|
702
|
+
|
|
703
|
+
Monte Carlo permutation testing helps distinguish a strategy's observed edge
|
|
704
|
+
from results that randomized market paths could produce by chance. The framework
|
|
705
|
+
runs the strategy on its original OHLCV data, creates randomized permutations,
|
|
706
|
+
reruns the same strategy on each permutation, and compares the real metrics with
|
|
707
|
+
the resulting null distributions.
|
|
708
|
+
|
|
709
|
+
Use `app.run_monte_carlo_test(...)` with a strategy, a `BacktestDateRange`, and
|
|
710
|
+
the desired number of permutations. The returned `BacktestMonteCarloTest`
|
|
711
|
+
contains the real metrics, metrics from every permuted run, the original and
|
|
712
|
+
permuted datasets, and p-values for metrics including:
|
|
713
|
+
|
|
714
|
+
- CAGR, Sharpe, Sortino, and Calmar ratios
|
|
715
|
+
- Profit factor, win rate, and win/loss ratio
|
|
716
|
+
- Annual volatility and maximum drawdown
|
|
717
|
+
- Average monthly return
|
|
718
|
+
|
|
719
|
+
Lower p-values indicate that fewer randomized runs matched or exceeded the
|
|
720
|
+
observed result. They are evidence about statistical significance, not proof of
|
|
721
|
+
future profitability. Use enough permutations for the precision you need and
|
|
722
|
+
combine the result with out-of-sample and walk-forward validation.
|
|
723
|
+
|
|
724
|
+
See the [tutorial notebooks](examples/tutorial/README.md) for the robustness
|
|
725
|
+
analysis workflow.
|
|
726
|
+
|
|
727
|
+
</details>
|
|
728
|
+
|
|
729
|
+
<a id="plugins-and-supported-libraries"></a>
|
|
730
|
+
<details>
|
|
731
|
+
<summary><strong>Plugins and Supported Libraries</strong></summary>
|
|
732
|
+
<br>
|
|
733
|
+
|
|
734
|
+
| Integration | Purpose |
|
|
735
|
+
| --- | --- |
|
|
736
|
+
| [PyIndicators](https://github.com/coding-kitties/PyIndicators) | Technical indicators including EMA, RSI, and MACD |
|
|
737
|
+
| [Finterion plugin](https://github.com/Finterion/finterion-investing-algorithm-framework-plugin) | Publish and operate strategies on Finterion |
|
|
738
|
+
| [CCXT](https://github.com/ccxt/ccxt) | Exchange market data and live order execution |
|
|
739
|
+
| Pandas and Polars | Native tabular inputs for strategy and backtest workflows |
|
|
740
|
+
| Yahoo Finance, Alpha Vantage, and Polygon | Built-in market data providers |
|
|
741
|
+
| AWS and Azure | Optional state storage and serverless deployment integrations |
|
|
742
|
+
|
|
743
|
+
Custom data providers, order executors, storage adapters, strategies, metrics,
|
|
744
|
+
and optimizers can be added without replacing the core workflow.
|
|
745
|
+
|
|
746
|
+
</details>
|
|
747
|
+
|
|
748
|
+
## Development & Contributing
|
|
749
|
+
|
|
750
|
+
Contributions are welcome. Open an issue, choose an existing one, or submit a
|
|
751
|
+
pull request against the `dev` branch.
|
|
752
|
+
|
|
753
|
+
```bash
|
|
754
|
+
git clone https://github.com/coding-kitties/investing-algorithm-framework.git
|
|
755
|
+
cd investing-algorithm-framework
|
|
756
|
+
poetry install
|
|
757
|
+
python -m unittest discover -s tests
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
- [Open an issue](https://github.com/coding-kitties/investing-algorithm-framework/issues/new)
|
|
761
|
+
- [Contributing guide](https://coding-kitties.github.io/investing-algorithm-framework/Contributing%20Guide/contributing)
|
|
762
|
+
- [Architecture references](docs/architecture/README.md)
|
|
763
|
+
|
|
764
|
+
## Resources
|
|
765
|
+
|
|
766
|
+
- [Documentation](https://coding-kitties.github.io/investing-algorithm-framework/)
|
|
767
|
+
- [Quick start](https://coding-kitties.github.io/investing-algorithm-framework/Getting%20Started/installation)
|
|
768
|
+
- [Tutorial notebooks](examples/tutorial/README.md)
|
|
769
|
+
- [Strategy showcase](examples/algorithm_examples/strategies_showcase/README.md)
|
|
770
|
+
- [Discord](https://discord.gg/dQsRmGZP)
|
|
771
|
+
- [Reddit](https://www.reddit.com/r/InvestingBots/)
|
|
772
|
+
|
|
773
|
+
## Risk Disclaimer
|
|
774
|
+
|
|
775
|
+
Do not risk money you cannot afford to lose. Backtests and paper trading cannot
|
|
776
|
+
guarantee future performance. Validate strategy behavior, execution assumptions,
|
|
777
|
+
stored results, and operational safeguards before trading with real funds. The
|
|
778
|
+
project and its contributors assume no responsibility for investment results.
|
|
779
|
+
|
|
780
|
+
## Acknowledgements
|
|
781
|
+
|
|
782
|
+
Thank you to everyone who has contributed code, documentation, testing, ideas,
|
|
783
|
+
and feedback. See [AUTHORS.md](AUTHORS.md) for the contributor list.
|
|
784
|
+
|
|
785
|
+
## Sponsors
|
|
786
|
+
|
|
787
|
+
<p align="center">
|
|
788
|
+
<a href="https://www.finterion.com/" target="_blank">
|
|
789
|
+
<picture>
|
|
790
|
+
<source media="(prefers-color-scheme: dark)" srcset="static/sponsors/finterion-dark.png">
|
|
791
|
+
<source media="(prefers-color-scheme: light)" srcset="static/sponsors/finterion-light.png">
|
|
792
|
+
<img src="static/sponsors/finterion-light.png" alt="Finterion" width="180">
|
|
793
|
+
</picture>
|
|
794
|
+
</a>
|
|
795
|
+
</p>
|
|
796
|
+
|
|
797
|
+
[Finterion](https://www.finterion.com/) is a marketplace for trading bots where
|
|
798
|
+
strategy creators can publish and monetize their work.
|
|
799
|
+
|