how do i calculate exponential moving average in microsoft access

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
 
J

John Spencer (MVP)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top