Moving average calculation

Questions about MultiCharts and user contributed studies.
Algyros
Posts: 52
Joined: 28 Sep 2009
Location: Austin, TX
Has thanked: 1 time
Been thanked: 5 times

Moving average calculation

Postby Algyros » 17 Feb 2010

I'm trying to understand why moving average values on my MC charts (with an IB data feed) are different from the values given by other platforms.

For example, take a daily chart of the SPY after close.

My MC chart has the following moving average values:

13 EMA: 108.22
34 EMA: 109.45
54 EMA: 109.62

On Stockcharts the values are as follows:

13 EMA: 108.52
34 EMA: 109.71
54 EMA: 109.69

All of these values are calculated using only regular market hours data.

Thanks for your assistance,
Alex

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 17 Feb 2010

First step is to see if it is GIGO

can you obtain the closing prices from Stockcharts ?

you can make a comparison of the Stockcharts prices with your chart prices.

if the data are the same, then the formula must be different.

if the data are different, then you have to find out why they are different.

e.g. check your session time definition


p.s. the EMA formula in MultiCharts is the same as TS'.

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 17 Feb 2010

At the very least, there's also the question of whether StockCharts uses the same EMA formula, and whether this is a stabilization problem because they have different starting points. EMAs always include all data back to the beginning of the chart, so if one chart has more days loaded, it WILL have a different value, even if only slightly different. As the number of days of data processed increases, the numbers will converge, and eventually they will be the same to several decimal places after a few hundred bars (depending on the "length" chosen for the EMA).

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 17 Feb 2010

Try using a simple ma instead of ema, ema uses all of the data, so you have to have the exact same numer of bars and data values to get the same result.


Return to “MultiCharts”