Signalab
Tick-level backtesting for quantitative FX and CFD research
Signalab is a research-focused backtesting library that simulates trading at raw tick resolution — every bid/ask update — rather than bar-close approximations. It models the execution mechanics that matter for FX and CFD strategies: bid/ask spread, per-lot commissions, and daily swap/carry costs, with margin tracking and automatic liquidation.
Key features
-
Tick-level simulation — the loop runs on every raw bid/ask update. Indicator signals computed on candles are injected back into the tick stream at exact candle-close timestamps — no lookahead, no bar approximation.
-
Simple and easy to extend — subclass
Strategy, implementperform(). Need a custom indicator? SubclassIndicatorand implementcompute(). That's it! -
Vectorized computations — indicators and analytics are implemented as vectorized operations on the full data arrays. The engine coordinates the data flow, but all computations are done in batches for maximum performance.
-
Parallel parameter grid — test dozens of strategy/indicator parameter combinations in one command. Run them in parallel and get a ranked report of all runs with their metrics and configs.
Install
pip install signalab
Quick showcase
from signalab import (
MarketData, BacktestEngine, Account,
RSI, Strategy, Action
)
class MyStrategy(Strategy):
def __init__(self, name="My Strategy", label="my_strat", stop_loss=50):
super().__init__(name=name, label=label)
self.stop_loss = stop_loss
def perform(self, market):
if self.account.floating_pl() < -self.stop_loss:
self.account.close_all_positions()
if self.account.open_position_count > 0:
return
buy_signals = self.buy_signal_count()
sell_signals = self.sell_signal_count()
if buy_signals >= sell_signals:
self.account.open(Action.BUY, size=0.01)
else:
self.account.open(Action.SELL, size=0.01)
data = MarketData.load_from_ticks("EURUSD_ticks.csv")
report = BacktestEngine().run(
data = data,
indicators = [RSI(period=14)],
strategies = [MyStrategy()],
)
r = report.get_account_report()
print(r.metrics())
# {
# 'total_return': 0.12,
# 'sharpe_ratio': 1.43,
# 'max_drawdown': -0.07,
# 'win_rate': 0.54,
# ...
# }
More examples and tutorials coming soon!
🚀 Project starter provided by Cookie Pyrate
Metadata
Release files for signalab 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| signalab-0.1.3.tar.gz | 52.4 kB | Without provenance | Details for signalab-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| signalab-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for signalab-0.1.3-py3-none-any.whl |
Total release size: 95.0 kB
Release files / signalab-0.1.3.tar.gz
| Download URL | signalab-0.1.3.tar.gz |
|---|---|
| Size | 52.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aea61b994afb43daad2b93edb7abc233f897f1e7f7c430e866ef078f5fd05b80
|
|
BLAKE2b-256 checksum How to use checksums |
71584e40c6e6bfc861346087494389d137f2237aecb55a8d897b4f9caa4c505d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / signalab-0.1.3-py3-none-any.whl
| Download URL | signalab-0.1.3-py3-none-any.whl |
|---|---|
| Size | 42.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a75aa03ccb70dfcc9a6acb6aa8a8d2b5566bf542ded4ea73902f06f5bc13613
|
|
BLAKE2b-256 checksum How to use checksums |
b5d3fd3bae57553ae3ddd40c122d9513c6d10f00c6172673dc60f6405d8e7375
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for signalab 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.