pfund 0.0.1.dev8__tar.gz → 0.0.1.dev10__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 (175) hide show
  1. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/PKG-INFO +10 -7
  2. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/README.md +7 -4
  3. pfund-0.0.1.dev10/pfund/CONTRIBUTING.md +19 -0
  4. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/engines/backtest_engine.py +5 -3
  5. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/engines/base_engine.py +5 -3
  6. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/engines/trade_engine.py +4 -15
  7. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/engines/train_engine.py +4 -2
  8. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api.py +5 -2
  9. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/ws_api.py +5 -2
  10. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/ws_api_base.py +5 -2
  11. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/investment_profile.py +2 -0
  12. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/managers/connection_manager.py +5 -2
  13. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/managers/strategy_manager.py +4 -1
  14. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/models/model_backtest.py +2 -2
  15. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/strategies/strategy_backtest.py +6 -1
  16. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/zeromq.py +4 -1
  17. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pyproject.toml +4 -4
  18. pfund-0.0.1.dev8/pfund/CONTRIBUTING.md +0 -11
  19. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/LICENSE +0 -0
  20. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/__init__.py +0 -0
  21. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/accounts/__init__.py +0 -0
  22. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/accounts/account_base.py +0 -0
  23. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/accounts/account_crypto.py +0 -0
  24. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/accounts/account_ib.py +0 -0
  25. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/adapter.py +0 -0
  26. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/analyzer.py +0 -0
  27. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/balances/__init__.py +0 -0
  28. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/balances/balance_base.py +0 -0
  29. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/balances/balance_crypto.py +0 -0
  30. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/balances/balance_ib.py +0 -0
  31. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/brokers/__init__.py +0 -0
  32. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/brokers/broker_backtest.py +0 -0
  33. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/brokers/broker_base.py +0 -0
  34. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/brokers/broker_crypto.py +0 -0
  35. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/brokers/broker_live.py +0 -0
  36. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/brokers/ib/__init__.py +0 -0
  37. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/brokers/ib/broker_ib.py +0 -0
  38. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/brokers/ib/ib_api.py +0 -0
  39. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/brokers/ib/ib_client.py +0 -0
  40. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/brokers/ib/ib_wrapper.py +0 -0
  41. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/cli/__init__.py +0 -0
  42. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/cli/commands/__init__.py +0 -0
  43. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/cli/commands/config.py +0 -0
  44. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/cli/commands/docker_compose.py +0 -0
  45. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/cli/main.py +0 -0
  46. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/config.yml +0 -0
  47. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/lot_sizes_inverse.yml +0 -0
  48. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/lot_sizes_linear.yml +0 -0
  49. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/lot_sizes_option.yml +0 -0
  50. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/lot_sizes_spot.yml +0 -0
  51. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/pdt_matchings_inverse.yml +0 -0
  52. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/pdt_matchings_linear.yml +0 -0
  53. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/pdt_matchings_option.yml +0 -0
  54. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/pdt_matchings_spot.yml +0 -0
  55. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/tick_sizes_inverse.yml +0 -0
  56. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/tick_sizes_linear.yml +0 -0
  57. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/tick_sizes_option.yml +0 -0
  58. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/bybit/tick_sizes_spot.yml +0 -0
  59. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/configuration.py +0 -0
  60. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/ib/config.yml +0 -0
  61. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config/logging.yml +0 -0
  62. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/config_handler.py +0 -0
  63. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/const/__init__.py +0 -0
  64. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/const/_zmq_routes.py +0 -0
  65. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/const/commons.py +0 -0
  66. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/const/paths.py +0 -0
  67. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/data_tools/data_tool_base.py +0 -0
  68. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/data_tools/data_tool_pandas.py +0 -0
  69. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/datas/__init__.py +0 -0
  70. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/datas/data_bar.py +0 -0
  71. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/datas/data_base.py +0 -0
  72. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/datas/data_quote.py +0 -0
  73. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/datas/data_tick.py +0 -0
  74. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/datas/data_time_based.py +0 -0
  75. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/datas/resolution.py +0 -0
  76. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/datas/timeframe.py +0 -0
  77. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/engines/__init__.py +0 -0
  78. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/engines/test_engine.py +0 -0
  79. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/errors.py +0 -0
  80. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/__init__.py +0 -0
  81. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/__init__.py +0 -0
  82. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/exchange.py +0 -0
  83. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_result_inverse +0 -0
  84. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_result_linear +0 -0
  85. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_result_option +0 -0
  86. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_result_spot +0 -0
  87. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_return_inverse +0 -0
  88. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_return_linear +0 -0
  89. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_return_option +0 -0
  90. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_return_spot +0 -0
  91. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/types.py +0 -0
  92. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/exchange_base.py +0 -0
  93. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/exchanges/rest_api_base.py +0 -0
  94. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/__init__.py +0 -0
  95. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/account_summary_tags.py +0 -0
  96. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/client.py +0 -0
  97. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/comm.py +0 -0
  98. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/commission_report.py +0 -0
  99. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/common.py +0 -0
  100. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/connection.py +0 -0
  101. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/contract.py +0 -0
  102. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/decoder.py +0 -0
  103. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/enum_implem.py +0 -0
  104. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/errors.py +0 -0
  105. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/execution.py +0 -0
  106. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/ibapi.pyproj +0 -0
  107. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/message.py +0 -0
  108. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/news.py +0 -0
  109. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/object_implem.py +0 -0
  110. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/order.py +0 -0
  111. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/order_condition.py +0 -0
  112. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/order_state.py +0 -0
  113. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/orderdecoder.py +0 -0
  114. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/reader.py +0 -0
  115. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/scanner.py +0 -0
  116. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/server_versions.py +0 -0
  117. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/softdollartier.py +0 -0
  118. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/tag_value.py +0 -0
  119. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/ticktype.py +0 -0
  120. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/utils.py +0 -0
  121. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/externals/ibapi/wrapper.py +0 -0
  122. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/indicators/__init__.py +0 -0
  123. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/indicators/indicator_base.py +0 -0
  124. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/indicators/ta_indicator.py +0 -0
  125. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/indicators/talib_indicator.py +0 -0
  126. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/main.py +0 -0
  127. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/managers/__init__.py +0 -0
  128. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/managers/base_manager.py +0 -0
  129. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/managers/data_manager.py +0 -0
  130. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/managers/order_manager.py +0 -0
  131. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/managers/portfolio_manager.py +0 -0
  132. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/managers/risk_manager.py +0 -0
  133. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/mixins/backtest.py +0 -0
  134. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/models/__init__.py +0 -0
  135. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/models/model_base.py +0 -0
  136. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/models/model_meta.py +0 -0
  137. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/models/pytorch_model.py +0 -0
  138. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/models/sklearn_model.py +0 -0
  139. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/orders/__init__.py +0 -0
  140. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/orders/order_base.py +0 -0
  141. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/orders/order_crypto.py +0 -0
  142. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/orders/order_ib.py +0 -0
  143. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/orders/order_statuses.py +0 -0
  144. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/orders/order_time_in_force.py +0 -0
  145. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/plogging/__init__.py +0 -0
  146. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/plogging/config.py +0 -0
  147. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/plogging/filters.py +0 -0
  148. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/plogging/formatter.py +0 -0
  149. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/plogging/handlers.py +0 -0
  150. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/portfolio.py +0 -0
  151. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/positions/__init__.py +0 -0
  152. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/positions/position_base.py +0 -0
  153. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/positions/position_crypto.py +0 -0
  154. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/positions/position_ib.py +0 -0
  155. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/products/__init__.py +0 -0
  156. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/products/product_base.py +0 -0
  157. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/products/product_crypto.py +0 -0
  158. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/products/product_ib.py +0 -0
  159. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/risk_monitor.py +0 -0
  160. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/strategies/__init__.py +0 -0
  161. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/strategies/allocation_strategy.py +0 -0
  162. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/strategies/diversification_strategy.py +0 -0
  163. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/strategies/hedging_strategy.py +0 -0
  164. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/strategies/optimization_strategy.py +0 -0
  165. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/strategies/portfolio_strategy.py +0 -0
  166. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/strategies/rebalancing_strategy.py +0 -0
  167. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/strategies/strategy_base.py +0 -0
  168. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/strategies/strategy_meta.py +0 -0
  169. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/types/backtest.py +0 -0
  170. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/types/common_literals.py +0 -0
  171. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/types/core.py +0 -0
  172. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/universe.py +0 -0
  173. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/utils/aliases.py +0 -0
  174. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/utils/envs.py +0 -0
  175. {pfund-0.0.1.dev8 → pfund-0.0.1.dev10}/pfund/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pfund
