1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-02 10:31:00 +08:00

Merge branch 'nested_decision_exe' of https://github.com/microsoft/qlib into rl-dummy

This commit is contained in:
v-mingzhehan
2021-07-18 03:55:39 +00:00
2 changed files with 5 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
from abc import abstractclassmethod, abstractmethod
import copy
from qlib.log import get_module_logger
from types import GeneratorType
from qlib.backtest.account import Account
import warnings
@@ -104,6 +105,8 @@ class BaseExecutor:
self.level_infra = LevelInfrastructure()
self.level_infra.reset_infra(common_infra=common_infra)
self.reset(start_time=start_time, end_time=end_time, common_infra=common_infra)
if common_infra is None:
get_module_logger("BaseExecutor").warning(f"`common_infra` is not set for {self}")
def reset_common_infra(self, common_infra):
"""

View File

@@ -515,9 +515,9 @@ class TradeDecisionWO(BaseTradeDecision):
self.order_list = order_list
start, end = strategy.trade_calendar.get_step_time()
for o in order_list:
if o.start_time:
if o.start_time is None:
o.start_time = start
if o.end_time:
if o.end_time is None:
o.end_time = end
def get_decision(self) -> List[object]: