backtesting.py
backtesting.py copied to clipboard
FutureWarning in _plotting.py
Discussed in https://github.com/kernc/backtesting.py/discussions/705
Originally posted by lxxseunghh July 31, 2022
Hi, I got hundreds of this same warning using backtest.plot
method.
.../venv/lib/python3.8/site-packages/backtesting/_plotting.py:148:
FutureWarning: Passing method to Int64Index.get_loc is deprecated and will raise in a future version. Use index.get_indexer([item], method=...) instead. new_bar_idx = new_index.get_loc(mean_time, method='nearest')
How can I remove this warning? Is there a way to remove it without modifying .../backtesting/_plotting.py
file?
I'm currently using Python 3.8.9.
Thanks.
Hi @kernc, Can I work on this?
@kawishqayyum Absolutely, PR welcome!