investing-algorithm-framework 6.9.4__tar.gz → 6.9.5__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 (255) hide show
  1. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/PKG-INFO +1 -3
  2. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/README.md +0 -2
  3. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/__init__.py +3 -2
  4. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/cli.py +10 -7
  5. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/deploy_to_aws_lambda.py +112 -30
  6. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/initialize_app.py +20 -0
  7. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/app_aws_lambda_function.py.template +18 -6
  8. investing_algorithm_framework-6.9.5/investing_algorithm_framework/cli/templates/aws_lambda_dockerfile.template +22 -0
  9. investing_algorithm_framework-6.9.5/investing_algorithm_framework/cli/templates/aws_lambda_dockerignore.template +92 -0
  10. investing_algorithm_framework-6.9.5/investing_algorithm_framework/cli/templates/aws_lambda_requirements.txt.template +2 -0
  11. investing_algorithm_framework-6.9.5/investing_algorithm_framework/cli/templates/azure_function_requirements.txt.template +3 -0
  12. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/__init__.py +4 -2
  13. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/config.py +27 -0
  14. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/pyproject.toml +1 -1
  15. investing_algorithm_framework-6.9.4/investing_algorithm_framework/cli/templates/aws_lambda_requirements.txt.template +0 -2
  16. investing_algorithm_framework-6.9.4/investing_algorithm_framework/cli/templates/azure_function_requirements.txt.template +0 -3
  17. investing_algorithm_framework-6.9.4/investing_algorithm_framework/cli/templates/requirements_azure_function.txt.template +0 -3
  18. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/LICENSE +0 -0
  19. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/__init__.py +0 -0
  20. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/algorithm/__init__.py +0 -0
  21. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/algorithm/algorithm.py +0 -0
  22. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/algorithm/algorithm_factory.py +0 -0
  23. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/app.py +0 -0
  24. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/app_hook.py +0 -0
  25. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/context.py +0 -0
  26. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/__init__.py +0 -0
  27. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/ascii.py +0 -0
  28. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/backtest_report.py +0 -0
  29. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/charts/__init__.py +0 -0
  30. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +0 -0
  31. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/charts/monthly_returns_heatmap.py +0 -0
  32. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +0 -0
  33. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +0 -0
  34. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/evaluation.py +0 -0
  35. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/generate.py +0 -0
  36. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/__init__.py +0 -0
  37. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/alpha.py +0 -0
  38. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/beta.py +0 -0
  39. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/cagr.py +0 -0
  40. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/calmar_ratio.py +0 -0
  41. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/drawdown.py +0 -0
  42. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/equity_curve.py +0 -0
  43. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/exposure.py +0 -0
  44. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/mean_daily_return.py +0 -0
  45. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/price_efficiency.py +0 -0
  46. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/profit_factor.py +0 -0
  47. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/recovery.py +0 -0
  48. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/returns.py +0 -0
  49. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/risk_free_rate.py +0 -0
  50. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/sharp_ratio.py +0 -0
  51. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/sortino_ratio.py +0 -0
  52. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/standard_deviation.py +0 -0
  53. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/treynor_ratio.py +0 -0
  54. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/ulcer.py +0 -0
  55. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/value_at_risk.py +0 -0
  56. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/volatility.py +0 -0
  57. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/metrics/win_rate.py +0 -0
  58. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/tables/__init__.py +0 -0
  59. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/tables/key_metrics_table.py +0 -0
  60. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/tables/stop_loss_table.py +0 -0
  61. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/tables/time_metrics_table.py +0 -0
  62. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/tables/trade_metrics_table.py +0 -0
  63. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/tables/trades_table.py +0 -0
  64. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/tables/utils.py +0 -0
  65. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/reporting/templates/report_template.html.j2 +0 -0
  66. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
  67. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
  68. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
  69. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
  70. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +0 -0
  71. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
  72. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/strategy.py +0 -0
  73. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/task.py +0 -0
  74. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/__init__.py +0 -0
  75. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/controllers/__init__.py +0 -0
  76. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/controllers/orders.py +0 -0
  77. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -0
  78. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/controllers/positions.py +0 -0
  79. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/create_app.py +0 -0
  80. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/error_handler.py +0 -0
  81. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/responses.py +0 -0
  82. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
  83. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/schemas/__init__.py +0 -0
  84. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/schemas/order.py +0 -0
  85. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
  86. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
  87. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/app/web/setup_cors.py +0 -0
  88. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/__init__.py +0 -0
  89. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/deploy_to_azure_function.py +0 -0
  90. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/.gitignore.template +0 -0
  91. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/app.py.template +0 -0
  92. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/app_azure_function.py.template +0 -0
  93. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/app_web.py.template +0 -0
  94. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/aws_lambda_readme.md.template +0 -0
  95. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/azure_function_function_app.py.template +0 -0
  96. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/azure_function_host.json.template +0 -0
  97. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/azure_function_local.settings.json.template +0 -0
  98. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/data_providers.py.template +0 -0
  99. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/env.example.template +0 -0
  100. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/env_azure_function.example.template +0 -0
  101. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/market_data_providers.py.template +0 -0
  102. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/readme.md.template +0 -0
  103. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/requirements.txt.template +0 -0
  104. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/run_backtest.py.template +0 -0
  105. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/cli/templates/strategy.py.template +0 -0
  106. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/create_app.py +0 -0
  107. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/dependency_container.py +0 -0
  108. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/constants.py +0 -0
  109. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/data_provider.py +0 -0
  110. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/data_structures.py +0 -0
  111. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
  112. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/exceptions.py +0 -0
  113. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/__init__.py +0 -0
  114. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/app_mode.py +0 -0
  115. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/backtesting/__init__.py +0 -0
  116. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/backtesting/backtest_date_range.py +0 -0
  117. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/backtesting/backtest_position.py +0 -0
  118. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/backtesting/backtest_reports_evaluation.py +0 -0
  119. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/backtesting/backtest_results.py +0 -0
  120. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/base_model.py +0 -0
  121. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/data_source.py +0 -0
  122. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/date_range.py +0 -0
  123. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/event.py +0 -0
  124. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
  125. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/market/market_credential.py +0 -0
  126. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/market_data_type.py +0 -0
  127. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
  128. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/order/order.py +0 -0
  129. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/order/order_side.py +0 -0
  130. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/order/order_status.py +0 -0
  131. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/order/order_type.py +0 -0
  132. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/portfolio/__init__.py +0 -0
  133. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +0 -0
  134. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -0
  135. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +0 -0
  136. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
  137. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/position/position.py +0 -0
  138. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -0
  139. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/snapshot_interval.py +0 -0
  140. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/strategy_profile.py +0 -0
  141. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/time_frame.py +0 -0
  142. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
  143. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
  144. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/tracing/__init__.py +0 -0
  145. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/tracing/trace.py +0 -0
  146. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/trade/__init__.py +0 -0
  147. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/trade/trade.py +0 -0
  148. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/trade/trade_risk_type.py +0 -0
  149. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/trade/trade_status.py +0 -0
  150. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/trade/trade_stop_loss.py +0 -0
  151. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/trade/trade_take_profit.py +0 -0
  152. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/trading_data_types.py +0 -0
  153. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/models/trading_time_frame.py +0 -0
  154. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/order_executor.py +0 -0
  155. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/portfolio_provider.py +0 -0
  156. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/services/__init__.py +0 -0
  157. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/services/market_credential_service.py +0 -0
  158. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/services/market_data_sources.py +0 -0
  159. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/services/market_service.py +0 -0
  160. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/services/observable.py +0 -0
  161. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/services/observer.py +0 -0
  162. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/services/portfolios/__init__.py +0 -0
  163. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +0 -0
  164. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/services/rounding_service.py +0 -0
  165. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/services/state_handler.py +0 -0
  166. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
  167. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/strategy.py +0 -0
  168. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/utils/__init__.py +0 -0
  169. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/utils/csv.py +0 -0
  170. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/utils/dates.py +0 -0
  171. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/utils/polars.py +0 -0
  172. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/utils/random.py +0 -0
  173. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
  174. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
  175. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
  176. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/download_data.py +0 -0
  177. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/__init__.py +0 -0
  178. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/data_providers/__init__.py +0 -0
  179. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/data_providers/ccxt.py +0 -0
  180. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/data_providers/csv.py +0 -0
  181. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
  182. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +0 -0
  183. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/__init__.py +0 -0
  184. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
  185. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/market_data_sources/__init__.py +0 -0
  186. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/market_data_sources/ccxt.py +0 -0
  187. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/market_data_sources/csv.py +0 -0
  188. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/market_data_sources/pandas.py +0 -0
  189. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
  190. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -0
  191. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/order/order.py +0 -0
  192. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/order/order_metadata.py +0 -0
  193. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/order_trade_association.py +0 -0
  194. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
  195. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +0 -0
  196. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/portfolio/sql_portfolio.py +0 -0
  197. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
  198. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/position/position.py +0 -0
  199. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +0 -0
  200. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/trades/__init__.py +0 -0
  201. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/trades/trade.py +0 -0
  202. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/trades/trade_stop_loss.py +0 -0
  203. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/models/trades/trade_take_profit.py +0 -0
  204. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/order_executors/__init__.py +0 -0
  205. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/order_executors/ccxt_order_executor.py +0 -0
  206. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/portfolio_providers/__init__.py +0 -0
  207. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/portfolio_providers/ccxt_portfolio_provider.py +0 -0
  208. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/__init__.py +0 -0
  209. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/order_metadata_repository.py +0 -0
  210. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +0 -0
  211. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
  212. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
  213. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
  214. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
  215. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/repository.py +0 -0
  216. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/trade_repository.py +0 -0
  217. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/trade_stop_loss_repository.py +0 -0
  218. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/repositories/trade_take_profit_repository.py +0 -0
  219. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/services/__init__.py +0 -0
  220. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/services/aws/__init__.py +0 -0
  221. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/services/aws/state_handler.py +0 -0
  222. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/services/azure/__init__.py +0 -0
  223. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/services/azure/state_handler.py +0 -0
  224. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/services/market_service/__init__.py +0 -0
  225. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/services/market_service/ccxt_market_service.py +0 -0
  226. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/services/performance_service/__init__.py +0 -0
  227. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/services/performance_service/backtest_performance_service.py +0 -0
  228. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/infrastructure/services/performance_service/performance_service.py +0 -0
  229. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/__init__.py +0 -0
  230. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/backtesting/__init__.py +0 -0
  231. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/backtesting/backtest_service.py +0 -0
  232. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/configuration_service.py +0 -0
  233. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/market_credential_service.py +0 -0
  234. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/market_data_source_service/__init__.py +0 -0
  235. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/market_data_source_service/backtest_market_data_source_service.py +0 -0
  236. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/market_data_source_service/data_provider_service.py +0 -0
  237. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/market_data_source_service/market_data_source_service.py +0 -0
  238. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
  239. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/order_service/order_backtest_service.py +0 -0
  240. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/order_service/order_executor_lookup.py +0 -0
  241. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/order_service/order_service.py +0 -0
  242. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/portfolios/__init__.py +0 -0
  243. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/portfolios/backtest_portfolio_service.py +0 -0
  244. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/portfolios/portfolio_configuration_service.py +0 -0
  245. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/portfolios/portfolio_provider_lookup.py +0 -0
  246. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/portfolios/portfolio_service.py +0 -0
  247. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/portfolios/portfolio_snapshot_service.py +0 -0
  248. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +0 -0
  249. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/positions/__init__.py +0 -0
  250. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/positions/position_service.py +0 -0
  251. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/positions/position_snapshot_service.py +0 -0
  252. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/repository_service.py +0 -0
  253. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/strategy_orchestrator_service.py +0 -0
  254. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/trade_service/__init__.py +0 -0
  255. {investing_algorithm_framework-6.9.4 → investing_algorithm_framework-6.9.5}/investing_algorithm_framework/services/trade_service/trade_service.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: investing-algorithm-framework
