Skip to content

Commit

Permalink
0.9.60 新增 unify_weights 函数
Browse files Browse the repository at this point in the history
  • Loading branch information
zengbin93 committed Oct 27, 2024
1 parent 87cf5b6 commit dc0c258
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions czsc/signals/tas.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def update_macd_cache(c: CZSC, **kwargs):
dif, dea, macd = MACD(close, fastperiod=fastperiod, slowperiod=slowperiod, signalperiod=signalperiod)
for i in range(len(close)):
_c = dict(c.bars_raw[i].cache) if c.bars_raw[i].cache else dict()
dif_i = dif[i] if dif[i] else close[i]
dea_i = dea[i] if dea[i] else close[i]
macd_i = dif_i - dea_i
dif_i = dif[i] if dif[i] else 0
dea_i = dea[i] if dea[i] else 0
macd_i = macd[i] if macd[i] else 0
_c.update({cache_key: {"dif": dif_i, "dea": dea_i, "macd": macd_i}})
c.bars_raw[i].cache = _c

Expand Down

0 comments on commit dc0c258

Please sign in to comment.