1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-03 19:10:58 +08:00

add back trade_val

This commit is contained in:
Dong Zhou
2021-10-22 10:13:15 +00:00
parent 7313b4dad0
commit 3d7ebd1fe0

View File

@@ -782,6 +782,7 @@ class Exchange:
else:
raise NotImplementedError("order type {} error".format(order.type))
trade_val = order.deal_amount * trade_price
trade_cost = max(trade_val * cost_ratio, self.min_cost)
if trade_val <= 1e-5:
# if dealing is not successful, the trade_cost should be zero.