Skip to content

nooperpudd/backtrader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backtrader

PyPi Version

PyPi Monthly Donwloads

License

Travis-ci Build Status

Documentation Status

Gitter chat

Pytghon versions

BackTesting platform written in Python to test trading strategies.

Documentation

The blog:

Read the full documentation at readthedocs.org:

List of built-in Indicators (88)

Python 2/3 Support

  • Python 2.7
  • Python 3.2/3.3/3.4/3.5
  • It also works with pypy and pypy3 (no plotting - matplotlib is not supported under pypy)

Compatibility is tested during development with 2.7 and 3.4

The other versions are tested automatically with Travis.

Installation

backtrader is self-contained with no external dependencies (except if you want to plot)

From pypi:

  • pip install backtrader
  • pip install backtrader[matplotlib]

    If matplotlib is not installed and you wish to do some plotting

Note

The minimum matplotlib version is 1.4.1

From source:

  • Place the backtrader directory found in the sources inside your project

Features:

  • Bar by Bar (next) operation or batch mode (once) operation
  • Indicators and the addition of any custom end-user developed one
  • Strategies
  • Data Feeds from Online Sources or CSV Files (other forms could be implemented) - Including Pandas Dataframes
  • Data Feeds with different timeframes
  • Data Feed Resampling
  • Data Feed Replaying
  • A Broker implementation supporting
    • Commision schemes for stocks and derivatives
    • Orders: AtClose, AtMarket, AtLimit, Stop, StopLimit
  • Position Sizers for the automatic determination of the stake
  • Optimization of Strategies with multicore support
  • Plotting

Version numbering

X.Y.Z.I

  • X: Major version number. Should stay stable unless something big is changed like an overhaul to use numpy
  • Y: Minor version number. To be changed upon adding a complete new feature or (god forbids) an incompatible API change.
  • Z: Revision version number. To be changed for documentation updates, small changes, small bug fixes
  • I: Number of Indicators already built into the platform

Alternatives

If after seeing the docs (see also the example below) you feel this is not your cup of tea, you can always have a look at similar Python platforms:

About

Python Backtesting library for trading strategies

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%