3
- Version: 6.9.4
3
+ Version: 6.9.5
4
4
  Summary: A framework for creating trading bots
5
5
  Author: MDUYN
6
6
  Requires-Python: >=3.10
@@ -118,8 +118,6 @@ the 20, 50 and 100 period exponential moving averages (EMA) and the
118
118
  > This dependency is not part of the framework, but is used to perform technical analysis on the dataframes.
119
119
  > You can install it using pip: pip install pyindicators.
120
120
 
121
- ```bash
122
-
123
121
  ```python
124
122
  import logging.config
125
123
  from dotenv import load_dotenv
@@ -82,8 +82,6 @@ the 20, 50 and 100 period exponential moving averages (EMA) and the
82
82
  > This dependency is not part of the framework, but is used to perform technical analysis on the dataframes.
83
83
  > You can install it using pip: pip install pyindicators.
84
84
 
85
- ```bash
86
-
87
85
  ```python
88
86
  import logging.config
89
87
  from dotenv import load_dotenv
@@ -7,7 +7,7 @@ from investing_algorithm_framework.domain import ApiException, \
7
7
  TradingDataType, TradingTimeFrame, OrderType, OperationalException, \
8
8
  OrderStatus, OrderSide, TimeUnit, TimeInterval, Order, Portfolio, \
