investing-algorithm-framework 2.2.4__tar.gz → 2.3.1__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 (140) hide show
  1. investing_algorithm_framework-2.3.1/PKG-INFO +353 -0
  2. investing_algorithm_framework-2.3.1/README.md +315 -0
  3. investing_algorithm_framework-2.3.1/investing_algorithm_framework/domain/models/time_frame.py +116 -0
  4. investing_algorithm_framework-2.3.1/investing_algorithm_framework/domain/services/market_data_sources.py +380 -0
  5. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/__init__.py +2 -0
  6. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/market_data_sources/ccxt.py +172 -215
  7. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/market_data_sources/csv.py +2 -0
  8. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/market_data_source_service/backtest_market_data_source_service.py +5 -1
  9. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/order_service/order_backtest_service.py +16 -24
  10. investing_algorithm_framework-2.3.1/investing_algorithm_framework.egg-info/PKG-INFO +353 -0
  11. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework.egg-info/requires.txt +1 -0
  12. investing_algorithm_framework-2.2.4/PKG-INFO +0 -416
  13. investing_algorithm_framework-2.2.4/README.md +0 -379
  14. investing_algorithm_framework-2.2.4/investing_algorithm_framework/domain/models/time_frame.py +0 -157
  15. investing_algorithm_framework-2.2.4/investing_algorithm_framework/domain/services/market_data_sources.py +0 -250
  16. investing_algorithm_framework-2.2.4/investing_algorithm_framework.egg-info/PKG-INFO +0 -416
  17. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/AUTHORS.md +0 -0
  18. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/LICENSE +0 -0
  19. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/__init__.py +0 -0
  20. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/__init__.py +0 -0
  21. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/algorithm.py +0 -0
  22. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/app.py +0 -0
  23. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
  24. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
  25. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
  26. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
  27. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +0 -0
  28. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
  29. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/strategy.py +0 -0
  30. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/task.py +0 -0
  31. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/__init__.py +0 -0
  32. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/controllers/__init__.py +0 -0
  33. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/controllers/orders.py +0 -0
  34. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -0
  35. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/controllers/positions.py +0 -0
  36. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/create_app.py +0 -0
  37. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/error_handler.py +0 -0
  38. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/responses.py +0 -0
  39. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
  40. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/schemas/__init__.py +0 -0
  41. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/schemas/order.py +0 -0
  42. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
  43. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
  44. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/app/web/setup_cors.py +0 -0
  45. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/create_app.py +0 -0
  46. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/dependency_container.py +0 -0
  47. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/__init__.py +0 -0
  48. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/config.py +0 -0
  49. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/constants.py +0 -0
  50. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/data_structures.py +0 -0
  51. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
  52. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/exceptions.py +0 -0
  53. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/__init__.py +0 -0
  54. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/backtest_profile.py +0 -0
  55. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/base_model.py +0 -0
  56. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
  57. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/market/market_credential.py +0 -0
  58. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
  59. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/order/order.py +0 -0
  60. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/order/order_fee.py +0 -0
  61. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/order/order_side.py +0 -0
  62. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/order/order_status.py +0 -0
  63. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/order/order_type.py +0 -0
  64. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/portfolio/__init__.py +0 -0
  65. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +0 -0
  66. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -0
  67. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +0 -0
  68. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
  69. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/position/position.py +0 -0
  70. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -0
  71. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/strategy_profile.py +0 -0
  72. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
  73. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
  74. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/trade.py +0 -0
  75. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/trading_data_types.py +0 -0
  76. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/models/trading_time_frame.py +0 -0
  77. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/services/__init__.py +0 -0
  78. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/services/market_service.py +0 -0
  79. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/singleton.py +0 -0
  80. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
  81. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/strategy.py +0 -0
  82. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/utils/__init__.py +0 -0
  83. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/utils/backtesting.py +0 -0
  84. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/utils/csv.py +0 -0
  85. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/utils/random.py +0 -0
  86. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
  87. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
  88. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
  89. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
  90. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +0 -0
  91. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/__init__.py +0 -0
  92. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
  93. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/market_data_sources/__init__.py +0 -0
  94. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
  95. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -0
  96. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/order/order.py +0 -0
  97. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/order/order_fee.py +0 -0
  98. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
  99. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio.py +0 -0
  100. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +0 -0
  101. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
  102. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/position/position.py +0 -0
  103. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +0 -0
  104. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/repositories/__init__.py +0 -0
  105. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/repositories/order_fee_repository.py +0 -0
  106. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +0 -0
  107. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
  108. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
  109. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
  110. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
  111. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/repositories/repository.py +0 -0
  112. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/services/__init__.py +0 -0
  113. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/services/market_service/__init__.py +0 -0
  114. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/services/market_service/ccxt_market_service.py +0 -0
  115. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/services/performance_service/__init__.py +0 -0
  116. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/services/performance_service/backtest_performance_service.py +0 -0
  117. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/infrastructure/services/performance_service/performance_service.py +0 -0
  118. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/__init__.py +0 -0
  119. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/backtest_service.py +0 -0
  120. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/configuration_service.py +0 -0
  121. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/market_credential_service.py +0 -0
  122. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/market_data_source_service/__init__.py +0 -0
  123. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/market_data_source_service/market_data_source_service.py +0 -0
  124. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
  125. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/order_service/order_service.py +0 -0
  126. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/portfolio_configuration_service.py +0 -0
  127. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/portfolio_service/__init__.py +0 -0
  128. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/portfolio_service/backtest_portfolio_service.py +0 -0
  129. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/portfolio_service/portfolio_service.py +0 -0
  130. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/portfolio_snapshot_service.py +0 -0
  131. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/position_service.py +0 -0
  132. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/position_snapshot_service.py +0 -0
  133. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/repository_service.py +0 -0
  134. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework/services/strategy_orchestrator_service.py +0 -0
  135. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework.egg-info/SOURCES.txt +0 -0
  136. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework.egg-info/dependency_links.txt +0 -0
  137. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/investing_algorithm_framework.egg-info/top_level.txt +0 -0
  138. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/setup.cfg +0 -0
  139. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/setup.py +0 -0
  140. {investing_algorithm_framework-2.2.4 → investing_algorithm_framework-2.3.1}/tests/test_create_app.py +0 -0
