【发布时间】:2021-12-08 15:28:53
【问题描述】:
我想知道如何在其中使用“for 循环”的索引 (i)。尤其是“$-notation”。
for (i in tickers){
getSymbols(i, from = '2021-01-6',
to = "2021-10-21",warnings = FALSE,
auto.assign = TRUE)
MA9 = mean(tail(i$i.Adjusted, n=9))
print(MA9)
}
感谢您抽出宝贵时间阅读本文!
【问题讨论】:
-
看到这个问题并阅读 cmets:stackoverflow.com/questions/69587569/…