Skip to main content

tiny library for fast backtest on generated signals

Project description

Alt text GitHub top language GitHub repo size PyPI

Signal Backtester

a small repo Based on Backtesting Lib .
easiest way to backtest your generated signal

Quick Start

installation

pip install signal-backtester

Usage

from signal_backtester import SignalBacktester

# address of your dataset file 
# columns should include "Open, High, Low, Close, Volume, signal"

backtest = SignalBacktester(
                dataset="/home/xibalbas/sample.csv",
                strategy='two_side_sl_tp_reversed',
                cash=1000,
                commission=0.0005,  # equal 0.05 %
                percent_of_portfolio=99,
                stop_loss=1,
                take_profit=10,
                trailing_stop=3,    # if you are using trailing stop
                time_frame='30m', 
                output_path='.'     # path of result files
            )

backtest.run()

strategy

available strategy to use are :

  • two_side_sl_tp_reversed
  • two_side_sl_trailing_reversed
  • one_side_buy_sl_tp
  • one_side_sell_sl_tp
  • one_side_buy_sl_trailing
  • one_side_sell_sl_trailing

dataset structure

your data set structure should be like this table

your buy signals should generate as 2 and your sell signals should generate as 1

you must have this columns in your dataset

  • Date
  • Open
  • High
  • Low
  • Close
  • Volume
  • signal

Alt text

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

signal_backtester-1.0.4.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

signal_backtester-1.0.4-py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page