mirror of
https://github.com/manifoldbt/manifoldbt.git
synced 2026-08-24 14:38:04 +00:00
fix: benchmark timestamp ns, vectorbt trade count x2, remove fake perf numbers from README
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user