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/samle.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.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

signal_backtester-1.0.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: signal_backtester-1.0.1.tar.gz
  • Upload date:
  • Size: 7.9 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.1.tar.gz
Algorithm Hash digest
SHA256 ced94b1cdc11e65d66d6f5bb8239568e8ddf860056fabb6d99c9ecb94dd535a5
MD5 fb91252d07b8b4036baf6326be7991ca
BLAKE2b-256 3b05e708a27aa48dcd8b12cdf3b4c51ec7c0015cf80292798dd4d069d7f86abf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: signal_backtester-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0206df80a3e27eabdf98be03f359d40a3178f06e7c1faaab718ff4bd1eabd7be
MD5 cb330e8574274e6c38a62aaccd2f8f91
BLAKE2b-256 5d83f30b5cfeb909ca92f63403539fca3c3ae0e56bd45cbc4a40d2719807f226

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