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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: signal_backtester-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 de637e301fd96c0a7aeef4c5db5f84aa7dd71060cdfdc30010f5b1507876e236
MD5 5418fec747defc1a479602604839b995
BLAKE2b-256 c2e38c40805ad6171ee4211f7d4c0895926b8c8b0757187eadb2d3aa6f4f01f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: signal_backtester-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3b44d0fda1234ff40ac70732e4ba26382d7cb76388f34b8407516a048538810f
MD5 c41e61def02c31cd28fbeeff21290eea
BLAKE2b-256 54ffd046fbbf06e1d7d2ca3cb42f34440d57ce3ce56a0e90c6e807b47d604e92

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