1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-02 02:21:18 +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-09 09:32:15 +00:00
3 changed files with 7 additions and 7 deletions

View File

@@ -348,13 +348,6 @@ class NestedExecutor(BaseExecutor):
self.inner_strategy.alter_outer_trade_decision(trade_decision)
return trade_decision
# def _get_inner_trade_decision(self, outer_trade_decision: BaseTradeDecision, inner_execute_result):
# # In some cases, the inner strategy can be skipped, but the inner executor should keep running
# if outer_trade_decision.empty() and self._skip_empty_decision:
# return EmptyTradeDecision(self.inner_strategy)
# return self.inner_strategy.generate_trade_decision(inner_execute_result)
# _inner_trade_decision = self._get_inner_trade_decision(trade_decision, _inner_execute_result)
def _collect_data(self, trade_decision: BaseTradeDecision, level: int = 0):
execute_result = []
inner_order_indicators = []

View File

@@ -15,6 +15,7 @@ from qlib.backtest.utils import TradeCalendarManager
import warnings
import numpy as np
import pandas as pd
import numpy as np
from dataclasses import dataclass, field
from typing import ClassVar, Optional, Union, List, Set, Tuple

View File

@@ -164,6 +164,12 @@ class LevelInfrastructure(BaseInfrastructure):
"""level instrastructure is created by executor, and then shared to strategies on the same level"""
def get_support_infra(self):
"""
Descriptions about the infrastructure
sub_level_infra:
- **NOTE**: this will only work after _init_sub_trading !!!
"""
return ["trade_calendar", "sub_level_infra"]
def reset_cal(self, freq, start_time, end_time):