This is my program-
#n= no. of days def ATR(df , n): df[\'H-L\'] = abs(df[\'High\'] - df[\'Low\']) df[\'H-PC\'] = abs(df[\'High\'] - df[\'Close\'].shift(1