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

Pass basic tests

This commit is contained in:
Young
2021-08-31 08:44:56 +00:00
committed by you-n-g
parent d39c8de800
commit 9a74471ab6
5 changed files with 141 additions and 58 deletions

View File

@@ -395,8 +395,9 @@ class Indicator:
# NOTE: there are some zeros in the trading price. These cases are known meaningless
# for aligning the previous logic, remove it.
# remove zero and negative values.
price_s = price_s[~(price_s < 1e-08)]
price_s = price_s.loc[(price_s > 1e-08).data.astype(np.bool)]
# NOTE ~(price_s < 1e-08) is different from price_s >= 1e-8
# ~(np.NaN < 1e-8) -> ~(False) -> True
if agg == "vwap":
volume_s = trade_exchange.get_volume(inst, trade_start_time, trade_end_time, method=None)