[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-finance
Subject:    Re: [R-SIG-Finance] Quantmod problem: calling Charts from function
From:       Jeff Ryan <jeff.a.ryan () gmail ! com>
Date:       2010-11-18 18:12:27
Message-ID: 432F68EA-4C14-4DDC-80DC-71C5EA073ED3 () gmail ! com
[Download RAW message or body]

This has been addressed quite a few times on the list and in the docs. 

Given the desire for interactive additions of TA etc, the object is plotted \
automatically via plot via print. 

Simply wrap you TA calls with plot and that should do the trick. 

Alternately you can add the args as a character string to the TA param of \
chartSeries. 

The newest quantmod on CRAN has a new function for plotting called chart_Series which \
may be of interest to try out. It will be to chartSeries what ggplot2 is to ggplot. \
i.e. a new and improved version, albeit sans the addition of the numbering confusion. \
It will eventually migrate to chartSeries proper. 

Best,
Jeff





On Nov 18, 2010, at 11:54 AM, "Daniel Probst" <daniel.probst@web.de> wrote:

> Hello,
> 
> I get different behaviour calling candleChart directly versus calling it in a \
> function: only one of multiple technical analyses is plotted. 
> Example:
> #####################################
> library(quantmod)
> getSymbols("AAPL",src="yahoo") 
> # WORKS
> candleChart(AAPL,multi.col=TRUE,theme="white")
> addBBands()
> addMACD()
> addMACD()
> # Doesn't work
> test<- function(x) {
> candleChart(x,multi.col=TRUE,theme="white")
> addBBands()
> addMACD()
> addMACD()
> }
> test(AAPL)
> # only shows first MACD not 2nd unlike in direct call
> ###########################
> 
> Any pointers where the different behaviour comes from?
> Many thanks
> Daniel Probst
> ___________________________________________________________
> Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
> Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02
> 
> _______________________________________________
> R-SIG-Finance@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.
> -- Also note that this is not the r-help list where general R questions should go.

_______________________________________________
R-SIG-Finance@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.
-- Also note that this is not the r-help list where general R questions should go.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic