Dear All,

I have received the messages for quite a while, and I find the volume fairly invasive. The idea is highly commendable, but I need to clear my inbox way too often.

Is there any way to have me removed from automatic reception?

Many thanks,

Patrick



________________________________
 De : Subhrangshu Nandi <nands31@gmail.com>
À : r-sig-finance@r-project.org; Jeff Ryan <jeff.a.ryan@gmail.com> 
Envoyé le : Mercredi 7 mars 2012 20h09
Objet : [R-SIG-Finance] quantmod/addTA/.GlobalEnv question

I know this issue has been raised before but was unable to find the right
solution. When I am trying to do addTA to a chartSeries plot, from inside a
function, it expects the arguments of addTA to be in the .GlobalEnv. Even
after wrapping the chartSeries call inside plot(), it does not work.
Following is a simple code:

*
*
*require(xts)*
*require(quantmod)*
*
*
*getSymbols('YHOO')*
*
*
*## It works fine when charting it in the GlobalEnv*
*#YHOO$MA <- rollmean(YHOO$YHOO.Close, k=50, align='right')*
*#YHOO <- na.omit(YHOO)*
*#chartSeries(YHOO, TA="addTA(YHOO$MA, col='blue', on=1)",
theme=chartTheme('white'))*
*
*
*fn_plotYHOO <- function(Data){*
*  Data$MA <- rollmean(Data$YHOO.Close, k=50, align='right')*
*  Data <- na.omit(Data)*
*  #View(Data)*
*  plot(chartSeries(Data, TA="addTA(Data$MA, col='blue', on=1)",
theme=chartTheme('white')))*
*}*
*
*
*fn_plotYHOO(Data=YHOO)*

*Error in plot(chartSeries(Data, TA = "addTA(Data$MA, col='blue', on=1)",  :
  error in evaluating the argument 'x' in selecting a method for
function 'plot': Error in addTA(Data$MA, col = "blue", on = 1) :
object 'Data' not found*



Could anyone please help me resolve this? I dont want to assign all objects
to the Global environment.
Thanks,
-Nandi

-- 
I'm a great believer in luck, and I find the harder I work the more I have
of it.  ~Thomas Jefferson

Subhrangshu Nandi
Algorithmic Stat-Arb Trader

    [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
	[[alternative HTML version deleted]]