3
- Version: 0.0.1.dev8
3
+ Version: 0.0.1.dev10
4
4
  Summary: A Complete Algo-Trading Framework for Machine Learning, enabling trading across TradFi, CeFi and DeFi. Supports Vectorized and Event-Driven Backtesting, Paper and Live Trading
5
5
  Home-page: https://pfund.ai
6
6
  License: Apache-2.0
@@ -19,9 +19,8 @@ Requires-Dist: click (>=8.1.7,<9.0.0)
19
19
  Requires-Dist: gitpython (>=3.1.43,<4.0.0)
20
20
  Requires-Dist: mlflow (>=2.11.3,<3.0.0) ; extra == "ml"
21
21
  Requires-Dist: orjson (>=3.9.14,<4.0.0) ; extra == "data"
22
- Requires-Dist: pfeed[boost,df] (>=0.0.1.dev8,<0.0.2) ; extra == "data"
22
+ Requires-Dist: pfeed[boost,data,df] (>=0.0.1.dev10,<0.0.2) ; extra == "data"
23
23
  Requires-Dist: platformdirs (>=4.2.0,<5.0.0)
24
- Requires-Dist: psutil (>=5.9.8,<6.0.0) ; extra == "data"
25
24
  Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
26
25
  Requires-Dist: python-telegram-bot (>=20.7,<21.0)
