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.3.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

signal_backtester-1.0.3-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file signal_backtester-1.0.3.tar.gz.

File metadata

  • Download URL: signal_backtester-1.0.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for signal_backtester-1.0.3.tar.gz
Algorithm Hash digest
SHA256 9d24dab0990265f8d027f6049495d40c17f20c2e572f36fcc3b1fd402063ebd7
MD5 1bdf4333597db81a59c3ae4bcc280ef4
BLAKE2b-256 56dfc9375391bd4b67501d0fafd9bad7fcc21993bae94921dfa82df36c0be420

See more details on using hashes here.

File details

Details for the file signal_backtester-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: signal_backtester-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for signal_backtester-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3c3efba860609142228887503db0912016f77b918234ab4a5bc60e17ca62799a
MD5 0b068e7c3929eb6a9193dac4db2be8f1
BLAKE2b-256 105b3cc2b6f5433118b3ac3576d0fb466f2960189ce70f23bed1312e36dc793d

See more details on using hashes here.

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