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