Skip to content

Commit

Permalink
Merge branch 'backtest_improve' of github.com:microsoft/qlib into bac…
Browse files Browse the repository at this point in the history
…ktest_improve
  • Loading branch information
you-n-g committed Oct 15, 2021
2 parents ac08468 + df9745f commit 8183a62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion qlib/backtest/signal.py
Expand Up @@ -62,7 +62,6 @@ def get_signal(self, start_time, end_time) -> Union[pd.Series, pd.DataFrame]:


class ModelSignal(SignalWCache):
...

def __init__(self, model: BaseModel, dataset: Dataset):
self.model = model
Expand Down
6 changes: 6 additions & 0 deletions qlib/contrib/strategy/order_generator.py
Expand Up @@ -80,6 +80,9 @@ def generate_order_list_from_target_weight_position(
:rtype: list
"""
if target_weight_position is None:
return []

# calculate current_tradable_value
current_amount_dict = current.get_stock_amount_dict()

Expand Down Expand Up @@ -164,6 +167,9 @@ def generate_order_list_from_target_weight_position(
:rtype: list of generated orders
"""
if target_weight_position is None:
return []

risk_total_value = risk_degree * current.calculate_value()

current_stock = current.get_stock_list()
Expand Down

0 comments on commit 8183a62

Please sign in to comment.