Skip to main content

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

Release files for signal-backtester 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for signal-backtester 1.0.4
File Size Uploaded
signal_backtester-1.0.4.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for signal-backtester 1.0.4
File Interpreter ABI Platform
signal_backtester-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 17.1 kB

Release files / signal_backtester-1.0.4.tar.gz

Download URL signal_backtester-1.0.4.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3590c77d0955d44fc25acb61e30a348de433bfb034e7258e604753155dea0853
BLAKE2b-256 checksum
How to use checksums
e634db4cc4f9a9987f65db0e212b78379acf07cfc97905ce33dad529510641dd
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / signal_backtester-1.0.4-py3-none-any.whl

Download URL signal_backtester-1.0.4-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f40af2c441c97f563c00904026414a7268fc547a964632b4ef6b0236ff6d193
BLAKE2b-256 checksum
How to use checksums
8084cb13cc0f45e551cf7783ff2ccaeb7541d9b47c1566a43a640f64876e7f4d
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page