27
26
  Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
@@ -32,6 +31,7 @@ Requires-Dist: schedule (>=1.2.1,<2.0.0)
32
31
  Requires-Dist: scikit-learn (>=1.4.0,<2.0.0) ; extra == "ml"
33
32
  Requires-Dist: ta (>=0.11.0,<0.12.0) ; extra == "ml"
34
33
  Requires-Dist: torch (>=2.1.2,<3.0.0) ; extra == "ml"
34
+ Requires-Dist: tqdm (>=4.66.2,<5.0.0)
35
35
  Requires-Dist: websocket-client (>=1.7.0,<2.0.0)
36
36
  Project-URL: Documentation, https://pfund-docs.pfund.ai
37
37
  Project-URL: Repository, https://github.com/PFund-Software-Ltd/pfund
@@ -143,13 +143,19 @@ This overview already omits some intricate steps, such as data handling and API
143
143
 
144
144
  ### Using [Poetry] (Recommended)
145
145
  ```bash
146
+ # [RECOMMENDED]: trading + backtest
147
+ poetry add "pfund[data]"
148
+
149
+ # [Machine Learning]: trading + backtest + machine learning/technical analysis
150
+ poetry add "pfund[data,ml]"
151
+
152
+ # only trading
146
153
  poetry add pfund
147
154
 
148
155
  # update to the latest version:
149
156
  poetry update pfund
150
157
  ```
151
158
 
152
-
153
159
  ### Using Pip
154
160
  ```bash
155
161
  pip install pfund
@@ -158,12 +164,9 @@ pip install pfund
158
164
  pip install -U pfund
159
165
  ```
160
166
 
161
-
162
167
  ### Checking your installation
163
168
  ```bash
164
169
  $ pfund --version
165
-
166
- pfund, version 0.0.1.dev4
167
170
  ```
168
171
 
169
172
 
@@ -104,13 +104,19 @@ This overview already omits some intricate steps, such as data handling and API
104
104
 
105
105
  ### Using [Poetry] (Recommended)
106
106
  ```bash
107
+ # [RECOMMENDED]: trading + backtest
108
+ poetry add "pfund[data]"
109
+
110
+ # [Machine Learning]: trading + backtest + machine learning/technical analysis
111
+ poetry add "pfund[data,ml]"
112
+
113
+ # only trading
107
114
  poetry add pfund
108
115
 
109
116
  # update to the latest version:
110
117
  poetry update pfund
111
118
  ```
112
119
 
113
-
114
120
  ### Using Pip
115
121
  ```bash
116
122
  pip install pfund
@@ -119,12 +125,9 @@ pip install pfund
119
125
  pip install -U pfund
120
126
  ```
121
127
 
122
-
123
128
  ### Checking your installation
124
129
  ```bash
125
130
  $ pfund --version
126
-
127
- pfund, version 0.0.1.dev4
128
131
  ```
129
132
 
130
133
 
