investing-algorithm-framework 3.1.0__tar.gz → 3.3.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 (144) hide show
  1. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/PKG-INFO +42 -52
  2. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/README.md +41 -51
  3. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/__init__.py +7 -2
  4. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/algorithm.py +11 -6
  5. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/app.py +123 -44
  6. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/dependency_container.py +15 -3
  7. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/__init__.py +9 -5
  8. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/constants.py +2 -2
  9. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/__init__.py +2 -0
  10. investing_algorithm_framework-3.3.0/investing_algorithm_framework/domain/models/app_mode.py +34 -0
  11. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/market/market_credential.py +8 -0
  12. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/order/order.py +3 -0
  13. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/order/order_fee.py +4 -0
  14. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +13 -0
  15. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/position/position.py +8 -0
  16. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/trade/trade.py +47 -9
  17. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/services/__init__.py +2 -0
  18. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/services/market_service.py +5 -4
  19. investing_algorithm_framework-3.3.0/investing_algorithm_framework/domain/services/portfolios/__init__.py +5 -0
  20. investing_algorithm_framework-3.3.0/investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +15 -0
  21. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/market_data_sources/ccxt.py +1 -1
  22. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/market_data_sources/csv.py +46 -53
  23. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +8 -1
  24. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/services/market_service/ccxt_market_service.py +15 -6
  25. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/__init__.py +9 -9
  26. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/market_credential_service.py +3 -3
  27. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/order_service/order_backtest_service.py +0 -2
  28. investing_algorithm_framework-3.3.0/investing_algorithm_framework/services/portfolios/__init__.py +15 -0
  29. investing_algorithm_framework-3.3.0/investing_algorithm_framework/services/portfolios/portfolio_service.py +120 -0
  30. investing_algorithm_framework-3.3.0/investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +378 -0
  31. investing_algorithm_framework-3.3.0/investing_algorithm_framework/services/position_service.py +31 -0
  32. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/trade_service/trade_service.py +119 -25
  33. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/pyproject.toml +1 -1
  34. investing_algorithm_framework-3.1.0/investing_algorithm_framework/services/portfolio_service/__init__.py +0 -7
  35. investing_algorithm_framework-3.1.0/investing_algorithm_framework/services/portfolio_service/portfolio_service.py +0 -312
  36. investing_algorithm_framework-3.1.0/investing_algorithm_framework/services/position_service.py +0 -74
  37. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/LICENSE +0 -0
  38. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/__init__.py +0 -0
  39. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
  40. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
  41. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
  42. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
  43. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +0 -0
  44. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
  45. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/strategy.py +0 -0
  46. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/task.py +0 -0
  47. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/__init__.py +0 -0
  48. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/controllers/__init__.py +0 -0
  49. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/controllers/orders.py +0 -0
  50. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -0
  51. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/controllers/positions.py +0 -0
  52. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/create_app.py +0 -0
  53. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/error_handler.py +0 -0
  54. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/responses.py +0 -0
  55. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
  56. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/schemas/__init__.py +0 -0
  57. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/schemas/order.py +0 -0
  58. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
  59. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
  60. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/app/web/setup_cors.py +0 -0
  61. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/create_app.py +0 -0
  62. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/config.py +0 -0
  63. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/data_structures.py +0 -0
  64. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
  65. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/exceptions.py +0 -0
  66. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/backtesting/__init__.py +0 -0
  67. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/backtesting/backtest_position.py +0 -0
  68. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/backtesting/backtest_report.py +0 -0
  69. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/backtesting/backtest_reports_evaluation.py +0 -0
  70. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/base_model.py +0 -0
  71. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
  72. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
  73. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/order/order_side.py +0 -0
  74. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/order/order_status.py +0 -0
  75. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/order/order_type.py +0 -0
  76. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/portfolio/__init__.py +0 -0
  77. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -0
  78. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +0 -0
  79. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
  80. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -0
  81. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/strategy_profile.py +0 -0
  82. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/time_frame.py +0 -0
  83. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
  84. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
  85. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/trade/__init__.py +0 -0
  86. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/trade/trade_status.py +0 -0
  87. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/trading_data_types.py +0 -0
  88. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/models/trading_time_frame.py +0 -0
  89. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/services/market_credential_service.py +0 -0
  90. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/services/market_data_sources.py +0 -0
  91. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/singleton.py +0 -0
  92. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
  93. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/strategy.py +0 -0
  94. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/utils/__init__.py +0 -0
  95. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/utils/backtesting.py +0 -0
  96. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/utils/csv.py +0 -0
  97. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/utils/random.py +0 -0
  98. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
  99. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
  100. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
  101. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/__init__.py +0 -0
  102. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
  103. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +0 -0
  104. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/__init__.py +0 -0
  105. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
  106. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/market_data_sources/__init__.py +0 -0
  107. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
  108. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -0
  109. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/order/order.py +0 -0
  110. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/order/order_fee.py +0 -0
  111. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
  112. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio.py +0 -0
  113. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +0 -0
  114. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
  115. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/position/position.py +0 -0
  116. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +0 -0
  117. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/repositories/__init__.py +0 -0
  118. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/repositories/order_fee_repository.py +0 -0
  119. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
  120. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
  121. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
  122. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
  123. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/repositories/repository.py +0 -0
  124. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/services/__init__.py +0 -0
  125. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/services/market_service/__init__.py +0 -0
  126. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/services/performance_service/__init__.py +0 -0
  127. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/services/performance_service/backtest_performance_service.py +0 -0
  128. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/infrastructure/services/performance_service/performance_service.py +0 -0
  129. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/backtesting/__init__.py +0 -0
  130. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/backtesting/backtest_report_writer_service.py +0 -0
  131. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/backtesting/backtest_service.py +0 -0
  132. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/configuration_service.py +0 -0
  133. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/market_data_source_service/__init__.py +0 -0
  134. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/market_data_source_service/backtest_market_data_source_service.py +0 -0
  135. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/market_data_source_service/market_data_source_service.py +0 -0
  136. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
  137. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/order_service/order_service.py +0 -0
  138. {investing_algorithm_framework-3.1.0/investing_algorithm_framework/services/portfolio_service → investing_algorithm_framework-3.3.0/investing_algorithm_framework/services/portfolios}/backtest_portfolio_service.py +0 -0
  139. {investing_algorithm_framework-3.1.0/investing_algorithm_framework/services → investing_algorithm_framework-3.3.0/investing_algorithm_framework/services/portfolios}/portfolio_configuration_service.py +0 -0
  140. {investing_algorithm_framework-3.1.0/investing_algorithm_framework/services → investing_algorithm_framework-3.3.0/investing_algorithm_framework/services/portfolios}/portfolio_snapshot_service.py +0 -0
  141. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/position_snapshot_service.py +0 -0
  142. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/repository_service.py +0 -0
  143. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/strategy_orchestrator_service.py +0 -0
  144. {investing_algorithm_framework-3.1.0 → investing_algorithm_framework-3.3.0}/investing_algorithm_framework/services/trade_service/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: investing-algorithm-framework
