# 移動平均

（重定向自移动平均

## 簡單移動平均

${\displaystyle SMA={p_{1}+p_{2}+\cdots +p_{n} \over n}}$

${\displaystyle SMA_{t1,n}=SMA_{t0,n}-{p_{1} \over n}+{p_{n+1} \over n}}$

## 加權移動平均

${\displaystyle WMA_{M}={np_{M}+(n-1)p_{M-1}+\cdots +2p_{M-n+2}+p_{M-n+1} \over n+(n-1)+\cdots +2+1}}$
WMA，N=15

${\displaystyle WMA_{M+1}={N_{M+1} \over n+(n-1)+\cdots +2+1}}$

## 指數移動平均

EMA，N=15

${\displaystyle S_{t}=\alpha \times Y_{t}+(1-\alpha )\times S_{t-1}}$

${\displaystyle {\text{EMA}}_{t1}={\text{EMA}}_{t0}+\alpha \times (p-{\text{EMA}}_{t0})}$

${\displaystyle {\text{EMA}}_{t0}}$分拆開來如下：

${\displaystyle {\text{EMA}}={p_{1}+(1-\alpha )p_{2}+(1-\alpha )^{2}p_{3}+(1-\alpha )^{3}p_{4}+\cdots \over 1+(1-\alpha )+(1-\alpha )^{2}+(1-\alpha )^{3}+\cdots }}$

${\displaystyle {\text{EMA}}=\alpha \times \left(p_{1}+(1-\alpha )p_{2}+(1-\alpha )^{2}p_{3}+(1-\alpha )^{3}p_{4}+\cdots \right)}$

## 參考文献

1. ^ NIST/SEMATECH e-Handbook of Statistical Methods: Single Exponential Smoothing，National Institute of Standards and Technology