fix: benchmark timestamp ns, vectorbt trade count x2, remove fake perf numbers from README

This commit is contained in:
Jimmy7892
2026-03-17 16:23:22 +01:00
parent 67ab17280b
commit c4e7e9abb4
2 changed files with 6 additions and 10 deletions
+4 -8
View File
@@ -90,15 +90,11 @@ See the [examples/](examples/) directory for complete runnable strategies:
## Performance ## Performance
ManifoldBT's Rust engine is orders of magnitude faster than pure-Python alternatives: Run the benchmark yourself:
| Engine | 500K bars | 5M bars | ```bash
|--------|-----------|---------| python benchmarks/bench_vs_competitors.py --rows 500000 --runs 5
| **ManifoldBT** | ~0.02s | ~0.15s | ```
| vectorbt | ~0.8s | ~8s |
| backtrader | ~12s | ~120s+ |
Run `python benchmarks/bench_vs_competitors.py` to reproduce.
## License ## License
+2 -2
View File
@@ -62,7 +62,7 @@ def bench_bt_engine(df: pd.DataFrame, n_runs: int) -> dict:
# Write synthetic data to a temp parquet (manifoldbt canonical schema) # Write synthetic data to a temp parquet (manifoldbt canonical schema)
parquet_df = pd.DataFrame({ parquet_df = pd.DataFrame({
"timestamp": pd.to_datetime(df["timestamp"].values, utc=True), "timestamp": pd.to_datetime(df["timestamp"].values, utc=True).as_unit("ns"),
"symbol_id": np.uint32(1), "symbol_id": np.uint32(1),
"open": df["open"].values, "open": df["open"].values,
"high": df["high"].values, "high": df["high"].values,
@@ -217,7 +217,7 @@ def bench_vectorbt(df: pd.DataFrame, n_runs: int) -> dict:
"median": np.median(times), "median": np.median(times),
"mean": np.mean(times), "mean": np.mean(times),
"total_return": stats.get("Total Return [%]", None), "total_return": stats.get("Total Return [%]", None),
"trades": stats.get("Total Trades", None), "trades": int(stats.get("Total Trades", 0)) * 2, # vbt counts round-trips; x2 for entry+exit
} }