Skip to content

Commit

Permalink
fix: rsi计算除零 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Vespa314 committed Sep 18, 2023
1 parent 1821305 commit c141d82
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Bi/Bi.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,10 @@ def cal_macd_metric(self, macd_algo, is_reverse):

@make_cache
def Cal_Rsi(self):
rsi_lst = []
rsi_lst: List[float] = []
for klc in self.klc_lst:
for klu in klc.lst:
rsi_lst.append(klu.rsi)
return 10000.0/min(rsi_lst) if self.is_down() else max(rsi_lst)
rsi_lst.extend(klu.rsi for klu in klc.lst)
return 10000.0/(min(rsi_lst)+1e-7) if self.is_down() else max(rsi_lst)

@make_cache
def Cal_MACD_area(self):
Expand Down

0 comments on commit c141d82

Please sign in to comment.