9
9
  Position, TimeFrame, BACKTESTING_INDEX_DATETIME, MarketCredential, \
10
- PortfolioConfiguration, RESOURCE_DIRECTORY, \
10
+ PortfolioConfiguration, RESOURCE_DIRECTORY, AWS_LAMBDA_LOGGING_CONFIG, \
11
11
  Trade, OHLCVMarketDataSource, OrderBookMarketDataSource, SYMBOLS, \
12
12
  TickerMarketDataSource, MarketService, \
13
13
  RESERVED_BALANCES, APP_MODE, AppMode, DATETIME_FORMAT, \
@@ -92,5 +92,6 @@ __all__ = [
92
92
  "add_metrics",
93
93
  "add_html_report",
94
94
  "AWSS3StorageStateHandler",
95
- "AWS_S3_STATE_BUCKET_NAME"
95
+ "AWS_S3_STATE_BUCKET_NAME",
96
+ "AWS_LAMBDA_LOGGING_CONFIG"
96
97
  ]
@@ -177,12 +177,17 @@ def deploy_azure_function(
177
177
  default=None,
178
178
  help='List of directories to ignore when deploying.'
179
179
  )
180
+ @click.option(
181
+ '--memory_size',
182
+ default=3000,
183
+ type=int,
184
+ help='The memory size for the Lambda function in MB. Default is 3000 MB.'
185
+ )
180
186
  def deploy_aws_lambda(
181
187
  lambda_function_name,
182
188
  region,
183
- lambda_handler,
184
189
  project_dir=None,
185
- ignore_dirs=None
190
+ memory_size=3000
186
191
  ):
