[R-SIG-Finance] Currency data from GOOGLE/Yahoo finance.

Enrico Schumann enricoschumann at yahoo.de
Thu Sep 22 11:58:48 CEST 2011


hm, the last words were actually "check on finance.yahoo.com ;)" but 
they have been cut away.

Am 22.09.2011 11:50, schrieb Enrico Schumann:
>
> It seems a convention that if the rate is USDCCY, you get it from Yahoo
> with CCY=X. At least I have had this with JPY=X, GBP=X. But I am not
> sure how consistent that is. The simple "trick" is to directly check on
>
>
>
> Am 22.09.2011 11:40, schrieb Ashim Kapoor:
>> Dear Enrico,
>>
>> How / where did you discover that it should be "INR=X" instead of the
>> symbol
>> "USDINR=X"
>>
>> Many thanks,
>> Ashim
>>
>> On Thu, Sep 22, 2011 at 2:46 PM, Enrico
>> Schumann<enricoschumann at yahoo.de>wrote:
>>
>>>
>>> Try this:
>>>
>>> require("quantmod")
>>> INRUSD<- getSymbols("INR=X",src="yahoo"**, auto.assign = FALSE)
>>>
>>>
>>> Regards,
>>> Enrico
>>>
>>> Am 22.09.2011 10:42, schrieb Wolfgang Wu:
>>>
>>> Ashim,
>>>>
>>>> Unfortunately I couldn't get any data from Yahoo or Google either. I
>>>> thought you had to do something like
>>>> getSymbols("CURRENCY:INRUSD",**src="google"),
>>>> but that doesn't work anymore either.
>>>>
>>>> Best solution I can give you is to use the Oanda source for currency
>>>> data.
>>>> They do limit you to 500 days of data but you can easily write a loop
>>>> changing the "from" and "to" times and rbind the xts object together
>>>> afterwards.
>>>>
>>>> INRUSD<- getSymbols('INR/USD', src='oanda', auto.assign = FALSE)
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Wolfgang Wu
>>>>
>>>>
>>>>
>>>>
>>>> ----- Ursprüngliche Message -----
>>>> Von: Ashim Kapoor<ashimkapoor at gmail.com>
>>>> An: r-sig-finance at r-project.org
>>>> Cc:
>>>> Gesendet: 8:32 Donnerstag, 22.September 2011
>>>> Betreff: [R-SIG-Finance] Currency data from GOOGLE/Yahoo finance.
>>>>
>>>> Dear R-helpers,
>>>>
>>>> I am trying to use getSymbols to download INR/USD data from yahoo or
>>>> google
>>>> finance. In each case I 1st list the website and then the R error
>>>> which I
>>>> get on trying to download the symbol. Could someone please tell me
>>>> where I
>>>> am wrong?
>>>>
>>>> http://www.google.com/finance?**q=inrusd<http://www.google.com/finance?q=inrusd>
>>>>
>>>>
>>>> getSymbols("inrusd",src="**google")
>>>>>
>>>> Error in download.file(paste(google.**URL, "q=", Symbols.name,
>>>> "&startdate=",
>>>> :
>>>> cannot open URL '
>>>> http://finance.google.com/**finance/historical?q=inrusd&**
>>>> startdate=Jan+01,+2007&**enddate=Sep+22,+2011&output=**csv<http://finance.google.com/finance/historical?q=inrusd&startdate=Jan+01,+2007&enddate=Sep+22,+2011&output=csv>
>>>>
>>>> '
>>>> In addition: Warning message:
>>>> In download.file(paste(google.**URL, "q=", Symbols.name, "&startdate=",
>>>> :
>>>> cannot open: HTTP status was '400 Bad Request'
>>>>
>>>> http://in.finance.yahoo.com/q?**s=USDINR%3DX&ql=1<http://in.finance.yahoo.com/q?s=USDINR%3DX&ql=1>
>>>>
>>>>
>>>> getSymbols("USDINR=X",src="**yahoo")
>>>>>
>>>> Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=",
>>>> from.m,
>>>> :
>>>> cannot open URL '
>>>> http://chart.yahoo.com/table.**csv?s=USDINR=X&a=0&b=01&c=**
>>>> 2007&d=8&e=22&f=2011&g=d&q=q&**y=0&z=USDINR=X&x=.csv<http://chart.yahoo.com/table.csv?s=USDINR=X&a=0&b=01&c=2007&d=8&e=22&f=2011&g=d&q=q&y=0&z=USDINR=X&x=.csv>
>>>>
>>>> '
>>>> In addition: Warning message:
>>>> In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, :
>>>> unable to resolve 'chart.yahoo.com'
>>>>
>>>> Best Regards,
>>>> Ashim
>>>>
>>>> [[alternative HTML version deleted]]
>>>>
>>>> ______________________________**_________________
>>>> R-SIG-Finance at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/**listinfo/r-sig-finance<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 at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/**listinfo/r-sig-finance<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.
>>>>
>>>>
>>> --
>>> Enrico Schumann
>>> Lucerne, Switzerland
>>> http://nmof.net/
>>>
>>
>

-- 
Enrico Schumann
Lucerne, Switzerland
http://nmof.net/



More information about the R-SIG-Finance mailing list