Error in atr value

I followed the code in 'ATR scalping' in Day Trading Strategies for Beginners and tried to calculate the atr plus atr rolling mean every minute.  But all the atr values calculated in previous minutes would change upon every new calculation.  For example, the code was run at 0115 and the atr for 0114 was 1.52, the code run again at 0116 (one minute later) and the atr for 0114 would change to 1.61.  This makes the rolling mean of the atr keep changing and affect the trading signal.



Thanks for your help

Hi,



This difference in value might be due to a change in raw values used for the calculation of ATR. Can you please check that the OHLCV values are the same for a particular minute on every iteration? Please do let us know if they are consistent and we can debug it further.



Hope this helps!



Thanks,

Akshay