Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix volatility #2173

Merged
merged 8 commits into from
Jul 25, 2022
2 changes: 1 addition & 1 deletion openbb_terminal/stocks/stocks_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ def show_quick_performance(stock_df: pd.DataFrame, ticker: str):
df = df.applymap(lambda x: f"[red]{x}[/red]" if "-" in x else f"[green]{x}[/green]")
if len(closes) > 252:
df["Volatility (1Y)"] = (
str(round(100 * np.sqrt(252) * closes[:-252].pct_change().std(), 2)) + " %"
str(round(100 * np.sqrt(252) * closes[-252:].pct_change().std(), 2)) + " %"
)
else:
df["Volatility (Ann)"] = (
Expand Down