SuperTrend code using pandas python
问题 I am trying to code the following algorithm for SuperTrend indicator in python using pandas. BASIC UPPERBAND = (HIGH + LOW) / 2 + Multiplier * ATR BASIC LOWERBAND = (HIGH + LOW) / 2 - Multiplier * ATR FINAL UPPERBAND = IF( (Current BASICUPPERBAND < Previous FINAL UPPERBAND) or (Previous Close > Previous FINAL UPPERBAND)) THEN (Current BASIC UPPERBAND) ELSE Previous FINALUPPERBAND) FINAL LOWERBAND = IF( (Current BASIC LOWERBAND > Previous FINAL LOWERBAND) or (Previous Close < Previous FINAL