3
- Version: 3.1.0
3
+ Version: 3.3.0
4
4
  Summary: A framework for creating trading bots
5
5
  Author: MDUYN
6
6
  Requires-Python: >=3.8.1,<4.0.0
@@ -26,7 +26,7 @@ Requires-Dist: wrapt (>=1.16.0,<2.0.0)
26
26
  Description-Content-Type: text/markdown
27
27
 
28
28
  <a href=https://investing-algorithm-framework.com><img src="https://img.shields.io/badge/docs-website-brightgreen"></a>
29
- [![Build](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/build.yml/badge.svg)](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/build.yml)
29
+ [![Build](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/publish.yml/badge.svg)](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/publish.yml)
30
30
  [![Tests](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/test.yml)
31
31
  [![Downloads](https://pepy.tech/badge/investing-algorithm-framework)](https://pepy.tech/badge/investing-algorithm-framework)
32
32
  [![Current Version](https://img.shields.io/pypi/v/investing_algorithm_framework.svg)](https://img.shields.io/pypi/v/investing_algorithm_framework.svg)
@@ -67,13 +67,19 @@ from investing_algorithm_framework import create_app, PortfolioConfiguration, \
67
67
  RESOURCE_DIRECTORY, TimeUnit, CCXTOHLCVMarketDataSource, Algorithm, \
68
68
  CCXTTickerMarketDataSource, MarketCredential, SYMBOLS
69
69
 
70
+ # Define the symbols you want to trade for optimization, otherwise the
71
+ # algorithm will check if you have orders and balances on all available
72
+ # symbols on the market
73
+ symbols = ["BTC/EUR"]
74
+
70
75
  # Define resource directory and the symbols you want to trade
71
76
  config = {
72
77
  RESOURCE_DIRECTORY: pathlib.Path(__file__).parent.resolve()
73
- SYMBOLS: ["BTC/EUR"]
78
+ SYMBOLS: symbols
74
79
  }
75
80
 
76
81
  # Define market data sources
82
+ # OHLCV data for candles
77
83
  bitvavo_btc_eur_ohlcv_2h = CCXTOHLCVMarketDataSource(
78
84
  identifier="BTC-ohlcv",
79
85
  market="BITVAVO",
@@ -122,7 +128,13 @@ def perform_strategy(algorithm: Algorithm, market_data: dict):
122
128
 
123
129
  # Ticker data is passed as {"<identifier>": <ticker dict>}
124
130
  ticker_data = market_data["BTC-ticker"]
131
+ unallocated_balance = algorithm.get_unallocated()
132
+ positions = algorithm.get_positions()
133
+ trades = algorithm.get_trades()
134
+ open_trades = algorithm.get_open_trades()
135
+ closed_trades = algorithm.get_closed_trades()
125
136
 
137
+ # Create a buy oder
126
138
  algorithm.create_limit_order(
127
139
  target_symbol="BTC/EUR",
128
140
  order_side="buy",
@@ -130,6 +142,12 @@ def perform_strategy(algorithm: Algorithm, market_data: dict):
130
142
  price=ticker_data["ask"],
131
143
  )
132
144
 
145
+ # Close a trade
146
+ algorithm.close_trade(trades[0].id)
147
+
148
+ # Close a position
149
+ algorithm.close_position(positions[0].get_symbol())
150
+
133
151
  if __name__ == "__main__":
134
152
  app.run()
135
153
  ```
@@ -154,72 +172,44 @@ you will get the following backtesting report:
154
172
  * Number of days: 100
155
173
  * Number of runs: 1201
156
174
  ====================Portfolio overview============================
157
- * Number of orders: 40
175
+ * Number of orders: 10
158
176
  * Initial balance: 400.0000 EUR
159
- * Final balance: 425.9722 EUR
160
- * Total net gain: 25.9722 EUR
161
- * Total net gain percentage: 6.4931%
162
- * Growth rate: 6.4931%
163
- * Growth 25.9722 EUR
177
+ * Final balance: 431.8837 EUR
178
+ * Total net gain: 28.4171 EUR
179
+ * Total net gain percentage: 7.1043%
180
+ * Growth rate: 7.9709%
181
+ * Growth 31.8837 EUR
164
182
  ====================Positions overview========================
165
183
  ╭────────────┬──────────┬──────────────────────┬───────────────────────┬──────────────┬───────────────┬───────────────────────────┬────────────────┬───────────────╮
166
184
  │ Position │ Amount │ Pending buy amount │ Pending sell amount │ Cost (EUR) │ Value (EUR) │ Percentage of portfolio │ Growth (EUR) │ Growth_rate │
167
185
  ├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤
168
- │ EUR │ 425.972 │ 0 │ 0 │ 425.972425.972100.0000% 0 │ 0.0000% │
186
+ │ EUR │ 214.219 │ 0 │ 0 │ 214.219214.21949.6010% 0 │ 0.0000% │
169
187
  ├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤
170
- DOT 0 │ 0 │ 0 │ 0 0 0.0000% 00.0000% │
188
+ BTC 0.0031 │ 0 │ 0 │ 107.095 110.401 25.5627% 3.30663.0875% │
171
189
  ├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤
172
- BTC 0 │ 0 │ 0 │ 0 0 0.0000% 0 │ 0.0000% │
190
+ DOT 21.3291 │ 0 │ 0 │ 107.104 107.264 24.8363% 0.16 │ 0.1494% │
173
191
  ╰────────────┴──────────┴──────────────────────┴───────────────────────┴──────────────┴───────────────┴───────────────────────────┴────────────────┴───────────────╯
174
192
  ====================Trades overview===========================
175
- * Number of trades closed: 20
176
- * Number of trades open: 0
177
- * Percentage of positive trades: 40.0%
178
- * Percentage of negative trades: 60.0%
179
- * Average trade size: 100.4738 EUR
180
- * Average trade duration: 83.6 hours
193
+ * Number of trades closed: 4
194
+ * Number of trades open: 2
195
+ * Percentage of positive trades: 60.0%
196
+ * Percentage of negative trades: 20.0%
197
+ * Average trade size: 98.8728 EUR
198
+ * Average trade duration: 183.5 hours
181
199
  ╭─────────┬─────────────────────┬─────────────────────┬────────────────────┬──────────────┬──────────────────┬───────────────────────┬────────────────────┬─────────────────────╮
182
200
  │ Pair │ Open date │ Close date │ Duration (hours) │ Size (EUR) │ Net gain (EUR) │ Net gain percentage │ Open price (EUR) │ Close price (EUR) │
183
201
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
184
- │ DOT-EUR │ 2023-11-24 14:00:00 │ 2023-11-27 16:00:00 74 │ 107.061 -2.2734 -2.1234% 4.78 │ 4.6785
185
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
186
- │ DOT-EUR │ 2023-11-20 02:00:00 │ 2023-11-21 10:00:00 │ 32 │ 109.269 │ -4.933 │ -4.5145% │ 4.995 │ 4.7695 │
187
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
188
- │ BTC-EUR │ 2023-11-20 00:00:00 │ 2023-11-22 02:00:00 │ 50 │ 105.992 │ -3.8994 │ -3.6789% │ 34190.9 │ 32933.1 │
189
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
190
- │ BTC-EUR │ 2023-11-06 14:00:00 │ 2023-11-13 16:00:00 │ 170 │ 104.838 │ 5.4049 │ 5.1555% │ 32761.8 │ 34450.9 │
191
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
192
- │ DOT-EUR │ 2023-10-20 14:00:00 │ 2023-10-27 10:00:00 │ 164 │ 98.8999 │ 11.4752 │ 11.6028% │ 3.525 │ 3.934 │
193
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
194
- │ BTC-EUR │ 2023-10-14 06:00:00 │ 2023-10-28 00:00:00 │ 330 │ 97.2734 │ 24.5982 │ 25.2876% │ 25598.3 │ 32071.5 │
195
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
196
- │ DOT-EUR │ 2023-10-14 06:00:00 │ 2023-10-17 16:00:00 │ 82 │ 99.2141 │ -1.2575 │ -1.2674% │ 3.5505 │ 3.5055 │
197
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
198
- │ DOT-EUR │ 2023-10-07 10:00:00 │ 2023-10-08 10:00:00 │ 24 │ 99.6325 │ -1.6732 │ -1.6794% │ 3.8705 │ 3.8055 │
199
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
200
- │ BTC-EUR │ 2023-09-27 12:00:00 │ 2023-10-05 22:00:00 │ 202 │ 96.3253 │ 2.7092 │ 2.8126% │ 25348.8 │ 26061.7 │
201
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
202
- │ DOT-EUR │ 2023-09-27 12:00:00 │ 2023-10-03 22:00:00 │ 154 │ 98.6987 │ 1.0253 │ 1.0388% │ 3.8505 │ 3.8905 │
203
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
204
- │ DOT-EUR │ 2023-09-25 14:00:00 │ 2023-09-27 06:00:00 │ 40 │ 99.0277 │ -1.315 │ -1.3280% │ 3.8405 │ 3.7895 │
205
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
206
- │ DOT-EUR │ 2023-09-14 18:00:00 │ 2023-09-18 04:00:00 │ 82 │ 98.9598 │ 0.2715 │ 0.2744% │ 3.8265 │ 3.837 │
207
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
208
- │ BTC-EUR │ 2023-09-07 08:00:00 │ 2023-09-10 18:00:00 │ 82 │ 98.5979 │ 0.1801 │ 0.1827% │ 24048.3 │ 24092.2 │
209
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
210
- │ DOT-EUR │ 2023-09-07 02:00:00 │ 2023-09-09 04:00:00 │ 50 │ 99.0076 │ -0.3719 │ -0.3757% │ 3.993 │ 3.978 │
211
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
212
- │ DOT-EUR │ 2023-09-05 16:00:00 │ 2023-09-06 14:00:00 │ 22 │ 99.1603 │ -0.61 │ -0.6152% │ 3.9825 │ 3.958 │
202
+ │ DOT-EUR │ 2023-11-30 20:00:00 │ 2976.65 │ 107.104 0 0.0000% 5.0215
213
203
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
214
- DOT-EUR │ 2023-09-04 18:00:00 │ 2023-09-05 00:00:00 6 99.3611 -0.8044 -0.8096% 3.9525 3.9205
204
+ BTC-EUR │ 2023-11-29 14:00:00 │ 3006.65 107.095 0 │ 0.0000% 34546.6
215
205
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
216
- DOT-EUR │ 2023-09-04 12:00:00 │ 2023-09-04 16:00:00 │ 4 │ 99.5219 -0.6427-0.6458% 3.9485 3.923
206
+ BTC-EUR │ 2023-11-08 00:00:00 │ 2023-11-14 16:00:00 │ 160 │ 99.2265 1.33521.3456% 33075.5 33520.6
217
207
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
218
- │ BTC-EUR │ 2023-08-26 12:00:00 │ 2023-08-26 20:00:00 │ 8 98.9954 0.0268 │ 0.0271% 24145.2 │ 24151.8
208
+ │ BTC-EUR │ 2023-11-06 16:00:00 │ 2023-11-06 20:00:00 │ 4 97.8607 -0.0026-0.0026% 32620.2 │ 32619.4
219
209
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
220
- │ DOT-EUR │ 2023-08-25 12:00:00 │ 2023-08-28 12:00:00 │ 72 99.6416 -0.5051-0.5069% │ 4.14254.1215
210
+ │ DOT-EUR │ 2023-10-30 06:00:00 │ 2023-11-14 00:00:00 │ 354 100.551 24.879424.7430% │ 4.03755.0365
221
211
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
222
- DOT-EUR │ 2023-08-24 02:00:00 │ 2023-08-25 02:00:00 │ 24 99.9997 -1.4334-1.4334% 4.151 4.0915
212
+ BTC-EUR │ 2023-09-13 16:00:00 │ 2023-09-22 16:00:00 │ 216 97.8529 2.20512.2534% 24463.2 25014.5
223
213
  ╰─────────┴─────────────────────┴─────────────────────┴────────────────────┴──────────────┴──────────────────┴───────────────────────┴────────────────────┴─────────────────────╯
224
214
  ==================================================================
225
215
  ```
@@ -1,5 +1,5 @@
1
1
  <a href=https://investing-algorithm-framework.com><img src="https://img.shields.io/badge/docs-website-brightgreen"></a>
2
- [![Build](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/build.yml/badge.svg)](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/build.yml)
2
+ [![Build](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/publish.yml/badge.svg)](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/publish.yml)
3
3
  [![Tests](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/test.yml)
4
4
  [![Downloads](https://pepy.tech/badge/investing-algorithm-framework)](https://pepy.tech/badge/investing-algorithm-framework)
5
5
  [![Current Version](https://img.shields.io/pypi/v/investing_algorithm_framework.svg)](https://img.shields.io/pypi/v/investing_algorithm_framework.svg)
@@ -40,13 +40,19 @@ from investing_algorithm_framework import create_app, PortfolioConfiguration, \
40
40
  RESOURCE_DIRECTORY, TimeUnit, CCXTOHLCVMarketDataSource, Algorithm, \
41
41
  CCXTTickerMarketDataSource, MarketCredential, SYMBOLS
42
42
 
43
+ # Define the symbols you want to trade for optimization, otherwise the
44
+ # algorithm will check if you have orders and balances on all available
45
+ # symbols on the market
46
+ symbols = ["BTC/EUR"]
47
+
43
48
  # Define resource directory and the symbols you want to trade
44
49
  config = {
45
50
  RESOURCE_DIRECTORY: pathlib.Path(__file__).parent.resolve()
46
- SYMBOLS: ["BTC/EUR"]
51
+ SYMBOLS: symbols
47
52
  }
48
53
 
49
54
  # Define market data sources
55
+ # OHLCV data for candles
50
56
  bitvavo_btc_eur_ohlcv_2h = CCXTOHLCVMarketDataSource(
51
57
  identifier="BTC-ohlcv",
52
58
  market="BITVAVO",
@@ -95,7 +101,13 @@ def perform_strategy(algorithm: Algorithm, market_data: dict):
95
101
 
96
102
  # Ticker data is passed as {"<identifier>": <ticker dict>}
97
103
  ticker_data = market_data["BTC-ticker"]
104
+ unallocated_balance = algorithm.get_unallocated()
105
+ positions = algorithm.get_positions()
106
+ trades = algorithm.get_trades()
107
+ open_trades = algorithm.get_open_trades()
108
+ closed_trades = algorithm.get_closed_trades()
98
109
 
110
+ # Create a buy oder
99
111
  algorithm.create_limit_order(
100
112
  target_symbol="BTC/EUR",
101
113
  order_side="buy",
@@ -103,6 +115,12 @@ def perform_strategy(algorithm: Algorithm, market_data: dict):
103
115
  price=ticker_data["ask"],
104
116
  )
105
117
 
118
+ # Close a trade
119
+ algorithm.close_trade(trades[0].id)
120
+
121
+ # Close a position
122
+ algorithm.close_position(positions[0].get_symbol())
123
+
106
124
  if __name__ == "__main__":
107
125
  app.run()
108
126
  ```
@@ -127,72 +145,44 @@ you will get the following backtesting report:
127
145
  * Number of days: 100
128
146
  * Number of runs: 1201
129
147
  ====================Portfolio overview============================
130
- * Number of orders: 40
148
+ * Number of orders: 10
131
149
  * Initial balance: 400.0000 EUR
132
- * Final balance: 425.9722 EUR
133
- * Total net gain: 25.9722 EUR
134
- * Total net gain percentage: 6.4931%
135
- * Growth rate: 6.4931%
136
- * Growth 25.9722 EUR
150
+ * Final balance: 431.8837 EUR
151
+ * Total net gain: 28.4171 EUR
152
+ * Total net gain percentage: 7.1043%
153
+ * Growth rate: 7.9709%
154
+ * Growth 31.8837 EUR
137
155
  ====================Positions overview========================
138
156
  ╭────────────┬──────────┬──────────────────────┬───────────────────────┬──────────────┬───────────────┬───────────────────────────┬────────────────┬───────────────╮
139
157
  │ Position │ Amount │ Pending buy amount │ Pending sell amount │ Cost (EUR) │ Value (EUR) │ Percentage of portfolio │ Growth (EUR) │ Growth_rate │
140
158
  ├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤
141
- │ EUR │ 425.972 │ 0 │ 0 │ 425.972425.972100.0000% 0 │ 0.0000% │
159
+ │ EUR │ 214.219 │ 0 │ 0 │ 214.219214.21949.6010% 0 │ 0.0000% │
142
160
  ├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤
143
- DOT 0 │ 0 │ 0 │ 0 0 0.0000% 00.0000% │
161
+ BTC 0.0031 │ 0 │ 0 │ 107.095 110.401 25.5627% 3.30663.0875% │
144
162
  ├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤
145
- BTC 0 │ 0 │ 0 │ 0 0 0.0000% 0 │ 0.0000% │
163
+ DOT 21.3291 │ 0 │ 0 │ 107.104 107.264 24.8363% 0.16 │ 0.1494% │
146
164
  ╰────────────┴──────────┴──────────────────────┴───────────────────────┴──────────────┴───────────────┴───────────────────────────┴────────────────┴───────────────╯
147
165
  ====================Trades overview===========================
148
- * Number of trades closed: 20
149
- * Number of trades open: 0
150
- * Percentage of positive trades: 40.0%
151
- * Percentage of negative trades: 60.0%
152
- * Average trade size: 100.4738 EUR
153
- * Average trade duration: 83.6 hours
166
+ * Number of trades closed: 4
167
+ * Number of trades open: 2
168
+ * Percentage of positive trades: 60.0%
169
+ * Percentage of negative trades: 20.0%
170
+ * Average trade size: 98.8728 EUR
171
+ * Average trade duration: 183.5 hours
154
172
  ╭─────────┬─────────────────────┬─────────────────────┬────────────────────┬──────────────┬──────────────────┬───────────────────────┬────────────────────┬─────────────────────╮
155
173
  │ Pair │ Open date │ Close date │ Duration (hours) │ Size (EUR) │ Net gain (EUR) │ Net gain percentage │ Open price (EUR) │ Close price (EUR) │
156
174
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
157
- │ DOT-EUR │ 2023-11-24 14:00:00 │ 2023-11-27 16:00:00 74 │ 107.061 -2.2734 -2.1234% 4.78 │ 4.6785
158
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
159
- │ DOT-EUR │ 2023-11-20 02:00:00 │ 2023-11-21 10:00:00 │ 32 │ 109.269 │ -4.933 │ -4.5145% │ 4.995 │ 4.7695 │
160
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
161
- │ BTC-EUR │ 2023-11-20 00:00:00 │ 2023-11-22 02:00:00 │ 50 │ 105.992 │ -3.8994 │ -3.6789% │ 34190.9 │ 32933.1 │
162
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
163
- │ BTC-EUR │ 2023-11-06 14:00:00 │ 2023-11-13 16:00:00 │ 170 │ 104.838 │ 5.4049 │ 5.1555% │ 32761.8 │ 34450.9 │
164
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
165
- │ DOT-EUR │ 2023-10-20 14:00:00 │ 2023-10-27 10:00:00 │ 164 │ 98.8999 │ 11.4752 │ 11.6028% │ 3.525 │ 3.934 │
166
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
167
- │ BTC-EUR │ 2023-10-14 06:00:00 │ 2023-10-28 00:00:00 │ 330 │ 97.2734 │ 24.5982 │ 25.2876% │ 25598.3 │ 32071.5 │
168
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
169
- │ DOT-EUR │ 2023-10-14 06:00:00 │ 2023-10-17 16:00:00 │ 82 │ 99.2141 │ -1.2575 │ -1.2674% │ 3.5505 │ 3.5055 │
170
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
171
- │ DOT-EUR │ 2023-10-07 10:00:00 │ 2023-10-08 10:00:00 │ 24 │ 99.6325 │ -1.6732 │ -1.6794% │ 3.8705 │ 3.8055 │
172
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
173
- │ BTC-EUR │ 2023-09-27 12:00:00 │ 2023-10-05 22:00:00 │ 202 │ 96.3253 │ 2.7092 │ 2.8126% │ 25348.8 │ 26061.7 │
174
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
175
- │ DOT-EUR │ 2023-09-27 12:00:00 │ 2023-10-03 22:00:00 │ 154 │ 98.6987 │ 1.0253 │ 1.0388% │ 3.8505 │ 3.8905 │
176
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
177
- │ DOT-EUR │ 2023-09-25 14:00:00 │ 2023-09-27 06:00:00 │ 40 │ 99.0277 │ -1.315 │ -1.3280% │ 3.8405 │ 3.7895 │
178
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
179
- │ DOT-EUR │ 2023-09-14 18:00:00 │ 2023-09-18 04:00:00 │ 82 │ 98.9598 │ 0.2715 │ 0.2744% │ 3.8265 │ 3.837 │
180
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
181
- │ BTC-EUR │ 2023-09-07 08:00:00 │ 2023-09-10 18:00:00 │ 82 │ 98.5979 │ 0.1801 │ 0.1827% │ 24048.3 │ 24092.2 │
182
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
183
- │ DOT-EUR │ 2023-09-07 02:00:00 │ 2023-09-09 04:00:00 │ 50 │ 99.0076 │ -0.3719 │ -0.3757% │ 3.993 │ 3.978 │
184
- ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
185
- │ DOT-EUR │ 2023-09-05 16:00:00 │ 2023-09-06 14:00:00 │ 22 │ 99.1603 │ -0.61 │ -0.6152% │ 3.9825 │ 3.958 │
175
+ │ DOT-EUR │ 2023-11-30 20:00:00 │ 2976.65 │ 107.104 0 0.0000% 5.0215
186
176
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
187
- DOT-EUR │ 2023-09-04 18:00:00 │ 2023-09-05 00:00:00 6 99.3611 -0.8044 -0.8096% 3.9525 3.9205
177
+ BTC-EUR │ 2023-11-29 14:00:00 │ 3006.65 107.095 0 │ 0.0000% 34546.6
188
178
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
189
- DOT-EUR │ 2023-09-04 12:00:00 │ 2023-09-04 16:00:00 │ 4 │ 99.5219 -0.6427-0.6458% 3.9485 3.923
179
+ BTC-EUR │ 2023-11-08 00:00:00 │ 2023-11-14 16:00:00 │ 160 │ 99.2265 1.33521.3456% 33075.5 33520.6
190
180
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
191
- │ BTC-EUR │ 2023-08-26 12:00:00 │ 2023-08-26 20:00:00 │ 8 98.9954 0.0268 │ 0.0271% 24145.2 │ 24151.8
181
+ │ BTC-EUR │ 2023-11-06 16:00:00 │ 2023-11-06 20:00:00 │ 4 97.8607 -0.0026-0.0026% 32620.2 │ 32619.4
192
182
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
193
- │ DOT-EUR │ 2023-08-25 12:00:00 │ 2023-08-28 12:00:00 │ 72 99.6416 -0.5051-0.5069% │ 4.14254.1215
183
+ │ DOT-EUR │ 2023-10-30 06:00:00 │ 2023-11-14 00:00:00 │ 354 100.551 24.879424.7430% │ 4.03755.0365
194
184
  ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
195
- DOT-EUR │ 2023-08-24 02:00:00 │ 2023-08-25 02:00:00 │ 24 99.9997 -1.4334-1.4334% 4.151 4.0915
185
+ BTC-EUR │ 2023-09-13 16:00:00 │ 2023-09-22 16:00:00 │ 216 97.8529 2.20512.2534% 24463.2 25014.5
196
186
  ╰─────────┴─────────────────────┴─────────────────────┴────────────────────┴──────────────┴──────────────────┴───────────────────────┴────────────────────┴─────────────────────╯
197
187
  ==================================================================
198
188
  ```
@@ -7,7 +7,8 @@ from investing_algorithm_framework.domain import ApiException, \
7
7
  PortfolioConfiguration, RESOURCE_DIRECTORY, pretty_print_backtest, \
8
8
  Trade, OHLCVMarketDataSource, OrderBookMarketDataSource, SYMBOLS, \
9
9
  TickerMarketDataSource, MarketService, BacktestReportsEvaluation, \
10
- pretty_print_backtest_reports_evaluation, load_backtest_reports
10
+ pretty_print_backtest_reports_evaluation, load_backtest_reports, \
11
+ RESERVED_BALANCES, APP_MODE, AppMode, DATETIME_FORMAT
11
12
  from investing_algorithm_framework.app import TradingStrategy, \
12
13
  StatelessAction, Task
13
14
  from investing_algorithm_framework.infrastructure import \
@@ -55,5 +56,9 @@ __all__ = [
55
56
  "pretty_print_backtest_reports_evaluation",
56
57
  "BacktestReportsEvaluation",
57
58
  "load_backtest_reports",
58
- "SYMBOLS"
59
+ "SYMBOLS",
60
+ "RESERVED_BALANCES",
61
+ "APP_MODE",
62
+ "AppMode",
63
+ "DATETIME_FORMAT",
59
64
  ]
@@ -727,12 +727,17 @@ class Algorithm:
727
727
  .get_all()
728
728
 
729
729
  else:
730
- query_params = {
731
- "market": market,
732
- "identifier": identifier
733
- }
734
- portfolio_configurations = [self.portfolio_configuration_service
735
- .find(query_params)]
730
+ query_params = {"market": market, "identifier": identifier}
731
+ portfolio_configuration = self.portfolio_configuration_service \
732
+ .find(query_params)
733
+
734
+ if not portfolio_configuration:
735
+ raise OperationalException("No portfolio found.")
736
+
737
+ portfolio_configurations = [portfolio_configuration]
738
+
739
+ if len(portfolio_configurations) == 0:
740
+ raise OperationalException("No portfolio found.")
736
741
 
737
742
  portfolios = []
738
743