backtest-kit 3.0.16 → 3.0.17

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 (3) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/types.d.ts +5 -31
package/README.md CHANGED
@@ -320,7 +320,7 @@ Order book fetching uses the same temporal alignment as candles, but with a conf
320
320
 
321
321
  #### Order Book Timestamp Convention:
322
322
 
323
- The `from`/`to` range is a **lookback window**. The adapter selects the closest snapshot to `to` in backtest mode, or returns real-time data in live mode. Unlike candles, most exchanges (e.g. Binance `GET /api/v3/depth`) only expose the **current** order book with no historical query support — for backtest you must provide your own snapshot storage.
323
+ Unlike candles, most exchanges (e.g. Binance `GET /api/v3/depth`) only expose the **current** order book with no historical query support — for backtest you must provide your own snapshot storage.
324
324
 
325
325
  **Key principles:**
326
326
  - Time range is aligned down to `CC_ORDER_BOOK_TIME_OFFSET_MINUTES` boundary
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "3.0.16",
3
+ "version": "3.0.17",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -1961,37 +1961,11 @@ interface IActionSchema {
1961
1961
  * @see TActionCtor for constructor signature requirements
1962
1962
  * @see ClientAction for internal wrapper that manages lifecycle
1963
1963
  */
1964
- interface IPublicAction extends IAction {
1965
- /**
1966
- * Async initialization method called once after construction.
1967
- *
1968
- * Use this method to:
1969
- * - Establish database connections
1970
- * - Initialize API clients
1971
- * - Load configuration files
1972
- * - Open file handles or network sockets
1973
- * - Perform any async setup required before handling events
1974
- *
1975
- * Guaranteed to:
1976
- * - Run exactly once per action handler instance
1977
- * - Complete before any event methods are called
1978
- * - Run after constructor but before first event
1979
- *
1980
- * @returns Promise that resolves when initialization is complete
1981
- * @throws Error if initialization fails (will prevent strategy execution)
1982
- *
1983
- * @example
1984
- * ```typescript
1985
- * async init() {
1986
- * this.db = await connectToDatabase();
1987
- * this.cache = new Redis(process.env.REDIS_URL);
1988
- * await this.cache.connect();
1989
- * console.log('Action initialized');
1990
- * }
1991
- * ```
1992
- */
1993
- init(): void | Promise<void>;
1994
- }
1964
+ type IPublicAction = {
1965
+ [key in keyof IAction]?: IAction[key];
1966
+ } & {
1967
+ init?(): void | Promise<void>;
1968
+ };
1995
1969
  /**
1996
1970
  * Action interface for state manager integration.
1997
1971
  *