mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-14 00:06:58 +08:00
Merge branch 'nested_decision_exe' of https://github.com/microsoft/qlib into rl-dummy
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from abc import abstractclassmethod, abstractmethod
|
from abc import abstractclassmethod, abstractmethod
|
||||||
import copy
|
import copy
|
||||||
|
from qlib.log import get_module_logger
|
||||||
from types import GeneratorType
|
from types import GeneratorType
|
||||||
from qlib.backtest.account import Account
|
from qlib.backtest.account import Account
|
||||||
import warnings
|
import warnings
|
||||||
@@ -104,6 +105,8 @@ class BaseExecutor:
|
|||||||
self.level_infra = LevelInfrastructure()
|
self.level_infra = LevelInfrastructure()
|
||||||
self.level_infra.reset_infra(common_infra=common_infra)
|
self.level_infra.reset_infra(common_infra=common_infra)
|
||||||
self.reset(start_time=start_time, end_time=end_time, 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):
|
def reset_common_infra(self, common_infra):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -515,9 +515,9 @@ class TradeDecisionWO(BaseTradeDecision):
|
|||||||
self.order_list = order_list
|
self.order_list = order_list
|
||||||
start, end = strategy.trade_calendar.get_step_time()
|
start, end = strategy.trade_calendar.get_step_time()
|
||||||
for o in order_list:
|
for o in order_list:
|
||||||
if o.start_time:
|
if o.start_time is None:
|
||||||
o.start_time = start
|
o.start_time = start
|
||||||
if o.end_time:
|
if o.end_time is None:
|
||||||
o.end_time = end
|
o.end_time = end
|
||||||
|
|
||||||
def get_decision(self) -> List[object]:
|
def get_decision(self) -> List[object]:
|
||||||
|
|||||||
Reference in New Issue
Block a user