@@ -0,0 +1,19 @@
1
+ ## Installation
2
+ ```bash
3
+ git clone git@github.com:PFund-Software-Ltd/pfund.git
4
+ cd pfund
5
+ git submodule update --init --recursive
6
+ poetry install --all-extras
7
+ ```
8
+
9
+ ## Pull updates
10
+ ```bash
11
+ # --recurse-submodules also updates each submodule to the commit specified by the main repository,
12
+ git pull --recurse-submodules # = git pull + git submodule update --recursive
13
+ ```
14
+
15
+ ## Build Documentation using [jupyterbook](https://jupyterbook.org/)
16
+ ```bash
17
+ # at the root directory, run:
18
+ jb build docs/ [--all]
19
+ ```
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  import hashlib
2
4
  import os
3
5
  import time
@@ -8,9 +10,9 @@ import uuid
8
10
  from typing import TYPE_CHECKING
9
11
  if TYPE_CHECKING:
10
12
  from pfund.types.common_literals import tSUPPORTED_BACKTEST_MODES, tSUPPORTED_DATA_TOOLS
13
+ from pfund.types.core import tStrategy, tModel, tFeature, tIndicator
11
14
 
12
15
  import pfund as pf
13
- from pfund.types.core import tStrategy, tModel, tFeature, tIndicator
14
16
  from pfund.engines.base_engine import BaseEngine
15
17
  from pfund.brokers.broker_backtest import BacktestBroker
16
18
  from pfund.strategies.strategy_base import BaseStrategy
@@ -21,7 +23,7 @@ from pfund.mixins.backtest import BacktestMixin
21
23
 
22
24
 
23
25
  class BacktestEngine(BaseEngine):
24
- def __new__(cls, *, env: str='BACKTEST', data_tool: 'tSUPPORTED_DATA_TOOLS'='pandas', mode: 'tSUPPORTED_BACKTEST_MODES'='vectorized', append_to_strategy_df=False, use_prepared_signals=True, config: ConfigHandler | None=None, **settings):
26
+ def __new__(cls, *, env: str='BACKTEST', data_tool: tSUPPORTED_DATA_TOOLS='pandas', mode: tSUPPORTED_BACKTEST_MODES='vectorized', append_to_strategy_df=False, use_prepared_signals=True, config: ConfigHandler | None=None, **settings):
25
27
  if not hasattr(cls, 'mode'):
26
28
  cls.mode = mode.lower()
27
29
  if not hasattr(cls, 'append_to_strategy_df'):
@@ -32,7 +34,7 @@ class BacktestEngine(BaseEngine):
32
34
  cls.use_prepared_signals = use_prepared_signals
33
35
  return super().__new__(cls, env, data_tool=data_tool, config=config, **settings)
34
36
 
35
- def __init__(self, *, env: str='BACKTEST', data_tool: 'tSUPPORTED_DATA_TOOLS'='pandas', mode: 'tSUPPORTED_BACKTEST_MODES'='vectorized', append_to_strategy_df=False, use_prepared_signals=True, config: ConfigHandler | None=None, **settings):
37
+ def __init__(self, *, env: str='BACKTEST', data_tool: tSUPPORTED_DATA_TOOLS='pandas', mode: tSUPPORTED_BACKTEST_MODES='vectorized', append_to_strategy_df=False, use_prepared_signals=True, config: ConfigHandler | None=None, **settings):
36
38
  super().__init__(env, data_tool=data_tool)
37
39
  # avoid re-initialization to implement singleton class correctly
38
40
  # if not hasattr(self, '_initialized'):
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  import os
2
4
  import logging
3
5
  import importlib
