简体   繁体   English

RQuantmod ChartSeries:向单个图表添加多个TA覆盖

[英]R quantmod chartSeries: Add multiple TA overlay to single chart

I'm trying to add multiple TA's to my main chartSeries chart, and they all add below instead of overlaying each other. 我试图将多个TA添加到我的主要chartSeries图表中,并且它们都添加在下面而不是彼此重叠。 Is it possible to add multiple TA overlays? 是否可以添加多个TA覆盖?

chartSeries(GE, theme="white",
TA="addTA(GE1);addTA(GE2);addTA(GE3)") 

I've tried with the variables below; 我试过下面的变量;

on=1 and overlay=TRUE on = 1和overlay = TRUE

I'm looking for all the TA's to be in a single chart. 我正在寻找所有助教都在一张图表中。

Thank you in advance for your time. 预先感谢您的宝贵时间。

Well, on=1 is what you need. 好吧,您需要on=1 I'm having trouble getting the TA="" to work, with the data I had to hand, but this did work: 我无法使用必须处理的数据来使TA =“”正常工作,但这确实有效:

chartSeries(x,TA=NULL);addTA(EMA(x$Close),on=1)

(The TA=NULL is to remove the volume chart.) TA=NULL将删除体积图。)

Or, use newTA to define your TA with all the desired parameters in advance, and then the TA argument does accept it: 或者,使用newTA定义所有所需参数的TA ,然后TA参数接受它:

myEMA = newTA(EMA, Cl, on=1, col=7)
chartSeries(x, TA="myEMA()")

(See ?newTA , which is where I stole that first line from!) (请参阅?newTA ,这是我从那里偷走第一行的地方!)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM