Fix volatility (#2173)

* Make sec fillings link clickable in report

* fix volatility

Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
DidierRLopes
2022-07-25 14:49:40 +01:00
committed by GitHub
parent 37c3025382
commit 52e46d3640

View File

@@ -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)"] = (