[R-SIG-Finance] chartSeries() and addTA() from within an S4 method

Jeff Ryan jeff.a.ryan at gmail.com
Fri Dec 12 19:17:24 CET 2008


Hi Lorenzo,

add*** functions need to work 'magically' from the command line _and_
from within the chartSeries (or calls in general), so there is a check
of where it is called from to determine _when_ it does the drawing.

Simply change addTA(mktPositions) plot(addTA(mktPositions)), to cause
the TA to be draw.

HTH
Jeff

On Fri, Dec 12, 2008 at 12:07 PM, Lorenzo Bertolini
<sig.lorenzo.bertolini at googlemail.com> wrote:
> Hello list,
>
> wonder if anyone can help me out. I want to call chartSeries() and
> subsequently addTA() from within an S4 method.
> The chartSeries() works, but the addTA() does not....
>
> setMethod("plot", "TradingSystem_FX", function(x){
> ..
> ..
>                    # plot fx timeseries
>                    x11()
>                    fxSeries = as.quantmod.OHLC(seriesFX,col.names="Close")
>
> chartSeries(fxSeries,theme="white",TA="addEMA(200,col=4)",name=seriesName)
>
>                    #plot marketposition
>                    addTA(mktPositions)
>
> ..
>
>                    })
>
> Thanks and have a nice WE,
>
> Lorenzo Bertolini
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



-- 
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com



More information about the R-SIG-Finance mailing list