how do i calculate exponential moving average in microsoft access

  • Thread starter Thread starter krishna
  • Start date Start date
K

krishna

I have a database which included price of Different company on daily bases,
HIGH, LOW, CLOSE & AVERAGE TRADED PRICE of each company listed in the stock
exchange.

I wanted to calculate 5 day exponential moving average on the closing price
of particular company.

How do i do that.

Kindly help, thanx u,

KRISHNA
 
Can you define what you mean by exponential moving average?

IF you have a LOW value for every date (including Saturdays, Sundays, and
Holidays) this is fairly simple. If there are breaks in the date range then
the problem is more difficult to solve.

SELECT S2.StockID, Avg(S.Close) as TheMean
FROM [StockTable] as S INNER JOIN [StockTable] as S2
ON S.StockId = S2.StockID
AND (S.TradeDate-4 <= S2.TradeDate)
AND (S.TradeDate >= S2.TradeDate)
GROUP BY S.StockID

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top