3

Seems like it should be a simple problem. I'm using Matlab to build a stock database and analyses toolkit.

I'm using Matlab functions to get a table of data, using a URL like the following:

http://ichart.finance.yahoo.com/table.csv?s=aapl&a=00&b=01&c=2011&d=03&e=04&f=&ignore=.csv

That works just fine to get standard stats (open, close, volume, ect). I can't figure out how to add other yahoo finance stats though like moving averages. Can I modify the above URL to add other stats to the download? Or is there a way to modify a single quote query to include a date? I'm trying to modify the url below to no avail.

http://finance.yahoo.com/d/quotes.csv?s=aapl&f=m4m3

Thanks for the help!

Kara
  • 6,115
  • 16
  • 50
  • 57
zachd1_618
  • 4,210
  • 6
  • 34
  • 47
  • I too would appreciate the same kinds of values in historical contexts. Unfortunately, as of right now, the best solution I have found is to calculate the moving average myself. I mitigate the cost by keeping a local "cache" database of quotes and historical prices. SQLite works wonders for this. I'm working on this at the moment: https://github.com/aktau/gofinance (disclaimer: not really for public consumption at the moment, but could be useful to glean code or contribute). – Aktau Jan 24 '14 at 12:43

1 Answers1

0

The scripts at http://luminouslogic.com/matlab-stock-market-scripts are pretty helpful for working with Yahoo Finance in Matlab. Download the dates and prices you need and then use http://www.mathworks.com/help/toolbox/finance/tsmovavg.html to calculate a moving average.

UPDATE

It looks like you can use m4 to get the moving average. Check out the documentation at http://www.gummy-stuff.org/Yahoo-data.htm . Your url above is correct--you might need to comma separate the parameters.

UPDATE 2

Check out this question: source of historical stock data

Community
  • 1
  • 1
gwintrob
  • 3,253
  • 2
  • 18
  • 14
  • Thanks Gwintrob. The Matlab scripts look helpful, and I'll definitely look into them. My only problem with this is that for a given date range, I need to fetch and analyze tons more data to properly analyze the beginning of that range. Say I'm starting in 2009, I'd need to fetch 200 days previous worth of data to get a 200 day average. Not a big deal, but I was just wondering if there was an easy way to do it with yahoo finance. – zachd1_618 May 08 '12 at 03:49
  • 1
    The url http://www.gummy-stuff.org/Yahoo-data.htm doesn't exist anymore after a take down request from Yahoo's lawyers. – Eugene van der Merwe Jun 25 '16 at 07:57