tiny library for fast backtest on generated signals
Project description
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
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
Built Distribution
File details
Details for the file signal_backtester-1.0.4.tar.gz
.
File metadata
- Download URL: signal_backtester-1.0.4.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3590c77d0955d44fc25acb61e30a348de433bfb034e7258e604753155dea0853 |
|
MD5 | 41db498b123cd4bbe44188359accd6c8 |
|
BLAKE2b-256 | e634db4cc4f9a9987f65db0e212b78379acf07cfc97905ce33dad529510641dd |
File details
Details for the file signal_backtester-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: signal_backtester-1.0.4-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f40af2c441c97f563c00904026414a7268fc547a964632b4ef6b0236ff6d193 |
|
MD5 | 5d6e6cc123be2c44501db87c15f79aca |
|
BLAKE2b-256 | 8084cb13cc0f45e551cf7783ff2ccaeb7541d9b47c1566a43a640f64876e7f4d |