I cannot figure out why this adx() function return inf only in my 5 minute timeframe, and only for this 1 stock: Agilent Technologies. If I use any other timeframes, I won't get the inf to show up, if I change to a different symbol and run it on the 5 minute timeframe, I won't get the inf to show up. It only happens at this particular stock and at the 5 minute time frame. Why ???
It is because HLC are equal for certain period within array (as you can see in your output).
ADX uses true range in its caclulations. So it becomes zero at those array indexes. Then TR (sum) is used as denominator. So it becomes division by zero.
Thank you kindly fxshrat. I tried running the same ticker in a different period range, with HLC not equal and I still get the inf values. btw, if I plot the ADX(14) instead as a plot in the 5 minute chart, I won't get any inf error message at all, I got a beautiful graph.
As I said, it only happen at this particular stock, A, and at the 5 minute timeframe.