2 Commits
Author SHA1 Message Date
vatsalandGitHub aad09da117 Merge pull request #7 from alphabench/fix/spread-backtest
feat: add new backtest functions
2026-02-08 06:06:30 +05:30
porcelaincode c711e9ce8e feat: add new backtest functions 2026-02-08 06:04:43 +05:30
6 changed files with 27 additions and 20 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
[package] [package]
name = "raptorbt" name = "raptorbt"
version = "0.2.1" version = "0.2.2"
edition = "2021" edition = "2021"
description = "High-performance Rust backtesting engine with Python bindings. Drop-in VectorBT replacement with up insanely faster performance at fractional memory footprint." description = "High-performance Rust backtesting engine with Python bindings. Drop-in VectorBT replacement with up insanely faster performance at fractional memory footprint."
authors = ["Alphabench <contact@alphabench.in>"] authors = ["Alphabench <contact@alphabench.in>"]
license = "MIT" license = "MIT"
repository = "https://github.com/alphabench/raptorbt" repository = "https://github.com/alphabench/raptorbt"
homepage = "https://github.com/alphabench/raptorbt" homepage = "https://www.alphabench.in/raptorbt"
readme = "README.md" readme = "README.md"
keywords = ["backtesting", "trading", "quantitative-finance", "rust", "python"] keywords = ["backtesting", "trading", "quantitative-finance", "rust", "python"]
categories = ["finance", "simulation"] categories = ["finance", "simulation"]
+15 -14
View File
@@ -1,9 +1,10 @@
# RaptorBT # RaptorBT
[![PyPI version](https://img.shields.io/pypi/v/raptorbt.svg)](https://pypi.org/project/raptorbt/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI version](https://img.shields.io/pypi/v/raptorbt.svg)](https://pypi.org/project/raptorbt/)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/) [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![Rust](https://img.shields.io/badge/rust-1.70+-orange.svg)](https://www.rust-lang.org/) [![Rust](https://img.shields.io/badge/rust-1.70+-red.svg)](https://www.rust-lang.org/)
[![PyPI Downloads](https://static.pepy.tech/personalized-badge/raptorbt?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=ORANGE&left_text=downloads)](https://pepy.tech/projects/raptorbt)
**Blazing-fast backtesting for the modern quant.** **Blazing-fast backtesting for the modern quant.**
@@ -573,18 +574,18 @@ print(f"Max Drawdown: {result.metrics.max_drawdown_pct}%")
### Metric Mapping ### Metric Mapping
| VectorBT Key | RaptorBT Attribute | | VectorBT Key | RaptorBT Attribute |
| ---------------------- | ------------------------------ | | ------------------ | -------------------------- |
| `Total Return [%]` | `metrics.total_return_pct` | | `Total Return [%]` | `metrics.total_return_pct` |
| `Sharpe Ratio` | `metrics.sharpe_ratio` | | `Sharpe Ratio` | `metrics.sharpe_ratio` |
| `Sortino Ratio` | `metrics.sortino_ratio` | | `Sortino Ratio` | `metrics.sortino_ratio` |
| `Max Drawdown [%]` | `metrics.max_drawdown_pct` | | `Max Drawdown [%]` | `metrics.max_drawdown_pct` |
| `Win Rate [%]` | `metrics.win_rate_pct` | | `Win Rate [%]` | `metrics.win_rate_pct` |
| `Profit Factor` | `metrics.profit_factor` | | `Profit Factor` | `metrics.profit_factor` |
| `SQN` | `metrics.sqn` | | `SQN` | `metrics.sqn` |
| `Omega Ratio` | `metrics.omega_ratio` | | `Omega Ratio` | `metrics.omega_ratio` |
| `Total Trades` | `metrics.total_trades` | | `Total Trades` | `metrics.total_trades` |
| `Expectancy` | `metrics.expectancy` | | `Expectancy` | `metrics.expectancy` |
--- ---
+3 -3
View File
@@ -4,7 +4,7 @@ build-backend = "maturin"
[project] [project]
name = "raptorbt" name = "raptorbt"
version = "0.2.1" version = "0.2.2"
description = "High-performance Rust backtesting engine with Python bindings. Drop-in VectorBT replacement with up insanely faster performance at fractional memory footprint." description = "High-performance Rust backtesting engine with Python bindings. Drop-in VectorBT replacement with up insanely faster performance at fractional memory footprint."
readme = "README.md" readme = "README.md"
requires-python = ">=3.10" requires-python = ">=3.10"
@@ -39,9 +39,9 @@ classifiers = [
] ]
[project.urls] [project.urls]
Homepage = "https://github.com/alphabench/raptorbt" Homepage = "https://www.alphabench.in/raptorbt"
Repository = "https://github.com/alphabench/raptorbt" Repository = "https://github.com/alphabench/raptorbt"
Documentation = "https://github.com/alphabench/raptorbt#readme" Documentation = "https://www.alphabench.in/raptorbt"
"Bug Tracker" = "https://github.com/alphabench/raptorbt/issues" "Bug Tracker" = "https://github.com/alphabench/raptorbt/issues"
[tool.maturin] [tool.maturin]
+7 -1
View File
@@ -24,6 +24,7 @@ from raptorbt._raptorbt import (
run_options_backtest, run_options_backtest,
run_pairs_backtest, run_pairs_backtest,
run_multi_backtest, run_multi_backtest,
run_spread_backtest,
# Indicator functions # Indicator functions
sma, sma,
ema, ema,
@@ -35,9 +36,11 @@ from raptorbt._raptorbt import (
adx, adx,
vwap, vwap,
supertrend, supertrend,
rolling_min,
rolling_max,
) )
__version__ = "0.2.1" __version__ = "0.2.2"
__all__ = [ __all__ = [
# Config classes # Config classes
@@ -54,6 +57,7 @@ __all__ = [
"run_options_backtest", "run_options_backtest",
"run_pairs_backtest", "run_pairs_backtest",
"run_multi_backtest", "run_multi_backtest",
"run_spread_backtest",
# Indicator functions # Indicator functions
"sma", "sma",
"ema", "ema",
@@ -65,4 +69,6 @@ __all__ = [
"adx", "adx",
"vwap", "vwap",
"supertrend", "supertrend",
"rolling_min",
"rolling_max",
] ]
Binary file not shown.
Binary file not shown.