Just for fun, lets use a little web voodoo to combine Yahoo Finance data with Google Charts. Why?… because we can. All we need is a little PHP, a web server, and a URL. The goal is to download Yahoo Finance daily price data for two stocks, convert it to an array of daily returns, and plot the results using Google Charts simply by calling a URL. For instance, to produce this:
We just need to type this into our browser: http://stotastic.com/php/scatterPlot.php?tick1=BP&tick2=SPY&mm=01&dd=01&yyyy=2008
Where tick1 and tick2 are the stock tickers; and mm, dd, yyyy represent the starting date from which data is grabbed. So lets dig in and find out how PHP is used to make all this web magic work.