187
192
  """
188
193
  Command-line tool for deploying a trading bot to AWS lambda
@@ -192,12 +197,11 @@ def deploy_aws_lambda(
192
197
  to deploy.
193
198
  region (str): The AWS region where the Lambda function will
194
199
  be deployed.
195
- lambda_handler (str): The Lambda handler function in the format
196
- "module_name.function_name".
197
200
  project_dir (str): The path to the project directory containing the
198
201
  Lambda function code. If not provided, it defaults to
199
202
  the current directory.
200
- ignore_dirs (list): List of directories to ignore when deploying.
203
+ memory_size (int): The memory size for the Lambda function in MB.
204
+ Default is 3000 MB.
201
205
 
202
206
  Returns:
203
207
  None
@@ -205,9 +209,8 @@ def deploy_aws_lambda(
205
209
  deploy_to_aws_lambda_command(
206
210
  lambda_function_name=lambda_function_name,
207
211
  region=region,
208
- lambda_handler=lambda_handler,
209
212
  project_dir=project_dir,
210
- ignore_dirs=ignore_dirs
213
+ memory_size=memory_size
211
214
  )
212
215
 
213
216
 
@@ -1,8 +1,8 @@
1
1
  import json
2
2
  import os
3
3
  import re
4
+ import subprocess
4
5
  import time
5
- import uuid
6
6
  import zipfile
7
7
 
8
8
  import boto3
@@ -126,9 +126,9 @@ def create_iam_role(role_name):
126
126
  def deploy_lambda(
127
127
  function_name,
128
128
  region,
129
- zip_file_path,
130
- handler_name,
129
+ image_uri,
131
130
  role_arn,
131
+ memory_size,
132
132
  runtime="python3.10",
133
133
  env_vars=None,
134
134
  ):
@@ -138,32 +138,29 @@ def deploy_lambda(
138
138
  Args:
139
139
  function_name: str, the name of the Lambda function to
140
140
  create or update.
141
- zip_file_path: str, the path to the zip file containing
142
- the Lambda function code.
143
141
  region: str, the AWS region where the Lambda
144
142
  function will be deployed.
145
- handler_name: str, the name of the handler function
146
- in the code (e.g., "main.lambda_handler").
143
+ image_uri: str, the URI of the Docker image in ECR.
147
144
  role_arn: str, the ARN of the IAM role that Lambda will assume.
148
145
  runtime: str, the runtime environment for the
149
146
  Lambda function (default is "python3.10").
150
147
  env_vars: dict, optional environment variables
151
148
  to set for the Lambda function.
149
+ memory_size: int, the amount of memory allocated
150
+ to the Lambda function.
151
+
152
152
  Returns:
153
153
  None
154
154
  """
155
155
  lambda_client = boto3.client('lambda', region_name=region)
156
156
 
