Closed KIC closed 1 year ago
qs.reports.html takes pd.Series as input for strategy. Here you are giving a pandas as input.
Following code worked for me from backtrader timeReturn analyzer.
returns_dict = thestrat.analyzers.time_return.get_analysis()
# Convert the dictionary to a DataFrame
returns_df = (
pd.DataFrame(
list(returns_dict.items()),
columns = ["date", "return"]
)
.set_index("date")
)
returns = pd.Series(returns_df['return'])
qs.reports.html(
returns,
benchmark=benchmark,
output='tear_sheet.html'
)
I pass a series my frame has a MultiIndex and thus ["TOTAL", "return"]
evaluates to a Series.
for some reason the html file for the report is empty:
however the
works as expected.
No errors were thrown only several warnings about Arial font can't be found.