source("R/dbInterface.R")
getMeanPrice <- function(Symbol, SymbolName)
{
mePrice <- meanPrice(unlist(strsplit(SymbolName, "[.]"))[1])
if(is.null(mePrice))
return(NULL)
mPrice = xts(rep(mePrice,length(index(Symbol))), index(Symbol))
assign("mPrice", mPrice, .GlobalEnv)
col <- 3
if(as.double(last(Cl(Symbol))) < mePrice)
col <- 2
return(sprintf("addTA(mPrice, lwd=1, on=1, col=%d)", col))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.