mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-14 16:26:55 +08:00
Merge branch 'backtest_improve' of github.com:microsoft/qlib into backtest_improve
This commit is contained in:
@@ -62,8 +62,6 @@ class SignalWCache(Signal):
|
|||||||
|
|
||||||
|
|
||||||
class ModelSignal(SignalWCache):
|
class ModelSignal(SignalWCache):
|
||||||
...
|
|
||||||
|
|
||||||
def __init__(self, model: BaseModel, dataset: Dataset):
|
def __init__(self, model: BaseModel, dataset: Dataset):
|
||||||
self.model = model
|
self.model = model
|
||||||
self.dataset = dataset
|
self.dataset = dataset
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ class OrderGenWInteract(OrderGenerator):
|
|||||||
|
|
||||||
:rtype: list
|
:rtype: list
|
||||||
"""
|
"""
|
||||||
|
if target_weight_position is None:
|
||||||
|
return []
|
||||||
|
|
||||||
# calculate current_tradable_value
|
# calculate current_tradable_value
|
||||||
current_amount_dict = current.get_stock_amount_dict()
|
current_amount_dict = current.get_stock_amount_dict()
|
||||||
|
|
||||||
@@ -164,6 +167,9 @@ class OrderGenWOInteract(OrderGenerator):
|
|||||||
|
|
||||||
:rtype: list of generated orders
|
:rtype: list of generated orders
|
||||||
"""
|
"""
|
||||||
|
if target_weight_position is None:
|
||||||
|
return []
|
||||||
|
|
||||||
risk_total_value = risk_degree * current.calculate_value()
|
risk_total_value = risk_degree * current.calculate_value()
|
||||||
|
|
||||||
current_stock = current.get_stock_list()
|
current_stock = current.get_stock_list()
|
||||||
|
|||||||
Reference in New Issue
Block a user