investing-algorithm-framework 3.5.0__tar.gz → 3.5.2__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.5.0 → investing_algorithm_framework-3.5.2}/PKG-INFO +1 -1
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/app.py +8 -7
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/strategy.py +4 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/market_data_sources/ccxt.py +9 -2
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/backtesting/backtest_service.py +1 -1
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/market_data_source_service/backtest_market_data_source_service.py +6 -1
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/market_data_source_service/market_data_source_service.py +16 -5
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/order_service/order_backtest_service.py +8 -4
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/pyproject.toml +1 -1
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/LICENSE +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/README.md +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/algorithm.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/task.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/controllers/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/controllers/orders.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/controllers/positions.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/create_app.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/error_handler.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/responses.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/schemas/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/schemas/order.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/app/web/setup_cors.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/create_app.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/dependency_container.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/config.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/constants.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/data_structures.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/exceptions.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/app_mode.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/backtesting/backtest_position.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/backtesting/backtest_report.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/backtesting/backtest_reports_evaluation.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/base_model.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/market/market_credential.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/order/order.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/order/order_fee.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/order/order_side.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/order/order_status.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/order/order_type.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/position/position.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/strategy_profile.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/time_frame.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/trade/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/trade/trade.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/trade/trade_status.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/trading_data_types.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/models/trading_time_frame.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/services/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/services/market_data_sources.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/services/market_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/services/rounding_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/singleton.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/strategy.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/utils/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/utils/backtesting.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/utils/csv.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/utils/random.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/market_data_sources/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/market_data_sources/csv.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/order/order.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/order/order_fee.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/position/position.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/repositories/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/repositories/order_fee_repository.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/repositories/repository.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/services/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/services/market_service/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/services/market_service/ccxt_market_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/services/performance_service/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/services/performance_service/backtest_performance_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/infrastructure/services/performance_service/performance_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/backtesting/backtest_report_writer_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/configuration_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/market_data_source_service/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/order_service/order_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/portfolios/backtest_portfolio_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/portfolios/portfolio_configuration_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/portfolios/portfolio_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/portfolios/portfolio_snapshot_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/position_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/position_snapshot_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/repository_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/strategy_orchestrator_service.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/trade_service/__init__.py +0 -0
- {investing_algorithm_framework-3.5.0 → investing_algorithm_framework-3.5.2}/investing_algorithm_framework/services/trade_service/trade_service.py +0 -0
|
@@ -239,8 +239,8 @@ class App:
|
|
|
239
239
|
self,
|
|
240
240
|
backtest_start_date,
|
|
241
241
|
backtest_end_date,
|
|
242
|
-
pending_order_check_interval,
|
|
243
242
|
market_data_sources,
|
|
243
|
+
pending_order_check_interval=None,
|
|
244
244
|
) -> None:
|
|
245
245
|
"""
|
|
246
246
|
Initialize the app for backtesting by setting the configuration
|
|
@@ -261,9 +261,11 @@ class App:
|
|
|
261
261
|
configuration_service.config[BACKTESTING_START_DATE] = \
|
|
262
262
|
backtest_start_date
|
|
263
263
|
configuration_service.config[BACKTESTING_END_DATE] = backtest_end_date
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
|
|
265
|
+
if pending_order_check_interval is not None:
|
|
266
|
+
configuration_service.config[
|
|
267
|
+
BACKTESTING_PENDING_ORDER_CHECK_INTERVAL
|
|
268
|
+
] = pending_order_check_interval
|
|
267
269
|
|
|
268
270
|
# Create resource dir if not exits
|
|
269
271
|
self._create_resource_directory_if_not_exists()
|
|
@@ -498,7 +500,6 @@ class App:
|
|
|
498
500
|
while self.algorithm.running:
|
|
499
501
|
if number_of_iterations_since_last_orders_check == 30:
|
|
500
502
|
logger.info("Checking pending orders")
|
|
501
|
-
self.algorithm.check_pending_orders()
|
|
502
503
|
number_of_iterations_since_last_orders_check = 1
|
|
503
504
|
|
|
504
505
|
self.algorithm.run_jobs()
|
|
@@ -675,7 +676,7 @@ class App:
|
|
|
675
676
|
algorithm,
|
|
676
677
|
start_date,
|
|
677
678
|
end_date,
|
|
678
|
-
pending_order_check_interval=
|
|
679
|
+
pending_order_check_interval=None,
|
|
679
680
|
output_directory=None
|
|
680
681
|
) -> BacktestReport:
|
|
681
682
|
"""
|
|
@@ -740,7 +741,7 @@ class App:
|
|
|
740
741
|
start_date: Optional[datetime] = None,
|
|
741
742
|
end_date: Optional[datetime] = None,
|
|
742
743
|
date_ranges: Optional[Tuple[datetime, datetime]] = None,
|
|
743
|
-
pending_order_check_interval=
|
|
744
|
+
pending_order_check_interval=None,
|
|
744
745
|
output_directory=None
|
|
745
746
|
) -> List[BacktestReport]:
|
|
746
747
|
"""
|
|
@@ -60,6 +60,10 @@ class TradingStrategy:
|
|
|
60
60
|
)
|
|
61
61
|
|
|
62
62
|
def run_strategy(self, algorithm, market_data):
|
|
63
|
+
# Check pending orders before running the strategy
|
|
64
|
+
algorithm.check_pending_orders()
|
|
65
|
+
|
|
66
|
+
# Run user defined strategy
|
|
63
67
|
self.apply_strategy(algorithm=algorithm, market_data=market_data)
|
|
64
68
|
|
|
65
69
|
def apply_strategy(self, algorithm, market_data):
|
|
@@ -237,7 +237,7 @@ class CCXTTickerBacktestMarketDataSource(
|
|
|
237
237
|
backtest_data_directory = None
|
|
238
238
|
backtest_data_start_date = None
|
|
239
239
|
backtest_data_end_date = None
|
|
240
|
-
timeframe =
|
|
240
|
+
timeframe = None
|
|
241
241
|
column_names = ["Datetime", "Open", "High", "Low", "Close", "Volume"]
|
|
242
242
|
|
|
243
243
|
def __init__(
|
|
@@ -245,16 +245,23 @@ class CCXTTickerBacktestMarketDataSource(
|
|
|
245
245
|
identifier,
|
|
246
246
|
market,
|
|
247
247
|
symbol=None,
|
|
248
|
-
timeframe=
|
|
248
|
+
timeframe=None,
|
|
249
249
|
):
|
|
250
250
|
super().__init__(
|
|
251
251
|
identifier=identifier,
|
|
252
252
|
market=market,
|
|
253
253
|
symbol=symbol,
|
|
254
254
|
)
|
|
255
|
+
|
|
255
256
|
if timeframe is not None:
|
|
256
257
|
self.timeframe = timeframe
|
|
257
258
|
|
|
259
|
+
if self.timeframe is None:
|
|
260
|
+
raise OperationalException(
|
|
261
|
+
"timeframe should be set for "
|
|
262
|
+
"CCXTTickerBacktestMarketDataSource"
|
|
263
|
+
)
|
|
264
|
+
|
|
258
265
|
def prepare_data(
|
|
259
266
|
self,
|
|
260
267
|
config,
|
|
@@ -150,7 +150,7 @@ class BacktestService:
|
|
|
150
150
|
market_data[data_id] = \
|
|
151
151
|
self._market_data_source_service.get_data(data_id)
|
|
152
152
|
|
|
153
|
-
self._order_service.check_pending_orders()
|
|
153
|
+
# self._order_service.check_pending_orders()
|
|
154
154
|
strategy.run_strategy(algorithm=algorithm, market_data=market_data)
|
|
155
155
|
|
|
156
156
|
def generate_schedule(
|
|
@@ -109,7 +109,12 @@ class BacktestMarketDataSourceService(MarketDataSourceService):
|
|
|
109
109
|
)
|
|
110
110
|
|
|
111
111
|
def get_ohlcv(
|
|
112
|
-
self,
|
|
112
|
+
self,
|
|
113
|
+
symbol,
|
|
114
|
+
from_timestamp,
|
|
115
|
+
time_frame=None,
|
|
116
|
+
market=None,
|
|
117
|
+
to_timestamp=None
|
|
113
118
|
):
|
|
114
119
|
market_data_source = self.get_ohlcv_market_data_source(
|
|
115
120
|
symbol=symbol, market=market, time_frame=time_frame
|
|
@@ -60,8 +60,8 @@ class MarketDataSourceService:
|
|
|
60
60
|
def get_ohlcv(
|
|
61
61
|
self,
|
|
62
62
|
symbol,
|
|
63
|
-
time_frame,
|
|
64
63
|
from_timestamp,
|
|
64
|
+
time_frame,
|
|
65
65
|
market=None,
|
|
66
66
|
to_timestamp=None
|
|
67
67
|
):
|
|
@@ -85,7 +85,6 @@ class MarketDataSourceService:
|
|
|
85
85
|
)
|
|
86
86
|
|
|
87
87
|
def get_data(self, identifier):
|
|
88
|
-
print(self._market_data_sources)
|
|
89
88
|
for market_data_source in self._market_data_sources:
|
|
90
89
|
if market_data_source.get_identifier() == identifier:
|
|
91
90
|
return market_data_source.get_data(
|
|
@@ -110,24 +109,36 @@ class MarketDataSourceService:
|
|
|
110
109
|
|
|
111
110
|
return None
|
|
112
111
|
|
|
113
|
-
def get_ohlcv_market_data_source(
|
|
112
|
+
def get_ohlcv_market_data_source(
|
|
113
|
+
self, symbol, time_frame=None, market=None
|
|
114
|
+
):
|
|
114
115
|
|
|
115
116
|
if self.market_data_sources is not None:
|
|
117
|
+
|
|
116
118
|
for market_data_source in self._market_data_sources:
|
|
117
119
|
if isinstance(market_data_source, OHLCVMarketDataSource):
|
|
118
120
|
|
|
119
|
-
if market is not None:
|
|
121
|
+
if market is not None and time_frame is not None:
|
|
120
122
|
|
|
121
123
|
if market_data_source.market.lower() == market.lower()\
|
|
122
124
|
and market_data_source.symbol.lower() \
|
|
123
125
|
== symbol.lower() and \
|
|
124
126
|
market_data_source.timeframe == time_frame:
|
|
125
127
|
return market_data_source
|
|
126
|
-
|
|
128
|
+
elif market is not None:
|
|
129
|
+
if market_data_source.market.lower() == market.lower()\
|
|
130
|
+
and market_data_source.symbol.lower() \
|
|
131
|
+
== symbol.lower():
|
|
132
|
+
return market_data_source
|
|
133
|
+
elif time_frame is not None:
|
|
127
134
|
if market_data_source.symbol.lower() \
|
|
128
135
|
== symbol.lower() and \
|
|
129
136
|
market_data_source.timeframe == time_frame:
|
|
130
137
|
return market_data_source
|
|
138
|
+
else:
|
|
139
|
+
if market_data_source.symbol.lower() \
|
|
140
|
+
== symbol.lower():
|
|
141
|
+
return market_data_source
|
|
131
142
|
|
|
132
143
|
return None
|
|
133
144
|
|
|
@@ -67,13 +67,18 @@ class OrderBacktestService(OrderService):
|
|
|
67
67
|
f"/{order.trading_symbol.upper()}"
|
|
68
68
|
position = self.position_repository.get(order.position_id)
|
|
69
69
|
portfolio = self.portfolio_repository.get(position.portfolio_id)
|
|
70
|
+
timeframe = None
|
|
71
|
+
|
|
72
|
+
if BACKTESTING_PENDING_ORDER_CHECK_INTERVAL in \
|
|
73
|
+
self.configuration_service.config:
|
|
74
|
+
timeframe = self.configuration_service\
|
|
75
|
+
.config[BACKTESTING_PENDING_ORDER_CHECK_INTERVAL]
|
|
70
76
|
|
|
71
77
|
if not self._market_data_source_service\
|
|
72
78
|
.is_ohlcv_data_source_present(
|
|
73
79
|
symbol=symbol,
|
|
74
80
|
market=portfolio.market,
|
|
75
|
-
time_frame=
|
|
76
|
-
.config[BACKTESTING_PENDING_ORDER_CHECK_INTERVAL]
|
|
81
|
+
time_frame=timeframe
|
|
77
82
|
):
|
|
78
83
|
raise OperationalException(
|
|
79
84
|
f"OHLCV data source not found for {symbol} "
|
|
@@ -90,12 +95,11 @@ class OrderBacktestService(OrderService):
|
|
|
90
95
|
df = self._market_data_source_service.get_ohlcv(
|
|
91
96
|
symbol=symbol,
|
|
92
97
|
market=portfolio.market,
|
|
98
|
+
time_frame=timeframe,
|
|
93
99
|
to_timestamp=self.configuration_service.config.get(
|
|
94
100
|
BACKTESTING_INDEX_DATETIME
|
|
95
101
|
),
|
|
96
102
|
from_timestamp=order.get_created_at(),
|
|
97
|
-
time_frame=self.configuration_service
|
|
98
|
-
.config[BACKTESTING_PENDING_ORDER_CHECK_INTERVAL]
|
|
99
103
|
)
|
|
100
104
|
|
|
101
105
|
if self.has_executed(order, df):
|
|
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
|