Skip to content

Commit 0b865a7

Browse files
committed
Bump and fix ewma vol
1 parent 9627b9f commit 0b865a7

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
master_doc = 'index'
2424

2525
# The full version, including alpha/beta/rc tags
26-
release = '0.2.0'
26+
release = '0.2.1'
2727

2828

2929
# -- General configuration ---------------------------------------------------

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="turingquant",
8-
version="0.2.0",
8+
version="0.2.1",
99
packages=find_packages(),
1010
install_requires=["pandas", "pandas_datareader", "numpy", "matplotlib", "alpha_vantage", "bs4", "plotly", "yfinance"],
1111

turingquant/metrics.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,22 +206,20 @@ def rolling_sharpe(returns, window, risk_free=0, plot=False):
206206
return rolling_sharpe
207207

208208

209-
def ewma_volatility(close_prices, return_type, window, plot=False):
209+
def ewma_volatility(returns, window, plot=False):
210210
"""
211211
Essa função possibilita a visualização da volatilidade a partir do cálculo da EWMA e da plotagem do gráfico
212212
dessa métrica ao longo de um período.
213213
214214
Args:
215-
close_prices (pd.DataFrame): série de preços de fechamento que será utilizado de base para o cálculo da EWMA;
216-
return_type (string): tipo de retorno (simple - 'simp' ou logarítmico - 'log') que será utilizado de base para cálculo;
215+
returns (pd.DataFrame): série de retornos para o qual o EWMA será calculado.
217216
window (int): janela móvel para cálculo da EWMA;
218217
plot (bool): se True, plota o gráfico de linha da EWMA ao longo do tempo
219218
220219
Returns:
221220
ewma_volatility (pd.DataFrame): um dataframe indexado à data com os valores de EWMA dos últimos window dias
222221
"""
223222

224-
returns = returns(close_prices, return_type)
225223

226224
ewma_volatility = returns.ewm(span=window).std()
227225
ewma_volatility = pd.Series.to_frame(ewma_volatility)

0 commit comments

Comments
 (0)