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

fix exchange bug

This commit is contained in:
wangwenxi.handsome
2021-08-15 14:17:26 +00:00
committed by you-n-g
parent f67b99a30e
commit 222c2fd21a
2 changed files with 23 additions and 22 deletions

View File

@@ -390,8 +390,8 @@ class Indicator:
return None, None
if isinstance(price_s, (int, float)):
price_s = pd.Series(price_s, index=[trade_start_time])
price_s = pd.Series(price_s, index=[trade_start_time])
# NOTE: there are some zeros in the trading price. These cases are known meaningless
# for aligning the previous logic, remove it.
price_s = price_s[~(price_s < 1e-08)] # remove zero and negative values.