pyfolio
pyfolio copied to clipboard
create_txn_tear_sheet throws has no attribute 'trade_value' error
Problem Description
Please provide a minimal, self-contained, and reproducible example:
pf.create_txn_tear_sheet(returns=trader.returns, positions=trader.positions, transactions=trader.transactions)
Please provide the full traceback:
Traceback (most recent call last):
File "/Users/chenfei/Workspace/stocks/test/backtest/turtle_test.py", line 17, in <module>
pf.create_txn_tear_sheet(returns=trader.returns, positions=trader.positions, transactions=trader.transactions)
File "/opt/anaconda3/envs/env_zipline/lib/python3.5/site-packages/pyfolio/plotting.py", line 52, in call_w_context
return func(*args, **kwargs)
File "/opt/anaconda3/envs/env_zipline/lib/python3.5/site-packages/pyfolio/tears.py", line 781, in create_txn_tear_sheet
plotting.plot_txn_time_hist(transactions, ax=ax_txn_timings)
File "/opt/anaconda3/envs/env_zipline/lib/python3.5/site-packages/pyfolio/plotting.py", line 1634, in plot_txn_time_hist
trade_value_sum = txn_time.trade_value.sum()
File "/opt/anaconda3/envs/env_zipline/lib/python3.5/site-packages/pandas/core/generic.py", line 5057, in __getattr__
return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'trade_value'
Please provide any additional information below:
Versions
- Pyfolio version: 0.9.2
- Python version: 3.5.6
- Pandas version: 0.24.0
- Matplotlib version: 3.0.0