@@ -31,7 +33,7 @@ ENV_COLORS = {
31
33
  class BaseEngine(Singleton):
32
34
  _PROCESS_NO_PONG_TOLERANCE_IN_SECONDS = 30
33
35
 
34
- def __new__(cls, env, data_tool: 'tSUPPORTED_DATA_TOOLS'='pandas', config: ConfigHandler | None=None, **settings):
36
+ def __new__(cls, env, data_tool: tSUPPORTED_DATA_TOOLS='pandas', config: ConfigHandler | None=None, **settings):
35
37
  if not hasattr(cls, 'env'):
36
38
  cls.env = env.upper() if isinstance(env, str) else str(env).upper()
37
39
  assert cls.env in SUPPORTED_ENVIRONMENTS, f'env={cls.env} is not supported'
@@ -54,7 +56,7 @@ class BaseEngine(Singleton):
54
56
  cls.logging_configurator: LoggingDictConfigurator = set_up_loggers(log_path, logging_config_file_path, user_logging_config=cls.config.logging_config)
55
57
  return super().__new__(cls)
56
58
 
57
- def __init__(self, env, data_tool: 'tSUPPORTED_DATA_TOOLS'='pandas', config: ConfigHandler | None=None, **settings):
59
+ def __init__(self, env, data_tool: tSUPPORTED_DATA_TOOLS='pandas', config: ConfigHandler | None=None, **settings):
58
60
  # avoid re-initialization to implement singleton class correctly
59
61
  if not hasattr(self, '_initialized'):
60
62
  self.logger = logging.getLogger('pfund')
@@ -74,7 +76,7 @@ class BaseEngine(Singleton):
74
76
  def get_strategy(self, strat: str) -> BaseStrategy | None:
75
77
  return self.strategy_manager.get_strategy(strat)
76
78
 
77
- def add_strategy(self, strategy: 'tStrategy', name: str='', is_parallel=False) -> 'tStrategy':
79
+ def add_strategy(self, strategy: tStrategy, name: str='', is_parallel=False) -> tStrategy:
78
80
  return self.strategy_manager.add_strategy(strategy, name=name, is_parallel=is_parallel)
79
81
 
80
82
  def remove_strategy(self, strat: str):
@@ -9,6 +9,8 @@ components at the highest level such as:
9
9
  In order to communicate with other processes, it uses ZeroMQ as the core
10
10
  message queue.
11
11
  """
12
+ from __future__ import annotations
13
+
12
14
  import time
13
15
  from threading import Thread
14
16
 
@@ -17,7 +19,6 @@ if TYPE_CHECKING:
17
19
  from pfund.types.common_literals import tSUPPORTED_DATA_TOOLS
18
20
 
19
21
  import schedule
20
- import psutil
21
22
 
22
23
  from pfund.engines.base_engine import BaseEngine
23
24
  from pfund.brokers.broker_base import BaseBroker
@@ -29,13 +30,13 @@ from pfund.config_handler import ConfigHandler
29
30
  class TradeEngine(BaseEngine):
30
31
  zmq_ports = {}
31
32
 
32
- def __new__(cls, *, env: str='PAPER', data_tool: 'tSUPPORTED_DATA_TOOLS'='pandas', zmq_port=5557, config: ConfigHandler | None=None, **settings):
33
+ def __new__(cls, *, env: str='PAPER', data_tool: tSUPPORTED_DATA_TOOLS='pandas', zmq_port=5557, config: ConfigHandler | None=None, **settings):
33
34
  if not hasattr(cls, 'zmq_port'):
34
35
  assert isinstance(zmq_port, int), f'{zmq_port=} must be an integer'
35
36
  cls._zmq_port = zmq_port
36
37
  return super().__new__(cls, env, data_tool=data_tool, config=config, **settings)
37
38
 
38
- def __init__(self, *, env: str='PAPER', data_tool: 'tSUPPORTED_DATA_TOOLS'='pandas', zmq_port=5557, config: ConfigHandler | None=None, **settings):
39
+ def __init__(self, *, env: str='PAPER', data_tool: tSUPPORTED_DATA_TOOLS='pandas', zmq_port=5557, config: ConfigHandler | None=None, **settings):
39
40
  super().__init__(env, data_tool=data_tool)
40
41
  # avoid re-initialization to implement singleton class correctly
41
42
  if not hasattr(self, '_initialized'):
@@ -114,18 +115,6 @@ class TradeEngine(BaseEngine):
114
115
  if restart_strats := [strat for strat, strategy in self.strategy_manager.strategies.items() if strategy.is_parallel() and not self.strategy_manager.is_process_healthy(strat)]:
115
116
  self.strategy_manager.restart(restart_strats, reason='process not responding')
116
117
 
117
- # TODO, should be called by dashboard
118
- def monitor_cpu_usage(self):
119
- pcts = psutil.cpu_percent(interval=1, percpu=True)
120
- for cpu_num in range(len(pcts)):
121
- pct = pcts[cpu_num]
122
- if pct > 0:
123
- self.logger.warning(f'cpu {cpu_num} has {pct}% usage')
124
-
125
- # TODO, in case no more space for logs
126
- def monitor_memory_usage():
127
- pass
128
-
129
118
  def run_regular_tasks(self):
130
119
  for broker in self.brokers.values():
131
120
  broker.run_regular_tasks()
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from typing import TYPE_CHECKING
2
4
  if TYPE_CHECKING:
3
5
  from pfund.types.common_literals import tSUPPORTED_BACKTEST_MODES, tSUPPORTED_DATA_TOOLS
@@ -7,10 +9,10 @@ from pfund.config_handler import ConfigHandler
7
9
 
8
10
 
9
11
  class TrainEngine(BacktestEngine):
10
- def __new__(cls, *, data_tool: 'tSUPPORTED_DATA_TOOLS'='pandas', mode: 'tSUPPORTED_BACKTEST_MODES'='vectorized', config: ConfigHandler | None=None, **settings):
12
+ def __new__(cls, *, data_tool: tSUPPORTED_DATA_TOOLS='pandas', mode: tSUPPORTED_BACKTEST_MODES='vectorized', config: ConfigHandler | None=None, **settings):
11
13
  return super().__new__(cls, env='TRAIN', data_tool=data_tool, mode=mode, config=config, **settings)
12
14
 
13
- def __init__(self, *, data_tool: 'tSUPPORTED_DATA_TOOLS'='pandas', mode: 'tSUPPORTED_BACKTEST_MODES'='vectorized', config: ConfigHandler | None=None, **settings):
15
+ def __init__(self, *, data_tool: tSUPPORTED_DATA_TOOLS='pandas', mode: tSUPPORTED_BACKTEST_MODES='vectorized', config: ConfigHandler | None=None, **settings):
14
16
  super().__init__(env='TRAIN', data_tool=data_tool)
15
17
  # avoid re-initialization to implement singleton class correctly
16
18
  # if not hasattr(self, '_initialized'):
@@ -1,7 +1,10 @@
1
1
  import urllib
2
2
  import hmac
3
3
  import hashlib
4
- import orjson
4
+ try:
5
+ import orjson as json
6
+ except ImportError:
7
+ import json
5
8
 
6
9
  from requests import Response
7
10
 
@@ -49,7 +52,7 @@ class RestApi(BaseRestApi):
49
52
  recv_window = '5000'
50
53
  query_str = timestamp + account.key + recv_window
51
54
  if req.method == 'POST':
52
- query_str += orjson.dumps(req.json)
55
+ query_str += json.dumps(req.json)
53
56
  elif req.method == 'GET':
54
57
  query_str += urllib.parse.urlencode(req.params)
55
58
  else:
@@ -1,5 +1,8 @@
1
1
  import time
2
- import orjson
2
+ try:
3
+ import orjson as json
4
+ except ImportError:
5
+ import json
3
6
  import hmac
4
7
  from decimal import Decimal
5
8
 
@@ -186,7 +189,7 @@ class WebsocketApi(BaseWebsocketApi):
186
189
 
187
190
  def _on_message(self, ws, msg: bytes):
188
191
  ws_name = ws.name
189
- msg = orjson.loads(msg)
192
+ msg = json.loads(msg)
190
193
  self.logger.debug(f'ws={ws_name} {msg=}')
191
194
  try:
192
195
  if 'op' in msg:
@@ -1,6 +1,9 @@
1
1
  import os
2
2
  import time
3
- import orjson
3
+ try:
4
+ import orjson as json
5
+ except ImportError:
6
+ import json
4
7
  import logging
5
8
  from abc import ABC, abstractmethod
6
9
  from contextlib import suppress
@@ -344,7 +347,7 @@ class BaseWebsocketApi(ABC):
344
347
  def _send(self, ws, msg):
345
348
  try:
346
349
  with suppress(WebSocketConnectionClosedException):
347
- ws.send(orjson.dumps(msg))
350
+ ws.send(json.dumps(msg))
348
351
  except:
349
352
  self.logger.exception(f'ws={ws.name} exception:')
350
353
 
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from dataclasses import dataclass
2
4
 
3
5
  from typing import TYPE_CHECKING
@@ -2,7 +2,10 @@ import time
2
2
  from collections import defaultdict
3
3
  from multiprocessing import Process, Value
4
4
 
5
- import psutil
5
+ try:
6
+ import psutil
7
+ except ImportError:
8
+ pass
6
9
 
7
10
  from pfund.managers.base_manager import BaseManager
8
11
 
@@ -16,7 +19,7 @@ def _start_process(api, stop_flag: Value):
16
19
  if hasattr(current_process, 'cpu_affinity') and assigned_cpus:
17
20
  current_process.cpu_affinity(assigned_cpus)
18
21
  else:
19
- api.logger.debug(f'cpu affinity is not supported')
22
+ api.logger.debug('cpu affinity is not supported')
20
23
 
21
24
  api.start_zmqs()
22
25
  api.connect()
@@ -2,7 +2,10 @@ import time
2
2
  from collections import defaultdict
3
3
  from multiprocessing import Process, Value
4
4
 
5
- import psutil
5
+ try:
6
+ import psutil
7
+ except ImportError:
8
+ pass
6
9
 
7
10
  from pfund.strategies.strategy_base import BaseStrategy
8
11
  from pfund.utils.utils import get_engine_class
@@ -5,8 +5,8 @@ from typing import TYPE_CHECKING
5
5
  if TYPE_CHECKING:
6
6
  from pfund.models.model_base import MachineLearningModel
7
7
  from pfund.datas.data_base import BaseData
8
-
9
- from pfund.types.core import tModel
8
+ from pfund.types.core import tModel
9
+
10
10
  from pfund.models.model_base import BaseFeature
11
11
  from pfund.strategies.strategy_base import BaseStrategy
12
12
  from pfund.mixins.backtest import BacktestMixin
@@ -1,4 +1,9 @@
1
- from pfund.types.core import tStrategy
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+ if TYPE_CHECKING:
5
+ from pfund.types.core import tStrategy
6
+
2
7
  from pfund.const.commons import SUPPORTED_CRYPTO_EXCHANGES
3
8
  from pfund.mixins.backtest import BacktestMixin
4
9
 
@@ -2,7 +2,10 @@ import time
2
2
 
3
3
  from typing import Any
4
4
 
5
- import zmq
5
+ try:
6
+ import zmq
7
+ except ImportError:
8
+ pass
6
9
 
7
10
 
8
11
  class ZeroMQ:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pfund"
3
- version = "0.0.1.dev8"
3
+ version = "0.0.1.dev10"
4
4
  description = "A Complete Algo-Trading Framework for Machine Learning, enabling trading across TradFi, CeFi and DeFi. Supports Vectorized and Event-Driven Backtesting, Paper and Live Trading"
5
5
  license = "Apache-2.0"
6
6
  authors = ["Stephen Yau <softwareentrepreneer+pfund@gmail.com>"]
@@ -14,6 +14,7 @@ keywords = ["trading", "algo-trading", "stocks", "cryptos", "cryptocurrencies",
14
14
  python = ">=3.10 <3.13"
15
15
  python-dotenv = "^1.0.1"
16
16
  pyyaml = "^6.0.1"
17
+ tqdm = "^4.66.2"
17
18
  rich = "^13.7.0"
18
19
  click = "^8.1.7"
19
20
  schedule = "^1.2.1"
@@ -22,8 +23,7 @@ requests = "^2.31.0"
22
23
  websocket-client = "^1.7.0"
23
24
  python-telegram-bot = "^20.7"
24
25
  gitpython = "^3.1.43"
25
- pfeed = { version = "^0.0.1.dev8", optional = true, extras=["df", "boost"] }
26
- psutil = { version = "^5.9.8", optional = true }
26
+ pfeed = { version = "^0.0.1.dev10", optional = true, extras = ["df", "data", "boost"] }
27
27
  orjson = { version = "^3.9.14", optional = true }
28
28
  pyzmq = { version = "^25.1.2", optional = true }
29
29
  ta = { version = "^0.11.0", optional = true }
@@ -32,7 +32,7 @@ torch = { version = "^2.1.2", optional = true }
32
32
  mlflow = { version = "^2.11.3", optional = true }
33
33
 
34
34
  [tool.poetry.extras]
35
- data = ["pfeed", "psutil", "orjson", "pyzmq"]
35
+ data = ["pfeed", "orjson", "pyzmq"]
36
36
  ml = ["ta", "scikit-learn", "torch", "mlflow"]
37
37
 
38
38
  [tool.poetry.scripts]
@@ -1,11 +0,0 @@
1
- ## Build Documentation using [jupyterbook](https://jupyterbook.org/)
2
- ```bash
3
- # at the root directory, run:
4
- jb build docs/ [--all]
5
- ```
6
-
7
- ## Update submodules
8
- ```bash
9
- # run this to see if the version a submodule is using has been changed.
10
- git submodule update
11
- ```
File without changes
File without changes
File without changes
File without changes