Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/calcul9/public_html/wp-content/themes/suffusion/functions/media.php on line 580

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/calcul9/public_html/wp-content/themes/suffusion/functions/media.php on line 583

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/calcul9/public_html/wp-content/themes/suffusion/functions/media.php on line 586

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/calcul9/public_html/wp-content/themes/suffusion/functions/media.php on line 589

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/calcul9/public_html/wp-content/themes/suffusion/functions/media.php on line 592

Warning: Cannot modify header information - headers already sent by (output started at /home/calcul9/public_html/wp-content/themes/suffusion/functions/media.php:580) in /home/calcul9/public_html/wp-includes/feed-rss2-comments.php on line 8
Comments on: Screencast: Downloading Return Data from Yahoo! Finance using R https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/ Sun, 15 Feb 2015 08:41:48 +0000 hourly 1 https://wordpress.org/?v=5.8.9 By: Yahoo Forex Csv | forexbank.xyz https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/#comment-258281 Sun, 15 Feb 2015 08:41:48 +0000 http://www.calculatinginvestor.com/?p=2899#comment-258281 […] Screencast: Downloading Return Data … – In this screencast, I demonstrate how to use R to download historical price data from Yahoo! Finance. I also demonstrate how to convert the price data …… […]

]]>
By: Hilary https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/#comment-257563 Tue, 10 Feb 2015 20:48:50 +0000 http://www.calculatinginvestor.com/?p=2899#comment-257563 Sorry, didn’t post the right thing previously. This is what I got.

> # Load security data from Yahoo! Finance
> prices1
> prices1
> # To make week end prices:
> nextfri.Date weekly.prices
> # To convert month end prices:
> monthly.prices
> # Convert weekly prices into weekly returns
> r.weekly r1.weekly
> # Convert monthly prices into monthly returns
> r.monthly r1.monthly
> # Write output data to csv file
> write.zoo(r1.weekly, file=”weekly.csv”,sep=”,”,col.names=c(“Dates”,”Percent Return”))
Error: could not find function “write.zoo”
> write.zoo(r1.monthly, file=”monthly.csv”,sep=”,”,col.names=c(“Dates”,”Percent Return”))
Error: could not find function “write.zoo”
>

]]>
By: Hilary https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/#comment-257562 Tue, 10 Feb 2015 20:47:50 +0000 http://www.calculatinginvestor.com/?p=2899#comment-257562 Don’t know if you will reply me, but I used your script and got this

> # Load security data from Yahoo! Finance
> prices1
> prices1
> # To make week end prices:
> nextfri.Date weekly.prices
> # To convert month end prices:
> monthly.prices
> # Convert weekly prices into weekly returns
> r.weekly r1.weekly
> # Convert monthly prices into monthly returns
> r.monthly r1.monthly
> # Write output data to csv file
> write.zoo(r1.weekly, file=”weekly.csv”,sep=”,”,col.names=c(“Dates”,”Percent Return”))
Error: could not find function “write.zoo”
> write.zoo(r1.monthly, file=”monthly.csv”,sep=”,”,col.names=c(“Dates”,”Percent Return”))
Error: could not find function “write.zoo”
>

I already installed zoo and tseries,but R still can’t find the functions. Please help!

]]>
By: Hilary https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/#comment-257561 Tue, 10 Feb 2015 20:45:55 +0000 http://www.calculatinginvestor.com/?p=2899#comment-257561 Don’t know if you will reply me, but I used your script and got this
>
> # Load security data from Yahoo! Finance
> prices1
> prices1
> # To make week end prices:
> nextfri.Date weekly.prices
> # To convert month end prices:
> monthly.prices
> # Convert weekly prices into weekly returns
> r.weekly r1.weekly
> # Convert monthly prices into monthly returns
> r.monthly r1.monthly
> # Write output data to csv file
> write.zoo(r1.weekly, file=”weekly.csv”,sep=”,”,col.names=c(“Dates”,”Percent Return”))
Error: could not find function “write.zoo”
> write.zoo(r1.monthly, file=”monthly.csv”,sep=”,”,col.names=c(“Dates”,”Percent Return”))
Error: could not find function “write.zoo”
>

I already installed zoo and tseries,but R still can’t find the functions. Please help!

]]>
By: Bernard https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/#comment-241360 Sat, 06 Dec 2014 01:14:52 +0000 http://www.calculatinginvestor.com/?p=2899#comment-241360 Just to thank you for the script. Very handy. Well done.
best regards,
B.

]]>
By: calcinv https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/#comment-221550 Thu, 25 Sep 2014 12:37:26 +0000 http://www.calculatinginvestor.com/?p=2899#comment-221550 In reply to Daniel.

Hi, thanks for the feedback.

I showed how to download returns for multiple securities in a later post:

http://www.calculatinginvestor.com/2013/09/19/downloading-batch-returns/

-Chad

]]>
By: Daniel https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/#comment-221414 Wed, 24 Sep 2014 15:23:16 +0000 http://www.calculatinginvestor.com/?p=2899#comment-221414 Hello,

this is pretty useful. I am trying to figure out however, how you can load data for multiple securities, rather than just for one.

So, I’m wandering how the following needs to be changed

prices1 <- get.hist.quote("SPY", quote="Adj", start="2005-12-25", retclass="zoo")

so that I get data both for SPY and for AGZD for example. Any help will be appreciated

]]>
By: Kalpana https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/#comment-216285 Sun, 03 Aug 2014 23:38:24 +0000 http://www.calculatinginvestor.com/?p=2899#comment-216285 I get the error : Error in aggregate.zoo(prices1, as.yearmon, tail, 1) :
object ‘as.yearmon’ not found

Is there any package that I need to install for using as.yearmon? I have installed the ‘zoo’ package and ‘tseries’ already

]]>
By: calcinv https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/#comment-206547 Mon, 07 Apr 2014 14:11:37 +0000 http://www.calculatinginvestor.com/?p=2899#comment-206547 In reply to Rick.

I’ll take a look. The “get.hist.quote” function was recently broken because the Yahoo! link changed, and I haven’t updated the script. I was hoping that the function would be updated. Maybe it has and the parameters have changed.

]]>
By: Rick https://www.calculatinginvestor.com/2011/05/12/downloading-return-data/#comment-206489 Sat, 05 Apr 2014 23:56:46 +0000 http://www.calculatinginvestor.com/?p=2899#comment-206489 very useful script

i got error on function na.locf()
should it be an argument in get.hist.quote?
maybe na.omit is sufficient if you’re dealing with securities with the same missing dates?

]]>