Hi all,
I am trying to figure out how to calculate the Exponential moving average of a stock. The sheet shows the steps involved. I tried using the scan function but I couldn't figure it out. I hope someone smarter than me can help with the formula or point me in the right direction. I know I can do it by adding helper columns but this will be much more efficient and help me learn something new. Thanks.
I am trying to figure out how to calculate the Exponential moving average of a stock. The sheet shows the steps involved. I tried using the scan function but I couldn't figure it out. I hope someone smarter than me can help with the formula or point me in the right direction. I know I can do it by adding helper columns but this will be much more efficient and help me learn something new. Thanks.
Book1 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | APPLE INC. (XNAS:AAPL) | |||||||||
2 | Date | Closing Price | EMA Calculation | Multiplier | 0.3 | |||||
3 | 08-22-2022 | $ 167.57 | ||||||||
4 | 08-23-2022 | $ 167.23 | ||||||||
5 | 08-24-2022 | $ 167.53 | ||||||||
6 | 08-25-2022 | $ 170.03 | ||||||||
7 | 08-26-2022 | $ 163.62 | ||||||||
8 | 08-29-2022 | $ 161.38 | ||||||||
9 | 08-30-2022 | $ 158.91 | ||||||||
10 | 08-31-2022 | $ 157.22 | ||||||||
11 | 09-01-2022 | $ 157.96 | ||||||||
12 | 09-02-2022 | $ 155.81 | ||||||||
13 | 09-06-2022 | $ 154.53 | ||||||||
14 | 09-07-2022 | $ 155.96 | ||||||||
15 | 09-08-2022 | $ 154.46 | ||||||||
16 | 09-09-2022 | $ 157.37 | ||||||||
17 | 09-12-2022 | $ 163.43 | 160.68 | #Starting no. is the last 14 day average | ||||||
18 | 09-13-2022 | $ 153.84 | 159.69 | # After that its (Close - Previous Day EMA)*Multiplier + Previous Day EMA | ||||||
19 | 09-14-2022 | $ 155.31 | 160.81 | |||||||
20 | 09-15-2022 | $ 152.37 | 158.72 | |||||||
21 | 09-16-2022 | $ 150.70 | 157.70 | |||||||
22 | 09-19-2022 | $ 154.48 | 156.10 | |||||||
23 | 09-20-2022 | $ 156.90 | 154.48 | |||||||
24 | 09-21-2022 | $ 153.72 | 154.48 | |||||||
25 | 09-22-2022 | $ 152.74 | 155.21 | |||||||
26 | 09-23-2022 | $ 150.43 | 154.76 | |||||||
27 | 09-26-2022 | $ 150.77 | 154.15 | |||||||
28 | 09-27-2022 | $ 151.76 | 153.04 | |||||||
29 | 09-28-2022 | $ 149.84 | 152.36 | |||||||
30 | 09-29-2022 | $ 142.48 | 152.18 | # Value I am looking for | ||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B3:C30 | B3 | =STOCKHISTORY(A1,WORKDAY(TODAY(),-29),TODAY(),0,0,0,1) |
D17 | D17 | =AVERAGE(C3:C16) |
D18:D30 | D18 | =((C16-D17)*$G$2)+D17 |
Dynamic array formulas. |