investing-algorithm-framework 8.10.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.
Files changed (461) hide show
  1. investing_algorithm_framework-9.0.0/PKG-INFO +799 -0
  2. investing_algorithm_framework-9.0.0/README.md +749 -0
  3. investing_algorithm_framework-9.0.0/investing_algorithm_framework/__init__.py +598 -0
  4. investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/__init__.py +42 -0
  5. investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/backtest_data_ranges.py +287 -0
  6. investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/backtest_window_analysis.py +537 -0
  7. investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/bundle_inspection.py +124 -0
  8. investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/markdown.py +1328 -0
  9. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/analysis/ranking.py +92 -12
  10. investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/robustness.py +173 -0
  11. investing_algorithm_framework-9.0.0/investing_algorithm_framework/analysis/top_selection.py +130 -0
  12. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/__init__.py +4 -2
  13. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/algorithm/algorithm.py +10 -1
  14. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/algorithm/algorithm_factory.py +13 -4
  15. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/algorithm_runner.py +315 -0
  16. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/app.py +3635 -0
  17. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/confluence_scoring_strategy.py +312 -0
  18. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/confluence_signal_support.py +195 -0
  19. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/context.py +409 -44
  20. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/eventloop.py +1424 -0
  21. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/native_schedule.py +55 -0
  22. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/ascii.py +6 -4
  23. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/backtest_report.py +236 -27
  24. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/charts/__init__.py +0 -2
  25. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/_finterion_render.py +71 -0
  26. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py +54 -0
  27. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/equity_curve.py +38 -0
  28. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +51 -0
  29. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/charts/monthly_returns_heatmap.py +15 -35
  30. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py +45 -0
  31. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +49 -0
  32. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +40 -0
  33. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/generate.py +2 -2
  34. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/templates/dashboard.css +2 -0
  35. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/templates/dashboard.js +123 -72
  36. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/strategy.py +564 -561
  37. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/task.py +16 -10
  38. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/__init__.py +5 -0
  39. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/controllers/__init__.py +22 -0
  40. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/controllers/algorithm.py +204 -0
  41. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/controllers/orders.py +11 -5
  42. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/controllers/portfolio.py +73 -0
  43. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/controllers/positions.py +11 -5
  44. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/controllers/run_reports.py +31 -0
  45. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/controllers/trades.py +38 -0
  46. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/create_app.py +17 -0
  47. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/error_handler.py +17 -11
  48. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/responses.py +7 -4
  49. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/schemas/__init__.py +25 -0
  50. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/schemas/order.py +1 -0
  51. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/schemas/portfolio_order_cost.py +12 -0
  52. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/schemas/portfolio_order_cost_specification.py +11 -0
  53. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/schemas/run_report.py +25 -0
  54. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/schemas/trade.py +21 -0
  55. investing_algorithm_framework-9.0.0/investing_algorithm_framework/app/web/setup_cors.py +12 -0
  56. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/cli.py +34 -7
  57. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/deploy_to_aws_lambda.py +10 -1
  58. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/deploy_to_azure_function.py +16 -4
  59. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/index_command.py +286 -17
  60. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/initialize_app.py +1 -1
  61. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/mcp_server.py +37 -12
  62. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/app_aws_lambda_function.py.template +23 -1
  63. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/azure_function_function_app.py.template +43 -0
  64. investing_algorithm_framework-9.0.0/investing_algorithm_framework/cli/templates/run_backtest.py.template +29 -0
  65. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/strategy.py.template +43 -14
  66. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/validate_backtest_checkpoints.py +7 -3
  67. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/dependency_container.py +19 -2
  68. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/__init__.py +133 -10
  69. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/__init__.py +107 -0
  70. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest.py +1781 -0
  71. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest_engine.py +56 -0
  72. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_index_row.py +17 -1
  73. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_metrics.py +208 -73
  74. investing_algorithm_framework-8.10.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
  75. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest_run.py +726 -0
  76. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest_run_configuration.py +220 -0
  77. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_summary_metrics.py +81 -7
  78. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_utils.py +457 -95
  79. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/backtest_window.py +268 -0
  80. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/bundle.py +1522 -0
  81. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/combine_backtests.py +429 -50
  82. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/execution_config.py +199 -0
  83. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/history.py +237 -0
  84. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/record_schemas.py +139 -0
  85. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/records.py +606 -0
  86. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/run_report_storage.py +104 -0
  87. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/study.py +878 -0
  88. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/backtesting/universe.py +75 -0
  89. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/blotter.py +138 -1
  90. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/config.py +21 -2
  91. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/constants.py +1 -0
  92. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/data_provider.py +19 -0
  93. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/indicators.py +520 -0
  94. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/__init__.py +124 -0
  95. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/conflict_policy.py +316 -0
  96. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/confluence.py +882 -0
  97. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/confluence_frame.py +251 -0
  98. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/confluence_native.py +71 -0
  99. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/confluence_score.py +926 -0
  100. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/data/data_source.py +12 -19
  101. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/decision_trace.py +248 -0
  102. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/order/order.py +81 -10
  103. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/order/order_side.py +7 -0
  104. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/order/order_status.py +13 -0
  105. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/portfolio/__init__.py +4 -0
  106. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/portfolio/paper_trading_mode.py +21 -0
  107. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +13 -2
  108. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +246 -0
  109. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +30 -1
  110. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/portfolio/position_mode.py +6 -0
  111. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/position/position.py +155 -0
  112. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/position/position_size.py +19 -2
  113. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/position/position_snapshot.py +100 -0
  114. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/risk_rules/__init__.py +2 -0
  115. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/risk_rules/cooldown_rule.py +30 -13
  116. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/risk_rules/exposure_rule.py +53 -0
  117. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/risk_rules/scaling_rule.py +33 -4
  118. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/risk_rules/stop_loss_rule.py +84 -0
  119. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/risk_rules/take_profit_rule.py +37 -1
  120. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/risk_rules/trading_cost.py +70 -8
  121. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/run_report.py +307 -0
  122. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/scheduling/__init__.py +25 -0
  123. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/scheduling/date_rule.py +141 -0
  124. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/scheduling/schedule.py +242 -0
  125. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/scheduling/scheduled_function.py +72 -0
  126. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/scheduling/time_rule.py +140 -0
  127. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/score_card.py +13 -0
  128. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/signal.py +219 -0
  129. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/signal_helpers.py +347 -0
  130. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/signal_series.py +121 -0
  131. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/strategy_profile.py +50 -0
  132. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/models/time_frame.py +139 -0
  133. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/trade/trade.py +109 -0
  134. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/trade/trade_stop_loss.py +82 -4
  135. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/trade/trade_take_profit.py +110 -2
  136. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/native_event.py +89 -0
  137. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/optimization.py +535 -0
  138. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/order_executor.py +21 -1
  139. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/__init__.py +1 -1
  140. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/factor.py +2 -2
  141. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/pipeline.py +65 -1
  142. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/portfolio_provider.py +10 -1
  143. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/rounding_service.py +4 -5
  144. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/__init__.py +3 -1
  145. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/amounts.py +16 -0
  146. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/cash.py +12 -0
  147. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/custom_tqdm.py +52 -0
  148. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/dates.py +96 -0
  149. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/immutable.py +26 -0
  150. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/polars.py +9 -4
  151. investing_algorithm_framework-9.0.0/investing_algorithm_framework/domain/utils/rule_symbols.py +19 -0
  152. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/__init__.py +9 -4
  153. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/ccxt.py +376 -271
  154. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/csv.py +8 -1
  155. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/ohlcv_base.py +24 -4
  156. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +325 -0
  157. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/__init__.py +2 -0
  158. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/order/order.py +8 -2
  159. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +6 -2
  160. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/portfolio/sql_portfolio.py +18 -4
  161. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/models/position/position.py +180 -0
  162. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +4 -0
  163. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/models/run_report/__init__.py +3 -0
  164. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/models/run_report/run_report.py +127 -0
  165. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/trades/trade.py +66 -3
  166. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/trades/trade_stop_loss.py +5 -0
  167. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/trades/trade_take_profit.py +5 -0
  168. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/order_executors/__init__.py +2 -0
  169. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/order_executors/ccxt_order_executor.py +77 -4
  170. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/order_executors/paper_trading_order_executor.py +138 -0
  171. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/portfolio_providers/__init__.py +2 -0
  172. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/portfolio_providers/ccxt_portfolio_provider.py +73 -4
  173. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/portfolio_providers/paper_trading_portfolio_provider.py +47 -0
  174. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/__init__.py +3 -1
  175. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/repositories/event_memory.py +479 -0
  176. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/repositories/event_snapshot_archive.py +356 -0
  177. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +15 -0
  178. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/repository.py +33 -0
  179. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/repositories/run_report_repository.py +65 -0
  180. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/trade_allocation_repository.py +6 -2
  181. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/trade_repository.py +10 -4
  182. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/aws/state_handler.py +12 -2
  183. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/azure/state_handler.py +4 -1
  184. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/backtesting/backtest_service.py +1429 -765
  185. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/backtesting/event_backtest_service.py +64 -48
  186. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/event_workers.py +94 -0
  187. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/optimization.py +764 -0
  188. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/schedule_generation.py +75 -0
  189. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/vector_backtest_service.py +2451 -0
  190. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/vector_native.py +289 -0
  191. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/vector_resources.py +301 -0
  192. investing_algorithm_framework-9.0.0/investing_algorithm_framework/infrastructure/services/backtesting/vector_session_index.py +174 -0
  193. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/notebook/magic.py +63 -34
  194. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/__init__.py +11 -2
  195. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_index/sqlite_index.py +304 -23
  196. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_store/__init__.py +7 -3
  197. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_store/base.py +31 -1
  198. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_store/decompose.py +8 -4
  199. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_store/local_dir_store.py +14 -11
  200. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_store/local_tiered_store.py +114 -17
  201. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/backtest_store/recording.py +124 -0
  202. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/backtest_store/streaming.py +359 -0
  203. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/configuration_service.py +6 -9
  204. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/confluence_indicator_engine.py +247 -0
  205. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/confluence_reporting.py +98 -0
  206. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/data_providers/data_provider_service.py +86 -31
  207. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/data_providers/prepared_market_data.py +195 -0
  208. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/executors/__init__.py +29 -0
  209. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/executors/base.py +127 -0
  210. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/executors/limit.py +58 -0
  211. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/executors/market.py +58 -0
  212. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/indicator_engine.py +1304 -0
  213. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/__init__.py +11 -2
  214. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/_returns_helper.py +3 -0
  215. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/calmar_ratio.py +6 -2
  216. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/consistency.py +137 -0
  217. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/drawdown.py +29 -27
  218. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/generate.py +185 -63
  219. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/inputs.py +65 -0
  220. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/mae_mfe.py +95 -0
  221. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/native.py +65 -0
  222. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/omega_ratio.py +58 -0
  223. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/returns.py +28 -17
  224. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/sortino_ratio.py +17 -5
  225. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/standard_deviation.py +26 -26
  226. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/trades.py +101 -1
  227. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/metrics/ulcer.py +55 -0
  228. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/native_accounting.py +74 -0
  229. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/order_service/order_backtest_service.py +27 -4
  230. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/order_service/order_executor_lookup.py +2 -2
  231. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/order_service/order_service.py +2145 -0
  232. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/portfolio_configuration_service.py +22 -2
  233. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/portfolio_service.py +117 -0
  234. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +11 -0
  235. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/positions/position_service.py +141 -28
  236. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/positions/position_snapshot_service.py +4 -0
  237. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/run_reports/__init__.py +3 -0
  238. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/run_reports/run_report_service.py +29 -0
  239. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/run_reports/snapshot.py +409 -0
  240. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/__init__.py +57 -0
  241. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/apply_risk_budget.py +126 -0
  242. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/attach_risk_rules.py +103 -0
  243. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/base.py +49 -0
  244. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/collect_signals.py +132 -0
  245. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/default.py +52 -0
  246. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/emit_orders.py +92 -0
  247. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/evaluate_indicators.py +37 -0
  248. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/evaluate_pipelines.py +210 -0
  249. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/phase_state.py +186 -0
  250. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/record_cooldown.py +199 -0
  251. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/resolve_conflicts.py +349 -0
  252. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/strategy_phases/size_positions.py +343 -0
  253. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_hooks/__init__.py +6 -0
  254. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_hooks/trade_hook_dispatcher.py +114 -0
  255. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_order_evaluator/backtest_trade_oder_evaluator.py +122 -0
  256. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_order_evaluator/default_trade_order_evaluator.py +154 -0
  257. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_order_evaluator/native.py +65 -0
  258. investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/trade_order_evaluator/backtest_trade_oder_evaluator.py → investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_order_evaluator/trade_order_evaluator.py +194 -88
  259. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_service/trade_service.py +1660 -0
  260. investing_algorithm_framework-9.0.0/investing_algorithm_framework/services/trade_service/trade_stop_loss_service.py +54 -0
  261. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/trade_service/trade_take_profit_service.py +21 -6
  262. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/pyproject.toml +22 -15
  263. investing_algorithm_framework-8.10.0/PKG-INFO +0 -775
  264. investing_algorithm_framework-8.10.0/README.md +0 -730
  265. investing_algorithm_framework-8.10.0/investing_algorithm_framework/__init__.py +0 -289
  266. investing_algorithm_framework-8.10.0/investing_algorithm_framework/analysis/__init__.py +0 -22
  267. investing_algorithm_framework-8.10.0/investing_algorithm_framework/analysis/backtest_data_ranges.py +0 -202
  268. investing_algorithm_framework-8.10.0/investing_algorithm_framework/analysis/backtest_window_analysis.py +0 -364
  269. investing_algorithm_framework-8.10.0/investing_algorithm_framework/analysis/markdown.py +0 -91
  270. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/app.py +0 -2686
  271. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/eventloop.py +0 -970
  272. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/reporting/backtest_report_old.py +0 -352
  273. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py +0 -66
  274. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/reporting/charts/equity_curve.py +0 -37
  275. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +0 -74
  276. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/reporting/charts/line_chart.py +0 -11
  277. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py +0 -51
  278. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +0 -79
  279. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +0 -55
  280. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/web/__init__.py +0 -5
  281. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/web/controllers/__init__.py +0 -13
  282. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -20
  283. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/web/create_app.py +0 -20
  284. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/web/schemas/__init__.py +0 -12
  285. investing_algorithm_framework-8.10.0/investing_algorithm_framework/app/web/setup_cors.py +0 -6
  286. investing_algorithm_framework-8.10.0/investing_algorithm_framework/cli/templates/run_backtest.py.template +0 -20
  287. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/backtesting/__init__.py +0 -49
  288. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/backtesting/backtest.py +0 -866
  289. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/backtesting/backtest_run.py +0 -828
  290. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/backtesting/bundle.py +0 -772
  291. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/models/__init__.py +0 -56
  292. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -111
  293. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/models/position/position.py +0 -68
  294. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -47
  295. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/models/risk_rules/stop_loss_rule.py +0 -51
  296. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/models/strategy_profile.py +0 -33
  297. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/models/time_frame.py +0 -178
  298. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/utils/custom_tqdm.py +0 -22
  299. investing_algorithm_framework-8.10.0/investing_algorithm_framework/domain/utils/dates.py +0 -56
  300. investing_algorithm_framework-8.10.0/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +0 -188
  301. investing_algorithm_framework-8.10.0/investing_algorithm_framework/infrastructure/models/position/position.py +0 -65
  302. investing_algorithm_framework-8.10.0/investing_algorithm_framework/infrastructure/services/backtesting/checkpoint_manifest.py +0 -240
  303. investing_algorithm_framework-8.10.0/investing_algorithm_framework/infrastructure/services/backtesting/vector_backtest_service.py +0 -1137
  304. investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/metrics/consistency.py +0 -13
  305. investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/metrics/ulcer.py +0 -0
  306. investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/order_service/order_service.py +0 -880
  307. investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/trade_order_evaluator/default_trade_order_evaluator.py +0 -51
  308. investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/trade_order_evaluator/trade_order_evaluator.py +0 -93
  309. investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/trade_service/trade_service.py +0 -1145
  310. investing_algorithm_framework-8.10.0/investing_algorithm_framework/services/trade_service/trade_stop_loss_service.py +0 -39
  311. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/LICENSE +0 -0
  312. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/algorithm/__init__.py +0 -0
  313. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/app_hook.py +0 -0
  314. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/__init__.py +0 -0
  315. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/__init__.py +0 -0
  316. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/key_metrics_table.py +0 -0
  317. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/stop_loss_table.py +0 -0
  318. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/time_metrics_table.py +0 -0
  319. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/trade_metrics_table.py +0 -0
  320. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/trades_table.py +0 -0
  321. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/tables/utils.py +0 -0
  322. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/templates/dashboard_template.html.j2 +0 -0
  323. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/reporting/templates/report_template.html.j2 +0 -0
  324. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
  325. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
  326. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
  327. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
  328. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +0 -0
  329. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
  330. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
  331. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
  332. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
  333. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/__init__.py +0 -0
  334. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/migrate_store_command.py +0 -0
  335. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/.gitignore.template +0 -0
  336. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/app.py.template +0 -0
  337. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/app_azure_function.py.template +0 -0
  338. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/app_web.py.template +0 -0
  339. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/aws_lambda_dockerfile.template +0 -0
  340. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/aws_lambda_dockerignore.template +0 -0
  341. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/aws_lambda_readme.md.template +0 -0
  342. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/aws_lambda_requirements.txt.template +0 -0
  343. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/azure_function_host.json.template +0 -0
  344. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/azure_function_local.settings.json.template +0 -0
  345. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/azure_function_requirements.txt.template +0 -0
  346. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/data_providers.py.template +0 -0
  347. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/env.example.template +0 -0
  348. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/env_azure_function.example.template +0 -0
  349. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/market_data_providers.py.template +0 -0
  350. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/readme.md.template +0 -0
  351. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/cli/templates/requirements.txt.template +0 -0
  352. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/create_app.py +0 -0
  353. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/algorithm_id.py +0 -0
  354. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_date_range.py +0 -0
  355. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/backtest_evaluation_focuss.py +0 -0
  356. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/consistency.py +0 -0
  357. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/templates/backtest.html +0 -0
  358. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/templates/finterion-dark.png +0 -0
  359. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/backtesting/templates/finterion-light.png +0 -0
  360. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/data_structures.py +0 -0
  361. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/datetime_parsing.py +0 -0
  362. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
  363. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/exceptions.py +0 -0
  364. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/fx.py +0 -0
  365. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/app_mode.py +0 -0
  366. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/base_model.py +0 -0
  367. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/data/__init__.py +0 -0
  368. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/data/data_type.py +0 -0
  369. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/event.py +0 -0
  370. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
  371. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/market/market_credential.py +0 -0
  372. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
  373. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/order/order_type.py +0 -0
  374. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/portfolio/sync.py +0 -0
  375. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
  376. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/snapshot_interval.py +0 -0
  377. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
  378. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
  379. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/tracing/__init__.py +0 -0
  380. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/tracing/trace.py +0 -0
  381. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/trade/__init__.py +0 -0
  382. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/models/trade/trade_status.py +0 -0
  383. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/custom_factor.py +0 -0
  384. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/factors/__init__.py +0 -0
  385. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/factors/builtin.py +0 -0
  386. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/pipeline/filter.py +0 -0
  387. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/__init__.py +0 -0
  388. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/market_credential_service.py +0 -0
  389. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/portfolios/__init__.py +0 -0
  390. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +0 -0
  391. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/services/state_handler.py +0 -0
  392. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
  393. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/strategy.py +0 -0
  394. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/csv.py +0 -0
  395. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/jupyter_notebook_detection.py +0 -0
  396. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/random.py +0 -0
  397. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
  398. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
  399. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
  400. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/download_data.py +0 -0
  401. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/__init__.py +0 -0
  402. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/alpha_vantage.py +0 -0
  403. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/base_url.py +0 -0
  404. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/csv_url.py +0 -0
  405. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/json_url.py +0 -0
  406. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/pandas.py +0 -0
  407. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/parquet_url.py +0 -0
  408. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/polygon.py +0 -0
  409. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/data_providers/yahoo.py +0 -0
  410. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
  411. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
  412. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
  413. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -0
  414. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/order/trade_allocation.py +0 -0
  415. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/order_trade_association.py +0 -0
  416. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
  417. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
  418. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/models/trades/__init__.py +0 -0
  419. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
  420. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
  421. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
  422. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
  423. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/trade_stop_loss_repository.py +0 -0
  424. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/repositories/trade_take_profit_repository.py +0 -0
  425. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/__init__.py +0 -0
  426. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/aws/__init__.py +0 -0
  427. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/azure/__init__.py +0 -0
  428. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/infrastructure/services/backtesting/__init__.py +0 -0
  429. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/notebook/__init__.py +0 -0
  430. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/backtest_index/__init__.py +0 -0
  431. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/data_providers/__init__.py +0 -0
  432. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/data_providers/data.py +0 -0
  433. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/market_credential_service.py +0 -0
  434. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/alpha.py +0 -0
  435. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/beta.py +0 -0
  436. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/cagr.py +0 -0
  437. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/equity_curve.py +0 -0
  438. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/exposure.py +0 -0
  439. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/mean_daily_return.py +0 -0
  440. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/price_efficiency.py +0 -0
  441. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/profit_factor.py +0 -0
  442. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/recovery.py +0 -0
  443. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/risk_free_rate.py +0 -0
  444. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/sharpe_ratio.py +0 -0
  445. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/treynor_ratio.py +0 -0
  446. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/value_at_risk.py +0 -0
  447. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/volatility.py +0 -0
  448. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/metrics/win_rate.py +0 -0
  449. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
  450. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/pipeline/__init__.py +0 -0
  451. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/pipeline/pipeline_engine.py +0 -0
  452. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/pipeline/vector_pipeline_engine.py +0 -0
  453. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/__init__.py +0 -0
  454. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/backtest_portfolio_service.py +0 -0
  455. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/broker_balance_tracker.py +0 -0
  456. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/portfolio_provider_lookup.py +0 -0
  457. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/portfolios/portfolio_snapshot_service.py +0 -0
  458. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/positions/__init__.py +0 -0
  459. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/repository_service.py +0 -0
  460. {investing_algorithm_framework-8.10.0 → investing_algorithm_framework-9.0.0}/investing_algorithm_framework/services/trade_order_evaluator/__init__.py +0 -0
  461. {investing_algorithm_framework-8.10.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
+