backtest-kit 9.1.0 â 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1648,6 +1648,29 @@ npm install @backtest-kit/ui backtest-kit ccxt
|
|
|
1648
1648
|
```
|
|
1649
1649
|
|
|
1650
1650
|
|
|
1651
|
+
### @backtest-kit/mongo
|
|
1652
|
+
|
|
1653
|
+
> **[Explore on NPM](https://www.npmjs.com/package/@backtest-kit/mongo)** ðū
|
|
1654
|
+
|
|
1655
|
+
The **@backtest-kit/mongo** package replaces the default file-based `./dump/` storage with MongoDB as the source of truth and Redis as an O(1) lookup cache. All 15 `IPersist*Instance` contracts from backtest-kit are implemented â strategy code stays unchanged.
|
|
1656
|
+
|
|
1657
|
+
#### Key Features
|
|
1658
|
+
- ðïļ **MongoDB Backend**: All 15 persistence adapters implemented with Mongoose and unique compound indexes
|
|
1659
|
+
- ⥠**O(1) Reads via Redis**: Every context-key lookup goes through ioredis â one `GET` + one `findById`, no B-tree scans
|
|
1660
|
+
- ð **Atomic Writes**: `findOneAndUpdate` with `upsert: true` guarantees read-after-write correctness with no race conditions
|
|
1661
|
+
- ðĄïļ **Look-Ahead Bias Protection**: Adapters that affect signal logic store the simulation timestamp so backtest-kit can enforce temporal correctness
|
|
1662
|
+
- ðŠĶ **Soft Delete**: Measure, Interval, and Memory records carry a `removed` flag instead of being physically deleted
|
|
1663
|
+
- ð **Zero Strategy Changes**: Drop `setup()` into your entry point, everything else stays the same
|
|
1664
|
+
|
|
1665
|
+
#### Use Case
|
|
1666
|
+
Perfect for production deployments where the default file-based storage is a bottleneck or a reliability concern. During backtests, backtest-kit performs thousands of context-keyed reads per second â Redis eliminates the per-request B-tree traversal and makes repeated reads effectively free. MongoDB provides durability, atomic upserts, and a queryable signal history that survives process restarts.
|
|
1667
|
+
|
|
1668
|
+
#### Get Started
|
|
1669
|
+
```bash
|
|
1670
|
+
npm install @backtest-kit/mongo backtest-kit mongoose ioredis
|
|
1671
|
+
```
|
|
1672
|
+
|
|
1673
|
+
|
|
1651
1674
|
### @backtest-kit/ollama
|
|
1652
1675
|
|
|
1653
1676
|
> **[Explore on NPM](https://www.npmjs.com/package/@backtest-kit/ollama)** ðĪ
|