当我使用 ADX 功能时,我没有得到正确的答案。例如,2017 年 10 月 4 日的 ADX(14) 值为 12.87。下面的代码给了我 9.53。任何想法为什么这是关闭的?
require(quantmod)
tickers<-c('SPY')
getSymbols(tickers, from="2017-08-24")
ADX(HLC(SPY))
DIp DIn DX ADX
2017-08-24 NA NA NA NA
...
2017-09-14 21.60949 13.54557 22.9381443 NA
2017-09-15 20.47286 20.68483 0.5150181 NA
2017-09-18 22.77659 19.99196 6.5109140 NA
2017-09-19 22.36879 19.63402 6.5109140 NA
2017-09-20 21.26106 21.31324 0.1225536 NA
2017-09-21 20.51171 20.56204 0.1225536 NA
2017-09-22 19.97997 20.75146 1.8940939 NA
2017-09-25 18.72051 23.47425 11.2661824 NA
2017-09-26 18.64682 22.54754 9.4690476 NA
2017-09-27 20.81017 20.92800 0.2822906 NA
2017-09-28 20.03528 20.14872 0.2822906 NA
2017-09-29 23.03483 19.02773 9.5265361 NA
2017-10-02 26.60939 18.03780 19.1984916 NA
2017-10-03 28.57002 17.44596 24.1743580 8.058099
2017-10-04 30.09667 16.66099 28.7347243 9.535001