1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-02 02:21:18 +08:00

support empty order

This commit is contained in:
Dong Zhou
2021-10-15 09:07:03 +00:00
parent 2e49a5f7c0
commit df9745f134

View File

@@ -80,6 +80,9 @@ class OrderGenWInteract(OrderGenerator):
:rtype: list
"""
if target_weight_position is None:
return []
# calculate current_tradable_value
current_amount_dict = current.get_stock_amount_dict()
@@ -164,6 +167,9 @@ class OrderGenWOInteract(OrderGenerator):
: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()