mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-14 16:26:55 +08:00
Fix the empty price_s case and self.instruments in SBBStrategyEMA. (#1677)
* Fix the empty price_s case and self.instruments in SBBStrategyEMA. * Update qlib/contrib/strategy/rule_strategy.py * Update qlib/contrib/strategy/rule_strategy.py --------- Co-authored-by: you-n-g <you-n-g@users.noreply.github.com> Co-authored-by: Linlang <Lv.Linlang@hotmail.com>
This commit is contained in:
@@ -326,8 +326,10 @@ class SBBStrategyEMA(SBBStrategyBase):
|
||||
if instruments is None:
|
||||
warnings.warn("`instruments` is not set, will load all stocks")
|
||||
self.instruments = "all"
|
||||
if isinstance(instruments, str):
|
||||
elif isinstance(instruments, str):
|
||||
self.instruments = D.instruments(instruments)
|
||||
elif isinstance(instruments, List):
|
||||
self.instruments = instruments
|
||||
self.freq = freq
|
||||
super(SBBStrategyEMA, self).__init__(
|
||||
outer_trade_decision, level_infra, common_infra, trade_exchange=trade_exchange, **kwargs
|
||||
|
||||
Reference in New Issue
Block a user