157
- with open(zip_file_path, 'rb') as f:
158
- zipped_code = f.read()
159
-
160
157
  try:
161
158
  lambda_client.get_function(FunctionName=function_name)
162
159
  click.echo(f"Function {function_name} already exists. Updating...")
163
160
 
164
161
  lambda_client.update_function_code(
165
162
  FunctionName=function_name,
166
- ZipFile=zipped_code
163
+ ImageUri=image_uri
167
164
  )
168
165
  wait_for_lambda_update(lambda_client, function_name, timeout=120)
169
166
  lambda_client.update_function_configuration(
@@ -174,15 +171,18 @@ def deploy_lambda(
174
171
  click.echo(f"Creating new function: {function_name}")
175
172
 
176
173
  try:
174
+ click.echo(
175
+ "Creating new container-based "
176
+ f"Lambda function: {function_name}"
177
+ )
177
178
  lambda_client.create_function(
178
179
  FunctionName=function_name,
179
- Runtime=runtime,
180
180
  Role=role_arn,
181
- Handler=handler_name,
182
- Code={'ZipFile': zipped_code},
181
+ PackageType="Image",
182
+ Code={"ImageUri": image_uri},
183
183
  Timeout=900,
184
- MemorySize=256,
185
- Environment={'Variables': env_vars or {}}
184
+ MemorySize=memory_size,
185
+ Environment={"Variables": env_vars or {}}
186
186
  )
187
187
  except Exception as e:
188
188
  raise click.ClickException(
@@ -213,6 +213,82 @@ def s3_bucket_exists(bucket_name, region):
213
213
  raise
214
214
 
215
215
 
216
+ def create_ecr_repository(repository_name, region):
217
+ """
218
+ Function to create an ECR repository for storing Docker images.
219
+ It checks if the repository already exists and creates it if not.
220
+
221
+ Args:
222
+ repository_name: str, the name of the ECR repository to create.
223
+ region: str, the AWS region where the repository will be created.
224
+
225
+ Returns:
226
+ None
227
+ """
228
+
229
+ ecr = boto3.client('ecr', region_name=region)
230
+ try:
231
+ response = ecr.create_repository(repositoryName=repository_name)
232
+ click.echo(
233
+ "Created ECR repository: "
234
+ f"{response['repository']['repositoryUri']}"
235
+ )
236
+ except ecr.exceptions.RepositoryAlreadyExistsException:
237
+ click.echo(f"ECR repository {repository_name} already exists.")
238
+
239
+
240
+ def build_and_push_docker_image(
241
+ repository_name, region, dockerfile_path='Dockerfile', tag='latest'
242
+ ):
243
+ """
244
+ Function to build a Docker image and push it to an ECR repository.
245
+
246
+ Args:
247
+ repository_name: str, the name of the ECR repository.
248
+ region: str, the AWS region where the repository is located.
249
+ dockerfile_path: str, path to the Dockerfile (default is 'Dockerfile').
250
+ tag: str, the tag for the Docker image (default is 'latest').
251
+
252
+ Returns:
253
+ None
254
+ """
255
+
256
+ # Retrieve the ECR repository URI
257
+ ecr = boto3.client('ecr', region_name=region)
258
+ try:
259
+ response = ecr.describe_repositories(repositoryNames=[repository_name])
260
+ repository_uri = response['repositories'][0]['repositoryUri']
261
+ except ecr.exceptions.RepositoryNotFoundException:
262
+ raise click.ClickException(
263
+ f"ECR repository {repository_name} does "
264
+ f"not exist in region {region}."
265
+ )
266
+
267
+ # Authenticate Docker to the ECR registry
268
+ auth = ecr.get_authorization_token()
269
+ proxy = auth['authorizationData'][0]['proxyEndpoint']
270
+
271
+ click.echo(f"Authenticating Docker to ECR repository {repository_name}...")
272
+ subprocess.run(
273
+ f"aws ecr get-login-password --region {region} | "
274
+ f"docker login --username AWS --password-stdin {proxy}",
275
+ shell=True, check=True
276
+ )
277
+
278
+ click.echo(f"Building Docker image {repository_name}:{tag}...")
279
+ # Build and push Docker image with the docker file path
280
+ image_full_uri = f"{repository_uri}:{tag}"
281
+ subprocess.run([
282
+ "docker", "build",
283
+ "--platform=linux/amd64",
284
+ "-t", image_full_uri,
285
+ "-f", dockerfile_path,
286
+ "."
287
+ ], check=True)
288
+ subprocess.run(f"docker push {image_full_uri}", shell=True, check=True)
289
+ return image_full_uri
290
+
291
+
216
292
  def create_s3_bucket(bucket_name, region):
217
293
  """
218
294
  Function to create an S3 bucket for storing Lambda function code.
@@ -273,7 +349,8 @@ def check_lambda_permissions(required_actions=None):
273
349
  "lambda:GetFunction",
274
350
  "lambda:UpdateFunctionCode",
275
351
  "lambda:UpdateFunctionConfiguration",
276
- "lambda:CreateFunction"
352
+ "lambda:CreateFunction",
353
+ "ecr:CreateRepository"
277
354
  ]
278
355
 
279
356
  sts = boto3.client("sts")
@@ -356,9 +433,8 @@ def wait_for_lambda_update(lambda_client, function_name, timeout=60):
356
433
  def command(
357
434
  lambda_function_name,
358
435
  region,
359
- lambda_handler,
360
436
  project_dir=None,
361
- ignore_dirs=None
437
+ memory_size=3000
362
438
  ):
363
439
  """
364
440
  Command-line tool for deploying a trading bot to AWS Lambda.
@@ -368,9 +444,8 @@ def command(
368
444
  region: str, the AWS region where the Lambda function will be deployed.
369
445
  project_dir: str, the directory containing the Lambda function code.
370
446
  If None, it defaults to the current directory.
371
- lambda_handler: str, the name of the handler function in the code
372
- (default is "aws_function.lambda_handler").
373
- ignore_dirs: list, directories to ignore when zipping the code.
447
+ memory_size: int, the amount of memory allocated
448
+ to the Lambda function
374
449
 
375
450
  Returns:
376
451
  None
@@ -381,12 +456,11 @@ def command(
381
456
 
382
457
  check_lambda_permissions()
383
458
 
384
- click.echo(f"Deploying to AWS Lambda "
385
- f"function: {lambda_function_name} in region: {region}")
459
+ click.echo(
460
+ "Deploying to AWS Lambda "
461
+ f"function: {lambda_function_name} in region: {region}"
462
+ )
386
463
  click.echo(f"Project directory: {project_dir}")
387
- zip_file_path = f"/tmp/deploy-{uuid.uuid4().hex}.zip"
388
- zip_code(project_dir, zip_file_path)
389
- click.echo(f"Zipped code to {zip_file_path}")
390
464
 
391
465
  # Create s3 bucket for state handler
392
466
  bucket_name = f"{lambda_function_name}-state-handler-{region}"
@@ -405,13 +479,21 @@ def command(
405
479
  click.echo("Adding S3 bucket name to environment variables")
406
480
  env_vars[AWS_S3_STATE_BUCKET_NAME] = bucket_name
407
481
 
482
+ click.echo("Building and pushing Docker image to ECR")
483
+ create_ecr_repository(lambda_function_name, region)
484
+ image_uri = build_and_push_docker_image(
485
+ lambda_function_name,
486
+ region,
487
+ dockerfile_path=os.path.join(project_dir, "Dockerfile"),
488
+ tag="latest"
489
+ )
408
490
  click.echo("Creating IAM role for Lambda execution")
409
491
  role_arn = create_iam_role("lambda-execution-role")
410
492
  deploy_lambda(
411
493
  lambda_function_name,
412
- zip_file_path=zip_file_path,
413
- handler_name=lambda_handler,
494
+ image_uri=image_uri,
414
495
  role_arn=role_arn,
415
496
  env_vars=env_vars,
416
- region=region
497
+ region=region,
498
+ memory_size=memory_size
417
499
  )
@@ -372,6 +372,16 @@ def create_aws_lambda_app(path=None, replace=False):
372
372
  "templates",
373
373
  "app_aws_lambda_function.py.template"
374
374
  )
375
+ aws_dockerfile_template_path = os.path.join(
376
+ os.path.dirname(current_script_path),
377
+ "templates",
378
+ "aws_lambda_dockerfile.template"
379
+ )
380
+ aws_dockerignore_template_path = os.path.join(
381
+ os.path.dirname(current_script_path),
382
+ "templates",
383
+ "aws_lambda_dockerignore.template"
384
+ )
375
385
  run_backtest_template_path = os.path.join(
376
386
  os.path.dirname(current_script_path),
377
387
  "templates",
@@ -446,6 +456,16 @@ def create_aws_lambda_app(path=None, replace=False):
446
456
  os.path.join(path, "aws_function.py"),
447
457
  replace=replace
448
458
  )
459
+ create_file_from_template(
460
+ aws_dockerfile_template_path,
461
+ os.path.join(path, "Dockerfile"),
462
+ replace=replace
463
+ )
464
+ create_file_from_template(
465
+ aws_dockerignore_template_path,
466
+ os.path.join(path, ".dockerignore"),
467
+ replace=replace
468
+ )
449
469
 
450
470
 
451
471
  def create_azure_function_app(path=None, replace=False):
@@ -1,9 +1,20 @@
1
+ import logging.config
1
2
  import os
2
- from investing_algorithm_framework import create_app, \
3
- AWSS3StorageStateHandler, AWS_S3_STATE_BUCKET_NAME
3
+ from logging import getLogger
4
4
 
5
- from .strategies.strategy import MyTradingStrategy
6
- app = create_app()
5
+ from dotenv import load_dotenv
6
+ from finterion_investing_algorithm_framework import FinterionOrderExecutor, \
7
+ FinterionPingAction, FinterionPortfolioProvider
8
+ from investing_algorithm_framework import create_app, RESOURCE_DIRECTORY, \
9
+ AWSS3StorageStateHandler, AWS_S3_STATE_BUCKET_NAME, AWS_LAMBDA_LOGGING_CONFIG
10
+
11
+ from strategies.strategy import MyTradingStrategy
12
+
13
+
14
+ # Make sure to set the resource directory to /tmp because this dir is writable
15
+ app = create_app(config={RESOURCE_DIRECTORY: os.path.join("/tmp", "resources")})
16
+ logging.config.dictConfig(AWS_LAMBDA_LOGGING_CONFIG)
17
+ logger = logging.getLogger(__name__)
7
18
 
8
19
  # Get the s3 state bucket name from environment variables for database
9
20
  # state storage, this is set during the deployment
@@ -12,7 +23,7 @@ app.add_state_handler(
12
23
  AWSS3StorageStateHandler(bucket_name=os.getenv(AWS_S3_STATE_BUCKET_NAME))
13
24
  )
14
25
  app.add_strategy(MyTradingStrategy)
15
- app.add_market(market="BITVAVO", trading_symbol="EUR", initial_balance=1000)
26
+ app.add_market(market="BITVAVO", trading_symbol="EUR")
16
27
 
17
28
 
18
29
  def lambda_handler(event, context):
@@ -27,10 +38,11 @@ def lambda_handler(event, context):
27
38
  dict: The result of the trading strategy execution.
28
39
  """
29
40
  try:
30
- app.run(number_of_iterations=1)
41
+ app.run(payload={"ACTION": "RUN_STRATEGY"})
31
42
  return {
32
43
  "statusCode": 200,
33
44
  "body": "Trading strategy executed successfully."
34
45
  }
35
46
  except Exception as e:
47
+ logger.exception(e)
36
48
  return {"statusCode": 500, "body": str(e)}
@@ -0,0 +1,22 @@
1
+ FROM public.ecr.aws/lambda/python:3.10
2
+
3
+ # Install build tools (add this block)
4
+ RUN yum install -y \
5
+ gcc \
6
+ gcc-c++ \
7
+ make \
8
+ cmake \
9
+ && yum clean all
10
+
11
+ # Set the working directory
12
+ WORKDIR /var/task
13
+
14
+ # Install Python dependencies
15
+ COPY requirements.txt .
16
+ RUN pip install --upgrade pip
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy the function code
20
+ COPY . .
21
+
22
+ CMD ["aws_function.lambda_handler"]
@@ -0,0 +1,92 @@
1
+ # Git
2
+ .git
3
+ .gitignore
4
+ .gitattributes
5
+
6
+
7
+ # CI
8
+ .codeclimate.yml
9
+ .travis.yml
10
+ .taskcluster.yml
11
+
12
+ # Docker
13
+ docker-compose.yml
14
+ Dockerfile
15
+ .docker
16
+ .dockerignore
17
+
18
+ # Byte-compiled / optimized / DLL files
19
+ **/__pycache__/
20
+ **/*.py[cod]
21
+
22
+ # C extensions
23
+ *.so
24
+
25
+ # Distribution / packaging
26
+ .Python
27
+ env/
28
+ build/
29
+ develop-eggs/
30
+ dist/
31
+ downloads/
32
+ eggs/
33
+ lib/
34
+ lib64/
35
+ parts/
36
+ sdist/
37
+ var/
38
+ *.egg-info/
39
+ .installed.cfg
40
+ *.egg
41
+
42
+ # PyInstaller
43
+ # Usually these files are written by a python script from a template
44
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
45
+ *.manifest
46
+ *.spec
47
+
48
+ # Installer logs
49
+ pip-log.txt
50
+ pip-delete-this-directory.txt
51
+
52
+ # Unit test / coverage reports
53
+ htmlcov/
54
+ .tox/
55
+ .coverage
56
+ .cache
57
+ nosetests.xml
58
+ coverage.xml
59
+
60
+ # Translations
61
+ *.mo
62
+ *.pot
63
+
64
+ # Django stuff:
65
+ *.log
66
+
67
+ # Sphinx documentation
68
+ docs/_build/
69
+
70
+ # PyBuilder
71
+ target/
72
+
73
+ # Virtual environment
74
+ .env
75
+ .venv/
76
+ venv/
77
+
78
+ # PyCharm
79
+ .idea
80
+
81
+ # Python mode for VIM
82
+ .ropeproject
83
+ **/.ropeproject
84
+
85
+ # Vim swap files
86
+ **/*.swp
87
+
88
+ # VS Code
89
+ .vscode/
90
+
91
+ # Investing algorithm specific files
92
+ /resources
@@ -0,0 +1,2 @@
1
+ investing_algorithm_framework>=6.9.4
2
+ pyindicators>=0.5.4
@@ -0,0 +1,3 @@
1
+ azure-functions==1.17.0
2
+ investing_algorithm_framework>=6.9.4
3
+ pyindicators>=0.5.4
@@ -1,4 +1,5 @@
1
- from .config import Environment, DEFAULT_LOGGING_CONFIG
1
+ from .config import Environment, DEFAULT_LOGGING_CONFIG, \
2
+ AWS_LAMBDA_LOGGING_CONFIG
2
3
  from .constants import ITEMIZE, ITEMIZED, PER_PAGE, PAGE, ENVIRONMENT, \
3
4
  DATABASE_DIRECTORY_PATH, DATABASE_NAME, DEFAULT_PER_PAGE_VALUE, \
4
5
  DEFAULT_PAGE_VALUE, SQLALCHEMY_DATABASE_URI, RESOURCE_DIRECTORY, \
@@ -136,5 +137,6 @@ __all__ = [
136
137
  "Event",
137
138
  "SNAPSHOT_INTERVAL",
138
139
  "SnapshotInterval",
139
- "AWS_S3_STATE_BUCKET_NAME"
140
+ "AWS_S3_STATE_BUCKET_NAME",
141
+ "AWS_LAMBDA_LOGGING_CONFIG"
140
142
  ]
@@ -82,3 +82,30 @@ DEFAULT_LOGGING_CONFIG = {
82
82
  'handlers': ['console', 'file'],
83
83
  },
84
84
  }
85
+
86
+ AWS_LAMBDA_LOGGING_CONFIG = {
87
+ 'version': 1,
88
+ 'disable_existing_loggers': False,
89
+ 'formatters': {
90
+ 'default': {
91
+ 'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
92
+ },
93
+ },
94
+ 'handlers': {
95
+ 'console': {
96
+ 'class': 'logging.StreamHandler',
97
+ 'formatter': 'default',
98
+ },
99
+ },
100
+ 'loggers': { # Make sure to add a 'loggers' section
101
+ 'investing_algorithm_framework': { # Define your logger here
102
+ 'level': 'INFO', # Set the desired level
103
+ 'handlers': ['console'], # Use these handlers
104
+ 'propagate': False,
105
+ },
106
+ },
107
+ 'root': { # Optional: Root logger configuration
108
+ 'level': 'WARNING', # Root logger defaults to WARNING
109
+ 'handlers': ['console'],
110
+ },
111
+ }
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "investing-algorithm-framework"
3
- version = "v6.9.4"
3
+ version = "v6.9.5"
4
4
  description = "A framework for creating trading bots"
5
5
  authors = ["MDUYN"]
6
6
  readme = "README.md"
@@ -1,2 +0,0 @@
1
- investing-algorithm-framework>=6.8.2
2
- pyindicators>=0.5.4
@@ -1,3 +0,0 @@
1
- investing-algorithm-framework>=6.8.2
2
- azure-functions==1.17.0
3
- pyindicators>=0.5.4
@@ -1,3 +0,0 @@
1
- investing-algorithm-framework>=6.8.2
2
- azure-functions==1.17.0
3
- pyindicators>=0.5.4