diff --git a/stockstats.py b/stockstats.py index 3c66b8e..9db3afe 100644 --- a/stockstats.py +++ b/stockstats.py @@ -586,12 +586,12 @@ def _get_supertrend(self, window=None): # calculate supertrend if last_st == last_ub: - if curr_close <= ub[i]: + if curr_close <= last_ub: st[i] = ub[i] else: st[i] = lb[i] elif last_st == last_lb: - if curr_close > lb[i]: + if curr_close > last_lb: st[i] = lb[i] else: st[i] = ub[i]