Backtest a rule with honest costs.

An open-source backtester for Bybit perpetuals; version 0.1.0 cannot place orders.

Install

git clone https://github.com/sentinelbotsaas-hub/perpmath.git
cd perpmath
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -e .

Python 3.10 or newer. The only dependency is NumPy.

Download candles

perpmath download BTCUSDT 15m --days 365

One year of 15-minute candles from the public endpoint. No account, no API key.

Run a backtest

perpmath backtest fvg --symbol BTCUSDT --interval 15m --config configs/fvg.json --out results/fvg-btcusdt.json

Writes one JSON file with everything needed to check the result.

What it does

Downloads public Bybit candles, runs a rule with fixed parameters, and reports in-sample and out-of-sample results after fees and slippage.

What it does not do

Version 0.1.0 cannot trade live and never asks for an API key. It ships no profitable strategy and makes no return claims.

How it is funded

Free and MIT licensed. No broker or affiliate arrangement is attached to it.

All 3 shipped strategies lose money.

They show how the accounting works. They are not for trading.

See the backtests