@@ -0,0 +1,353 @@
1
+ Metadata-Version: 2.1
2
+ Name: investing_algorithm_framework
3
+ Version: 2.3.1
4
+ Summary: A framework for creating an investment algorithm
5
+ Home-page: https://github.com/coding-kitties/investing-algorithm-framework.git
6
+ Download-URL: https://github.com/coding-kitties/investing-algorithm-framework/archive/v0.1.1.tar.gz
7
+ Author: coding kitties
8
+ License: Apache License 2.0
9
+ Keywords: TRADING,INVESTING,BOT,ALGORITHM,FRAMEWORK
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.4
13
+ Classifier: Programming Language :: Python :: 3.5
14
+ Classifier: Programming Language :: Python :: 3.6
15
+ Classifier: Topic :: Software Development
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Operating System :: OS Independent
18
+ Requires-Python: >=3
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ License-File: AUTHORS.md
22
+ Requires-Dist: wrapt>=1.11.2
23
+ Requires-Dist: Flask>=2.3.2
24
+ Requires-Dist: Flask-Migrate>=2.6.0
25
+ Requires-Dist: Flask-Cors>=3.0.9
26
+ Requires-Dist: SQLAlchemy>=2.0.18
27
+ Requires-Dist: marshmallow>=3.5.0
28
+ Requires-Dist: setuptools>=60.9.0
29
+ Requires-Dist: ccxt>=3.0.57
30
+ Requires-Dist: python-dateutil>=2.8.2
31
+ Requires-Dist: MarkupSafe>=2.1.2
32
+ Requires-Dist: dependency-injector>=4.40.0
33
+ Requires-Dist: schedule>=1.1.0
34
+ Requires-Dist: pandas>=2.0.0
35
+ Requires-Dist: tqdm>=4.66.1
36
+ Requires-Dist: tabulate>=0.9.0
37
+ Requires-Dist: polars[numpy,pandas]==0.20.5
38
+
39
+ <a href=https://investing-algorithm-framework.com><img src="https://img.shields.io/badge/docs-website-brightgreen"></a>
40
+ [![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)
41
+ [![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)
42
+ [![Downloads](https://pepy.tech/badge/investing-algorithm-framework)](https://pepy.tech/badge/investing-algorithm-framework)
43
+ [![Current Version](https://img.shields.io/pypi/v/investing_algorithm_framework.svg)](https://img.shields.io/pypi/v/investing_algorithm_framework.svg)
44
+ <a href="https://www.reddit.com/r/InvestingBots/"><img src="https://img.shields.io/reddit/subreddit-subscribers/investingbots?style=social"></a> <br/>
45
+ [![GitHub stars](https://img.shields.io/github/stars/coding-kitties/investing-algorithm-framework.svg?style=social&label=Star&maxAge=1)](https://github.com/SeaQL/sea-orm/stargazers/) If you like what we do, consider starring, sharing and contributing!
46
+
47
+ ###### Sponsors
48
+ <p align="left">
49
+ <a href="https://finterion.com">
50
+ <img alt="Finterion" src="https://logicfunds-web-app-images.s3.eu-central-1.amazonaws.com/finterion.png" width="200px" />
51
+ </a>
52
+ </p>
53
+
54
+
55
+ # [Investing Algorithm Framework](https://github.com/coding-kitties/investing-algorithm-framework)
56
+
57
+ The Investing Algorithm Framework is a Python tool that enables swift and
58
+ elegant development of trading bots. It comes with all the necessary
59
+ components for creating algorithms, including data provisioning,
60
+ portfolio management, and order execution.
61
+
62
+ Features:
63
+ * Order execution
64
+ * Broker and exchange connections through [ccxt](https://github.com/ccxt/ccxt)
65
+ * Backtesting and performance analysis reports
66
+ * Portfolio management
67
+ * Web API for interacting with your deployed trading bot
68
+ * Data persistence through sqlite db or an in-memory db
69
+ * Stateless running for cloud function deployments
70
+ * Polars dataframes support out of the box for fast data processing [pola.rs](https://pola.rs/)
71
+
72
+
73
+
74
+ ## Example implementation
75
+ The following algorithm connects to binance and buys BTC every 5 seconds.
76
+ It also exposes an REST API that allows you to interact with the algorithm.
77
+ ```python
78
+ import pathlib
79
+ from datetime import datetime, timedelta
80
+ from investing_algorithm_framework import create_app, PortfolioConfiguration, \
81
+ RESOURCE_DIRECTORY, TimeUnit, CCXTOHLCVMarketDataSource, Algorithm, \
82
+ CCXTTickerMarketDataSource, MarketCredential
83
+
84
+ # Define market data sources
85
+ bitvavo_btc_eur_ohlcv_2h = CCXTOHLCVMarketDataSource(
86
+ identifier="BTC-ohlcv",
87
+ market="BITVAVO",
88
+ symbol="BTC/EUR",
89
+ timeframe="2h",
90
+ window_size=200
91
+ )
92
+ # Ticker data for orders, trades and positions
93
+ bitvavo_btc_eur_ticker = CCXTTickerMarketDataSource(
94
+ identifier="BTC-ticker",
95
+ market="BITVAVO",
96
+ symbol="BTC/EUR",
97
+ )
98
+ app = create_app({RESOURCE_DIRECTORY: pathlib.Path(__file__).parent.resolve()})
99
+ app.add_market_data_source(bitvavo_btc_eur_ohlcv_2h)
100
+ app.add_market_data_source(bitvavo_btc_eur_ticker)
101
+ app.add_market_credential(MarketCredential(
102
+ market="bitvavo",
103
+ api_key="<your api key>",
104
+ secret_key="<your secret key>",
105
+ ))
106
+ app.add_portfolio_configuration(
107
+ PortfolioConfiguration(
108
+ market="bitvavo",
109
+ trading_symbol="EUR",
110
+ initial_balance=400
111
+ )
112
+ )
113
+
114
+ @app.strategy(
115
+ # Run every two hours
116
+ time_unit=TimeUnit.HOUR,
117
+ interval=2,
118
+ # Specify market data sources that need to be passed to the strategy
119
+ market_data_sources=["BTC-ticker", "BTC-ohlcv"]
120
+ )
121
+ def perform_strategy(algorithm: Algorithm, market_data: dict):
122
+ # By default data is passed as polars dataframe https://pola.rs/
123
+ df = market_data["BTC-ohlcv"].to_pandas()
124
+ ticker_data = market_data["BTC-ticker"]
125
+ algorithm.create_limit_order(
126
+ target_symbol="BTC/EUR",
127
+ order_side="buy",
128
+ amount=0.01,
129
+ price=ticker_data["ask"],
130
+ )
131
+
132
+ if __name__ == "__main__":
133
+ app.run()
134
+ ```
135
+
136
+ > You can find more examples [here](./examples) folder.
137
+
138
+ ## Backtesting
139
+ The framework also supports backtesting. You can use the same code as above,
140
+ but instead of running the algorithm, you can run a backtest.
141
+
142
+ ```python
143
+ import pathlib
144
+ from datetime import datetime, timedelta
145
+ from investing_algorithm_framework import create_app, RESOURCE_DIRECTORY, \
146
+ TimeUnit, CCXTOHLCVMarketDataSource, Algorithm, pretty_print_backtest, \
147
+ CCXTTickerMarketDataSource, PortfolioConfiguration
148
+
149
+ # Define market data sources
150
+ bitvavo_btc_eur_ohlcv_2h = CCXTOHLCVMarketDataSource(
151
+ identifier="BTC-ohlcv",
152
+ market="bitvavo",
153
+ symbol="BTC/EUR",
154
+ timeframe="2h",
155
+ window_size=200
156
+ )
157
+ bitvavo_btc_eur_ticker = CCXTTickerMarketDataSource(
158
+ identifier="BTC-ticker",
159
+ market="bitvavo",
160
+ symbol="BTC/EUR",
161
+ backtest_timeframe="2h" # We want the ticker data to
162
+ # be sampled every 2 hours, inline with the strategy interval
163
+ )
164
+ app = create_app({RESOURCE_DIRECTORY: pathlib.Path(__file__).parent.resolve()})
165
+ app.add_market_data_source(bitvavo_btc_eur_ohlcv_2h)
166
+ app.add_market_data_source(bitvavo_btc_eur_ticker)
167
+ app.add_portfolio_configuration(PortfolioConfiguration(
168
+ initial_balance=400,
169
+ market="bitvavo",
170
+ trading_symbol="EUR",
171
+ ))
172
+
173
+
174
+ @app.strategy(
175
+ time_unit=TimeUnit.HOUR,
176
+ interval=2,
177
+ market_data_sources=["BTC-ticker", "BTC-ohlcv"]
178
+ )
179
+ def perform_strategy(algorithm: Algorithm, market_data: dict):
180
+ print(
181
+ f"Performing trading strategy on market " +
182
+ f"data {market_data['BTC-ohlcv'] and market_data['BTC-ticker']}"
183
+ )
184
+
185
+ if __name__ == "__main__":
186
+ backtest_report = app.backtest(
187
+ start_date=datetime(2023, 11, 12) - timedelta(days=10),
188
+ end_date=datetime(2023, 11, 12),
189
+ )
190
+ pretty_print_backtest(backtest_report)
191
+ ```
192
+ For more examples, check out the [examples](./examples/backtesting) folder.
193
+
194
+ ### Backtesting report
195
+ You can use the ```pretty_print_backtest``` function to print a backtest report.
196
+ For example if you run the [moving average example trading bot](./examples/crossover_moving_average_trading_bot)
197
+ you will get the following backtesting report:
198
+
199
+ ```bash
200
+ ====================Backtest report===============================
201
+ * Start date: 2023-08-24 00:00:00
202
+ * End date: 2023-12-02 00:00:00
203
+ * Number of days: 100
204
+ * Number of runs: 1201
205
+ ====================Portfolio overview============================
206
+ * Number of orders: 40
207
+ * Initial balance: 400.0000 EUR
208
+ * Final balance: 428.2434 EUR
209
+ * Total net gain: 28.2434 EUR
210
+ * Total net gain percentage: 7.0609%
211
+ * Growth rate: 7.0609%
212
+ * Growth 28.2434 EUR
213
+ ====================Positions overview========================
214
+ ╭────────────┬──────────┬──────────────────┬──────────────┬───────────────┬───────────────────────────┬────────────────┬───────────────╮
215
+ │ Position │ Amount │ Pending amount │ Cost (EUR) │ Value (EUR) │ Percentage of portfolio │ Growth (EUR) │ Growth_rate │
216
+ ├────────────┼──────────┼──────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤
217
+ │ EUR │ 428.243 │ 0 │ 428.243 │ 428.243 │ 100.0000% │ 0 │ 0.0000% │
218
+ ╰────────────┴──────────┴──────────────────┴──────────────┴───────────────┴───────────────────────────┴────────────────┴───────────────╯
219
+ ====================Trades overview===========================
220
+ * Number of trades closed: 20
221
+ * Number of trades open: 0
222
+ * Percentage of positive trades: 30.0%
223
+ * Percentage of negative trades: 70.0%
224
+ * Average trade size: 100.9692 EUR
225
+ * Average trade duration: 83.6 hours
226
+ ╭─────────┬─────────────────────┬─────────────────────┬────────────────────┬──────────────┬──────────────────┬───────────────────────┬────────────────────┬─────────────────────╮
227
+ │ Pair │ Open date │ Close date │ Duration (hours) │ Size (EUR) │ Net gain (EUR) │ Net gain percentage │ Open price (EUR) │ Close price (EUR) │
228
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
229
+ │ DOT-EUR │ 2023-11-24 12:00:00 │ 2023-11-27 14:00:00 │ 74 │ 107.55 │ -1.9587 │ -1.8212% │ 4.777 │ 4.69 │
230
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
231
+ │ DOT-EUR │ 2023-11-20 00:00:00 │ 2023-11-21 08:00:00 │ 32 │ 109.39 │ -4.5949 │ -4.2005% │ 4.9875 │ 4.778 │
232
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
233
+ │ BTC-EUR │ 2023-11-19 22:00:00 │ 2023-11-22 00:00:00 │ 50 │ 109.309 │ -2.7624 │ -2.5272% │ 34159.1 │ 33295.9 │
234
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
235
+ │ BTC-EUR │ 2023-11-06 12:00:00 │ 2023-11-13 14:00:00 │ 170 │ 107.864 │ 6.1015 │ 5.6567% │ 32685.9 │ 34534.9 │
236
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
237
+ │ DOT-EUR │ 2023-10-20 12:00:00 │ 2023-10-27 08:00:00 │ 164 │ 99.085 │ 10.9799 │ 11.0813% │ 3.5465 │ 3.9395 │
238
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
239
+ │ BTC-EUR │ 2023-10-14 04:00:00 │ 2023-10-27 22:00:00 │ 330 │ 97.4278 │ 24.137 │ 24.7742% │ 25638.9 │ 31990.7 │
240
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
241
+ │ DOT-EUR │ 2023-10-14 04:00:00 │ 2023-10-17 14:00:00 │ 82 │ 99.5572 │ -1.8877 │ -1.8961% │ 3.56 │ 3.4925 │
242
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
243
+ │ DOT-EUR │ 2023-10-07 08:00:00 │ 2023-10-08 08:00:00 │ 24 │ 99.9498 │ -1.5708 │ -1.5716% │ 3.8815 │ 3.8205 │
244
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
245
+ │ BTC-EUR │ 2023-09-27 10:00:00 │ 2023-10-05 20:00:00 │ 202 │ 98.2888 │ 3.433 │ 3.4927% │ 25202.2 │ 26082.5 │
246
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
247
+ │ DOT-EUR │ 2023-09-27 10:00:00 │ 2023-10-03 20:00:00 │ 154 │ 98.7893 │ 1.2085 │ 1.2233% │ 3.842 │ 3.889 │
248
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
249
+ │ DOT-EUR │ 2023-09-25 12:00:00 │ 2023-09-27 04:00:00 │ 40 │ 98.9193 │ -0.5194 │ -0.5251% │ 3.809 │ 3.789 │
250
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
251
+ │ DOT-EUR │ 2023-09-14 16:00:00 │ 2023-09-18 02:00:00 │ 82 │ 98.9419 │ -0.0912 │ -0.0921% │ 3.799 │ 3.7955 │
252
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
253
+ │ BTC-EUR │ 2023-09-07 06:00:00 │ 2023-09-10 16:00:00 │ 82 │ 98.6093 │ 0.3412 │ 0.3460% │ 24051 │ 24134.3 │
254
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
255
+ │ DOT-EUR │ 2023-09-07 00:00:00 │ 2023-09-09 02:00:00 │ 50 │ 98.9158 │ -0.2358 │ -0.2383% │ 3.986 │ 3.9765 │
256
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
257
+ │ DOT-EUR │ 2023-09-05 14:00:00 │ 2023-09-06 12:00:00 │ 22 │ 99.2132 │ -1.1909 │ -1.2003% │ 3.999 │ 3.951 │
258
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
259
+ │ DOT-EUR │ 2023-09-04 16:00:00 │ 2023-09-04 22:00:00 │ 6 │ 99.355 │ -0.5671 │ -0.5708% │ 3.942 │ 3.9195 │
260
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
261
+ │ DOT-EUR │ 2023-09-04 10:00:00 │ 2023-09-04 14:00:00 │ 4 │ 99.4774 │ -0.4889 │ -0.4914% │ 3.968 │ 3.9485 │
262
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
263
+ │ BTC-EUR │ 2023-08-26 10:00:00 │ 2023-08-26 18:00:00 │ 8 │ 99.0829 │ -0.03 │ -0.0302% │ 24166.6 │ 24159.3 │
264
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
265
+ │ DOT-EUR │ 2023-08-25 10:00:00 │ 2023-08-28 10:00:00 │ 72 │ 99.659 │ -0.6975 │ -0.6999% │ 4.1435 │ 4.1145 │
266
+ ├─────────┼─────────────────────┼─────────────────────┼────────────────────┼──────────────┼──────────────────┼───────────────────────┼────────────────────┼─────────────────────┤
267
+ │ DOT-EUR │ 2023-08-24 00:00:00 │ 2023-08-25 00:00:00 │ 24 │ 99.9999 │ -1.3626 │ -1.3626% │ 4.1465 │ 4.09 │
268
+ ╰─────────┴─────────────────────┴─────────────────────┴────────────────────┴──────────────┴──────────────────┴───────────────────────┴────────────────────┴─────────────────────╯
269
+ ==================================================================
270
+ ```
271
+
272
+ ## Broker/Exchange configuration
273
+ The framework has by default support for [ccxt](https://github.com/ccxt/ccxt).
274
+ This should allow you to connect to a lot of brokers/exchanges.
275
+
276
+ ```python
277
+ from investing_algorithm_framework import PortfolioConfiguration, \
278
+ MarketCredential, create_app
279
+ app = create_app()
280
+ app.add_market_credential(
281
+ MarketCredential(
282
+ market="<your market>",
283
+ api_key="<your api key>",
284
+ secret_key="<your secret key>",
285
+ )
286
+ )
287
+ app.add_portfolio_configuration(
288
+ PortfolioConfiguration(
289
+ market="<your market>",
290
+ initial_balance=400,
291
+ track_from="01/01/2022",
292
+ trading_symbol="EUR"
293
+ )
294
+ )
295
+ ```
296
+
297
+ ## Performance
298
+ We continiously are working on improving the performance of the framework.
299
+
300
+ ## Download
301
+ You can download the framework with pypi.
302
+
303
+ ```bash
304
+ pip install investing-algorithm-framework
305
+ ```
306
+
307
+ ## Disclaimer
308
+ If you use this framework for your investments, do not risk money
309
+ which you are afraid to lose, until you have clear understanding how
310
+ the framework works. We can't stress this enough:
311
+
312
+ BEFORE YOU START USING MONEY WITH THE FRAMEWORK, MAKE SURE THAT YOU TESTED
313
+ YOUR COMPONENTS THOROUGHLY. USE THE SOFTWARE AT YOUR OWN RISK.
314
+ THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR INVESTMENT RESULTS.
315
+
316
+ Also, make sure that you read the source code of any plugin you use or
317
+ implementation of an algorithm made with this framework.
318
+
319
+ ## Documentation
320
+
321
+ All the documentation can be found online
322
+ at the [documentation webstie](https://investing-algorithm-framework.com)
323
+
324
+ In most cases, you'll probably never have to change code on this repo directly
325
+ if you are building your algorithm/bot. But if you do, check out the
326
+ contributing page at the website.
327
+
328
+ If you'd like to chat with investing-algorithm-framework users
329
+ and developers, [join us on Slack](https://inv-algo-framework.slack.com) or [join us on reddit](https://www.reddit.com/r/InvestingBots/)
330
+
331
+ ## Acknowledgements
332
+ We want to thank all contributors to this project. A full list of all
333
+ the people that contributed to the project can be
334
+ found [here](https://github.com/investing-algorithms/investing-algorithm-framework/blob/master/AUTHORS.md)
335
+
336
+ ### [Bugs / Issues](https://github.com/investing-algorithms/investing-algorithm-framework/issues?q=is%3Aissue)
337
+
338
+ If you discover a bug in the framework, please [search our issue tracker](https://github.com/investing-algorithms/investing-algorithm-framework/issues?q=is%3Aissue)
339
+ first. If it hasn't been reported, please [create a new issue](https://github.com/investing-algorithms/investing-algorithm-framework/issues/new).
340
+
341
+ ### Contributing
342
+ The investing algorithm framework is a community driven project.
343
+ We welcome you to participate, contribute and together help build
344
+ the future trading bots developed in pyhton.
345
+
346
+ Feel like the framework is missing a feature? We welcome your pull requests!
347
+ If you want to contribute to the project roadmap, please take a look at the [project board](https://github.com/coding-kitties/investing-algorithm-framework/projects?query=is%3Aopen).
348
+ You can pick up a task by assigning yourself to it.
349
+
350
+ **Note** before starting any major new feature work, *please open an issue describing what you are planning to do*.
351
+ This will ensure that interested parties can give valuable feedback on the feature, and let others know that you are working on it.
352
+
353
+ **Important:** Always create your feature or hotfix against the `develop` branch, not `master`.