backtest-kit 9.1.0 → 9.1.1

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.
Files changed (2) hide show
  1. package/README.md +23 -0
  2. 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)** ðŸĪ–
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",