Contents

Backtesting 0.3.3

0

Backtest trading strategies in Python

Backtest trading strategies in Python

Stars: 5422, Watchers: 5422, Forks: 1062, Open Issues: 177

The kernc/backtesting.py repo was created 5 years ago and the last code push was 2 months ago.
The project is extremely popular with a mindblowing 5422 github stars!

How to Install backtesting

You can install backtesting using pip

pip install backtesting

or add it to a project with poetry

poetry add backtesting

Package Details

Author
Zach Lûster
License
AGPL-3.0
Homepage
https://kernc.github.io/backtesting.py/
PyPi:
https://pypi.org/project/Backtesting/
Documentation:
https://kernc.github.io/backtesting.py/doc/backtesting/
GitHub Repo:
https://github.com/kernc/backtesting.py

Classifiers

  • Office/Business/Financial/Investment
  • Scientific/Engineering/Visualization
No  backtesting  pypi packages just yet.

Errors

A list of common backtesting errors.

Code Examples

Here are some backtesting code examples and snippets.

GitHub Issues

The backtesting package has 177 open issues on GitHub

  • Plotting result in TypeError: Index.get_loc() got an unexpected keyword argument 'method'
  • Added live trading support
  • Issues with updating class variables while walk-forward optimising
  • Commission fees differ significantly.
  • AssertionError
  • Invalid daily aggregation of OHLC data with timezone/datetime offset
  • Update GHA to ubuntu-latest
  • BUG: trying to round none / string(tag) / Boolean (is_contingent)
  • MT5 Position Netting changing SLO/TP to the last trade Python 3
  • Backtest.plot() fails with resampling
  • infer_datetime_format will be deprecated
  • Error creating an order with size==0
  • skOpt having issues with backtesting.Optimize (skOpt)
  • Backtest plotting results in empty graph
  • error in example doc with scikit-optimize

See more issues on GitHub

Related Packages & Articles

PyAlgoTrade 0.20

PyAlgoTrade is an event driven algorithmic trading Python library.

finta 1.3

Common financial technical indicators implemented in Pandas.

finplot code example

Here’s a code example using the finplot library in Python to create a simple financial plot

pandas-ta 0.3.14b

An easy to use Python 3 Pandas Extension with 130+ Technical Analysis Indicators. Can be called from a Pandas DataFrame or standalone like TA-Lib. Correlation tested with TA-Lib.