您好,我想在此烛台图表上添加简单移动平均线(使用 highchart,而不是图表系列),但我一直失败。如何将此 SMA 添加到我的图表中?有什么帮助吗? add_SMA(n = 200,on = 1,col =“红色”),add_SMA(n = 50,on = 1,col =“黑色”)
`开始<- format(as.Date("2015-01-01"), "%Y-%m-%d") end <- format(as.Date("2024-10-03"), "%Y-%m-%d")
股票代码<- "PFE"
价格<- getSymbols(ticker, auto.assign = FALSE, from = start, to = end)
头(价格)
highchart(type = "股票") %>% hc_add_series(价格) %>% hc_title(text = "价格烛台图 2015-2024")`