pfund 0.0.1.dev9__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.
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/PKG-INFO +2 -2
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/engines/backtest_engine.py +5 -3
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/engines/base_engine.py +5 -3
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/engines/trade_engine.py +4 -2
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/engines/train_engine.py +4 -2
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/investment_profile.py +2 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/models/model_backtest.py +2 -2
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/strategies/strategy_backtest.py +6 -1
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pyproject.toml +2 -2
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/LICENSE +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/README.md +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/CONTRIBUTING.md +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/accounts/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/accounts/account_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/accounts/account_crypto.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/accounts/account_ib.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/adapter.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/analyzer.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/balances/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/balances/balance_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/balances/balance_crypto.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/balances/balance_ib.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/brokers/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/brokers/broker_backtest.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/brokers/broker_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/brokers/broker_crypto.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/brokers/broker_live.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/brokers/ib/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/brokers/ib/broker_ib.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/brokers/ib/ib_api.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/brokers/ib/ib_client.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/brokers/ib/ib_wrapper.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/cli/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/cli/commands/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/cli/commands/config.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/cli/commands/docker_compose.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/cli/main.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/config.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/lot_sizes_inverse.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/lot_sizes_linear.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/lot_sizes_option.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/lot_sizes_spot.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/pdt_matchings_inverse.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/pdt_matchings_linear.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/pdt_matchings_option.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/pdt_matchings_spot.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/tick_sizes_inverse.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/tick_sizes_linear.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/tick_sizes_option.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/bybit/tick_sizes_spot.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/configuration.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/ib/config.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config/logging.yml +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/config_handler.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/const/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/const/_zmq_routes.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/const/commons.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/const/paths.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/data_tools/data_tool_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/data_tools/data_tool_pandas.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/datas/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/datas/data_bar.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/datas/data_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/datas/data_quote.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/datas/data_tick.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/datas/data_time_based.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/datas/resolution.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/datas/timeframe.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/engines/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/engines/test_engine.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/errors.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/exchange.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_result_inverse +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_result_linear +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_result_option +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_result_spot +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_return_inverse +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_return_linear +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_return_option +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/rest_api_samples/get_markets_return_spot +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/types.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/bybit/ws_api.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/exchange_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/rest_api_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/exchanges/ws_api_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/account_summary_tags.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/client.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/comm.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/commission_report.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/common.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/connection.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/contract.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/decoder.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/enum_implem.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/errors.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/execution.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/ibapi.pyproj +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/message.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/news.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/object_implem.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/order.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/order_condition.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/order_state.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/orderdecoder.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/reader.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/scanner.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/server_versions.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/softdollartier.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/tag_value.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/ticktype.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/utils.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/externals/ibapi/wrapper.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/indicators/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/indicators/indicator_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/indicators/ta_indicator.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/indicators/talib_indicator.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/main.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/managers/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/managers/base_manager.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/managers/connection_manager.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/managers/data_manager.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/managers/order_manager.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/managers/portfolio_manager.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/managers/risk_manager.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/managers/strategy_manager.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/mixins/backtest.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/models/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/models/model_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/models/model_meta.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/models/pytorch_model.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/models/sklearn_model.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/orders/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/orders/order_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/orders/order_crypto.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/orders/order_ib.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/orders/order_statuses.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/orders/order_time_in_force.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/plogging/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/plogging/config.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/plogging/filters.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/plogging/formatter.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/plogging/handlers.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/portfolio.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/positions/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/positions/position_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/positions/position_crypto.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/positions/position_ib.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/products/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/products/product_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/products/product_crypto.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/products/product_ib.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/risk_monitor.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/strategies/__init__.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/strategies/allocation_strategy.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/strategies/diversification_strategy.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/strategies/hedging_strategy.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/strategies/optimization_strategy.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/strategies/portfolio_strategy.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/strategies/rebalancing_strategy.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/strategies/strategy_base.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/strategies/strategy_meta.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/types/backtest.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/types/common_literals.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/types/core.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/universe.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/utils/aliases.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/utils/envs.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/utils/utils.py +0 -0
- {pfund-0.0.1.dev9 → pfund-0.0.1.dev10}/pfund/zeromq.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pfund
|
|
3
|
-
Version: 0.0.1.
|
|
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,7 +19,7 @@ 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,data,df] (>=0.0.1.
|
|
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
24
|
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
25
25
|
Requires-Dist: python-telegram-bot (>=20.7,<21.0)
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
|
@@ -28,13 +30,13 @@ from pfund.config_handler import ConfigHandler
|
|
|
28
30
|
class TradeEngine(BaseEngine):
|
|
29
31
|
zmq_ports = {}
|
|
30
32
|
|
|
31
|
-
def __new__(cls, *, env: str='PAPER', data_tool:
|
|
33
|
+
def __new__(cls, *, env: str='PAPER', data_tool: tSUPPORTED_DATA_TOOLS='pandas', zmq_port=5557, config: ConfigHandler | None=None, **settings):
|
|
32
34
|
if not hasattr(cls, 'zmq_port'):
|
|
33
35
|
assert isinstance(zmq_port, int), f'{zmq_port=} must be an integer'
|
|
34
36
|
cls._zmq_port = zmq_port
|
|
35
37
|
return super().__new__(cls, env, data_tool=data_tool, config=config, **settings)
|
|
36
38
|
|
|
37
|
-
def __init__(self, *, env: str='PAPER', data_tool:
|
|
39
|
+
def __init__(self, *, env: str='PAPER', data_tool: tSUPPORTED_DATA_TOOLS='pandas', zmq_port=5557, config: ConfigHandler | None=None, **settings):
|
|
38
40
|
super().__init__(env, data_tool=data_tool)
|
|
39
41
|
# avoid re-initialization to implement singleton class correctly
|
|
40
42
|
if not hasattr(self, '_initialized'):
|
|
@@ -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:
|
|
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:
|
|
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'):
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pfund"
|
|
3
|
-
version = "0.0.1.
|
|
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>"]
|
|
@@ -23,7 +23,7 @@ requests = "^2.31.0"
|
|
|
23
23
|
websocket-client = "^1.7.0"
|
|
24
24
|
python-telegram-bot = "^20.7"
|
|
25
25
|
gitpython = "^3.1.43"
|
|
26
|
-
pfeed = { version = "^0.0.1.
|
|
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 }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|