Australian (ASX) Stock Market Forum

Yahoo! Finance Feed Moving Averages question

Hi.

I would like to get averages values from Yahoo!'s stock feed.

In my example, I used:

http://finance.yahoo.com/d/quotes.csv?s=ANZ.AX&f=spm3m4

As of writing, the m3 (50SMA) is 20.8167, and m4 (200SMA) is 20.7455. This does not seem to match the chart in any timeframe (1D to 5Y).

Why am I getting wrong figures?

Google how a smooth m/a is calculated
Then you'll understand
Does it matter anyway?
 
Google how a smooth m/a is calculated
Then you'll understand
Does it matter anyway?

I know how SMA's are calculated. What I'm saying is that it does not match the charted SMA (red/green) lines in any of the timeframes.

Yes it matters, because, if there's a way to get it right, I avoid the effort of computing the MA's myself and simply grab what's there.
 
Hi.

I would like to get averages values from Yahoo!'s stock feed.

In my example, I used:

http://finance.yahoo.com/d/quotes.csv?s=ANZ.AX&f=spm3m4

As of writing, the m3 (50SMA) is 20.8167, and m4 (200SMA) is 20.7455. This does not seem to match the chart in any timeframe (1D to 5Y).

Why am I getting wrong figures?

First, forget about calculating a moving average to 4 decimal places.

As for the difference, what data are you using to calculate SMA? Is Yahoo using their "current" or EOD data feed? Are you using the same feed? If not, it would not be surprising if your data is a bit different from Yahoo's as data from varous suppliers do differ especially for intraday data.

Looking at Yahoo's charts ( http://finance.yahoo.com/echarts?s=GE+Interactive#chart19:symbol=ge;range=1y;indicator=sma+volume;charttype=ohlc;crosshair=on;ohlcvalues=0;logscale=on;source=undefined ) it appears that they are being generated with 1 minute data for all time frames with data from their "current" server. Is that what you are doing? In addition, Yahoo starts their calculation at a different date and data compression is a function of which time frame is chosen (daily for 1 Year, 1 minute for 1 day, etc.). You probably do not do that.

I would not be concerned unless you confirm that your data, start date, and data compression are EXACTLY the same as Yahoo's. Just choose the Yahoo settings that give you what you want.
 
First, forget about calculating a moving average to 4 decimal places.

As for the difference, what data are you using to calculate SMA? Is Yahoo using their "current" or EOD data feed? Are you using the same feed? If not, it would not be surprising if your data is a bit different from Yahoo's as data from varous suppliers do differ especially for intraday data.

Looking at Yahoo's charts ( http://finance.yahoo.com/echarts?s=GE+Interactive#chart19:symbol=ge;range=1y;indicator=sma+volume;charttype=ohlc;crosshair=on;ohlcvalues=0;logscale=on;source=undefined ) it appears that they are being generated with 1 minute data for all time frames with data from their "current" server. Is that what you are doing? In addition, Yahoo starts their calculation at a different date and data compression is a function of which time frame is chosen (daily for 1 Year, 1 minute for 1 day, etc.). You probably do not do that.

I would not be concerned unless you confirm that your data, start date, and data compression are EXACTLY the same as Yahoo's. Just choose the Yahoo settings that give you what you want.

I have trouble finding official details on the CSV quote. I got it from third-party posts (such as http://www.gummy-stuff.org/Yahoo-data.htm).

I don't calculate my own SMA. I just thought (perhaps wrongly) that Yahoo!'s chart and their feed should be derived from the same data. I checked the charts across the different timeframe options and none match the values I got.

... which begs the question, what timeframe / compression is Yahoo! using for averages when I type in http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yr ?

I'm just concerned that it will be odd that I'll be displaying these figures on a table, and then when the user clicks on it, they would be seeing a chart that shows something different.

Perhaps the lesson here is that I should just take raw data from Yahoo and derive the averages and build the charts myself.
 
I have trouble finding official details on the CSV quote. I got it from third-party posts (such as http://www.gummy-stuff.org/Yahoo-data.htm).

I don't calculate my own SMA. I just thought (perhaps wrongly) that Yahoo!'s chart and their feed should be derived from the same data. I checked the charts across the different timeframe options and none match the values I got.

... which begs the question, what timeframe / compression is Yahoo! using for averages when I type in http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yr ?

I'm just concerned that it will be odd that I'll be displaying these figures on a table, and then when the user clicks on it, they would be seeing a chart that shows something different.

Perhaps the lesson here is that I should just take raw data from Yahoo and derive the averages and build the charts myself.

If you want EOD data you can download that from Yahoo's Historical Data page although using a downloader is much, much easier. If you want to try to get free intraday data from Yahoo (or other sources) you will be dealing with a number of variables and I suspect that you will conclude that good free intraday data is not available.
 
Top