Returns series representing exponential volatility of returns
(returns, window=30, is_halflife=False)
| 92 | |
| 93 | |
| 94 | def exponential_stdev(returns, window=30, is_halflife=False): |
| 95 | """Returns series representing exponential volatility of returns""" |
| 96 | returns = _prepare_returns(returns) |
| 97 | halflife = window if is_halflife else None |
| 98 | return returns.ewm( |
| 99 | com=None, span=window, halflife=halflife, min_periods=window |
| 100 | ).std() |
| 101 | |
| 102 | |
| 103 | def rebase(prices, base=100.0): |
nothing calls this directly
no test coverage detected