[R-SIG-Finance] Quantmod - chartSeries

Andreas Johansson Andreas.Johansson at mbamfunds.com
Fri Mar 20 16:36:53 CET 2009


Hi,

am using chartSeries to create a set of charts that I output to pdf in a loop. Works fine but have encountered a problem. If I want to loop over a call like

for (i=1:10){
                Data=getSymbols(ID[i])
                chartSeries(Data,TA='addTA(as.Date(index(Data))<as.Date("2009-02-02))',border=NA,col='#888888' )
}

I cannot do it as chartSeires complains that object Data does not exist

does not complain if I do
for (i=1:10){
                Data=getSymbols(ID[i])
                chartSeries(Data)
                addTA(as.Date(index(Data))<as.Date("2009-02-02))',border=NA,col='#888888' )
}

Is there a way of making the call to chart series in one go and referencing to Data in the addTA function?

If I run Data=getSymbols(ID[i]) and  then  chartSeries(Data,TA='addTA(as.Date(index(Data))<as.Date("2009-02-02))',border=NA,col='#888888' ) in the console it works fine.

regards

Andreas

Andreas Johansson
Quantitative Analyst


[cid:image001.jpg at 01C9A970.18997030]
Marble Bar Asset Management LLP
11-12 St James Square
London, SW1Y 4LB
Direct +44 (0) 20 3023 8141
Fax +44 (0) 20 3023 8065
Mobile +44 (0) 7747 725992
Andreas.Johansson at mbamfunds.com


.

This message is intended only for the use of the person(s) to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any unauthorised use is strictly prohibited. If you are not the intended recipient, please contact the sender as soon as possible.

It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any opinions or advice contained in this Internet email are subject to the terms and conditions expressed in any applicable governing Marble Bar Asset Management LLP's  terms and conditions of business or client agreement letter. Any comments or statements made herein do not necessarily reflect those of Marble Bar Asset Management LLP.

Marble Bar Asset Management LLP is regulated and authorised by the FSA.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20090320/667f46df/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 8581 bytes
Desc: image001.jpg
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20090320/667f46df/attachment.jpg>


More information about the R-SIG-Finance mailing list