Hi everyone,
I'm learning my way around the data, and I've got something I'm confused/puzzled by. I've attached a notebook with the latest MSFT pricing from Thursday-Friday. The ADX values I see in both Schwab and TradingView are 31.38, for 14 periods, with 1 minute data. The notebook is close enough (32.52), though that's still off
However, with the same data, running Python locally with ta-lib, I'm getting a vastly different answer. This is the same data loaded from a CSV file into a pandas dataframe
open high low close volume
2020-04-17 19:51:00 177.550 178.590 177.54 178.480 2416612.0
2020-04-17 19:52:00 178.480 178.700 178.30 178.340 867279.0
2020-04-17 19:53:00 178.370 178.420 178.12 178.190 892965.0
2020-04-17 19:54:00 178.180 178.320 178.16 178.265 817863.0
2020-04-17 19:55:00 178.255 178.750 178.24 178.385 1767261.0
2020-04-17 19:56:00 178.380 178.449 177.82 177.840 1405437.0
2020-04-17 19:57:00 177.840 178.080 177.80 177.990 914709.0
2020-04-17 19:58:00 177.995 178.030 177.80 177.900 808404.0
2020-04-17 19:59:00 177.910 178.390 177.89 178.310 1586913.0
2020-04-17 20:00:00 178.310 178.740 178.07 178.600 2828277.0
Which returns a value of 36.46. A pretty large difference. I got some help with the above notebook for resampling the data to a 5 minute interval, which returns a value of 21.42 (very close to the "actual" value of 21.26) in the notebook, however, locally, I get a value of 26.08... and the values are even more off when starting to resample, varying from +/-20%-50%.
For 14 periods, what's the rule of thumb for the amount of backdata needed? The only difference I can see in the notebook is that I have 780 lines of data (corresponding to about 2 days of minute-level data), in the notebook there is 2340 lines... not sure of why there's such a difference.
Then finally in the last part of the notebook, I'm not sure why I'm seeing nan when resampling to 30 minutes.
I'm sure it's a problem on my part of understanding, or if there's a library version difference somewhere, though I'm getting roughly the same results with the ta library. I'm seeing the same problems with trying to calculate a macd or slow stochastic... it must be something silly.
Thanks for your help!