All Projects → MiniXC → Simple Back

MiniXC / Simple Back

Licence: mpl-2.0
A simple daily python backtester that works out of the box.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Simple Back

Geoplot
High-level geospatial data visualization library for Python.
Stars: ✭ 897 (+1625%)
Mutual labels:  matplotlib
Machine Learning Alpine
Alpine Container for Machine Learning
Stars: ✭ 30 (-42.31%)
Mutual labels:  matplotlib
Abu
阿布量化交易系统(股票,期权,期货,比特币,机器学习) 基于python的开源量化交易,量化投资架构
Stars: ✭ 8,589 (+16417.31%)
Mutual labels:  matplotlib
Cartopy
Cartopy - a cartographic python library with matplotlib support
Stars: ✭ 857 (+1548.08%)
Mutual labels:  matplotlib
Pythondatasciencehandbook
The book was written and tested with Python 3.5, though other Python versions (including Python 2.7) should work in nearly all cases.
Stars: ✭ 31,995 (+61428.85%)
Mutual labels:  matplotlib
Mlcourse.ai
Open Machine Learning Course
Stars: ✭ 7,963 (+15213.46%)
Mutual labels:  matplotlib
Adjusttext
A small library for automatically adjustment of text position in matplotlib plots to minimize overlaps.
Stars: ✭ 731 (+1305.77%)
Mutual labels:  matplotlib
Ncar Python Tutorial
Numerical & Scientific Computing with Python Tutorial
Stars: ✭ 50 (-3.85%)
Mutual labels:  matplotlib
Deep learning projects
Stars: ✭ 28 (-46.15%)
Mutual labels:  matplotlib
Draw Neural Network
Quick tool to draw fully connected neural network architectures
Stars: ✭ 41 (-21.15%)
Mutual labels:  matplotlib
Celluloid
🎥 Matplotlib animations made easy
Stars: ✭ 867 (+1567.31%)
Mutual labels:  matplotlib
Crime Analysis
Association Rule Mining from Spatial Data for Crime Analysis
Stars: ✭ 20 (-61.54%)
Mutual labels:  matplotlib
Ardupi Ecg
Full HRV analysis of Arduino pulse sensor, using Python signal processing and time series techniques. Chaotic, Fourier, Wavelet, Regression, Neural Net.
Stars: ✭ 35 (-32.69%)
Mutual labels:  matplotlib
Moonchart
Performance tear sheets and backtest analysis for Moonshot
Stars: ✭ 19 (-63.46%)
Mutual labels:  matplotlib
Machine Learning
notebooks with example for machine learning examples
Stars: ✭ 45 (-13.46%)
Mutual labels:  matplotlib
Mplcyberpunk
"Cyberpunk style" for matplotlib plots
Stars: ✭ 762 (+1365.38%)
Mutual labels:  matplotlib
Rustplotlib
A Rust's binding of matplotlib
Stars: ✭ 31 (-40.38%)
Mutual labels:  matplotlib
Mplfinance
Financial Markets Data Visualization using Matplotlib
Stars: ✭ 1,043 (+1905.77%)
Mutual labels:  matplotlib
Ipympl
Matplotlib Jupyter Integration
Stars: ✭ 1,024 (+1869.23%)
Mutual labels:  matplotlib
Pyimagevideo
write animated GIF, multipage append TIFF, AVI OGV video in Python
Stars: ✭ 36 (-30.77%)
Mutual labels:  matplotlib

📈📉  simple-back

build PyPI Code style: black codecov pylint Documentation Status

Documentation | Request A Feature

Installation

pip install simple_back

Quickstart

The following is a simple crossover strategy. For a full tutorial on how to build a strategy using simple-back, visit the quickstart tutorial

from simple_back.backtester import BacktesterBuilder

builder = (
   BacktesterBuilder()
   .name('JNUG 20-Day Crossover')
   .balance(10_000)
   .calendar('NYSE')
   .compare(['JNUG']) # strategies to compare with
   .live_progress() # show a progress bar
   .live_plot(metric='Total Return (%)', min_y=None)  # we assume we are running this in a Jupyter Notebook
)

bt = builder.build() # build the backtest

for day, event, b in bt['2019-1-1':'2020-1-1']:
    if event == 'open':
        jnug_ma = b.prices['JNUG',-20:]['close'].mean()
        b.add_metric('Price', b.price('JNUG'))
        b.add_metric('MA (20 Days)', jnug_ma)

        if b.price('JNUG') > jnug_ma:
            if not b.portfolio['JNUG'].long: # check if we already are long JNUG
                b.portfolio['JNUG'].short.liquidate() # liquidate any/all short JNUG positions
                b.long('JNUG', percent=1) # long JNUG

        if b.price('JNUG') < jnug_ma:
            if not b.portfolio['JNUG'].short: # check if we already are short JNUG
                b.portfolio['JNUG'].long.liquidate() # liquidate any/all long JNUG positions
                b.short('JNUG', percent=1) # short JNUG

Why another Python backtester?

There are many backtesters out there, but this is the first one built for rapid prototyping in Jupyter Notebooks.

Built for Jupyter Notebooks

Get live feedback on your backtests (live plotting, progress and metrics) in your notebook to immediatly notice if something is off about your strategy.

Sensible Defaults and Caching

Many backtesters need a great deal of configuration and setup before they can be used. Not so this one. At it's core you only need one loop, as this backtester can be used like any iterator. A default provider for prices is included, and caches all its data on your disk to minimize the number of requests needed.

Extensible

This is intended to be a lean framework where, e.g. adding crypto data is as easy as extending the DailyPriceProvider class.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].