Skip to content

7.2 BackTestPlot - Error #10

@nano-husen

Description

@nano-husen

AttributeError Traceback (most recent call last)
in <cell line: 6>()
4 # Dow Jones Index: ^DJI
5 # NASDAQ 100: ^NDX
----> 6 backtest_plot(df_account_value,
7 baseline_ticker = '^DJI',
8 baseline_start = df_account_value.loc[0,'date'],

5 frames
/usr/local/lib/python3.10/dist-packages/pyfolio/timeseries.py in gen_drawdown_table(returns, top)
1006 df_drawdowns.loc[i, 'Peak date'] = (peak.to_pydatetime()
1007 .strftime('%Y-%m-%d'))
-> 1008 df_drawdowns.loc[i, 'Valley date'] = (valley.to_pydatetime()
1009 .strftime('%Y-%m-%d'))
1010 if isinstance(recovery, float):

AttributeError: 'numpy.int64' object has no attribute 'to_pydatetime'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions