Skip to content
Prev 11101 / 15274 Next

Customized indicator for quantstrat

Me
On Fri, 14 Dec 2012 23:56:08 -0500
"Robert A'gata" <rhelpacc at gmail.com> wrote:

            
Robert

I think I have encountered this problem before. For some reason, you
have to make sure that the 'devCalc' function that calculates your
indicator returns an xts object *with the correct column names*. In your
case, I think you should do something like this.

devCalc(...){
  ...
  colnames(res) <- 'dev'
  return(res)
}


For some reason, the label="dev" argument in the declaration below is
not enough.


stratVwap <- add.indicator(strategy=stratVwap,name="devCalc",
				arguments=list(price=quote(mktdata$price),
				vwap=quote(mktdata$vwap)),
				label="dev");


Cheers


------------------------------------------------------------------
Soren Wilkening

http://censix.com