backtest-kit 1.5.3 → 1.5.4
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/build/index.cjs +815 -142
- package/build/index.mjs +816 -143
- package/package.json +2 -2
- package/types.d.ts +69 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backtest-kit",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "A TypeScript library for trading system backtest",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Petr Tripolsky",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"di-kit": "^1.0.18",
|
|
76
76
|
"di-scoped": "^1.0.20",
|
|
77
|
-
"functools-kit": "^1.0.
|
|
77
|
+
"functools-kit": "^1.0.94",
|
|
78
78
|
"get-moment-stamp": "^1.1.1",
|
|
79
79
|
"ollama": "^0.6.3"
|
|
80
80
|
}
|
package/types.d.ts
CHANGED
|
@@ -5167,6 +5167,11 @@ declare const PersistPartialAdapter: PersistPartialUtils;
|
|
|
5167
5167
|
* ```
|
|
5168
5168
|
*/
|
|
5169
5169
|
declare class BacktestUtils {
|
|
5170
|
+
/**
|
|
5171
|
+
* Memoized function to get or create BacktestInstance for a symbol-strategy pair.
|
|
5172
|
+
* Each symbol-strategy combination gets its own isolated instance.
|
|
5173
|
+
*/
|
|
5174
|
+
private _getInstance;
|
|
5170
5175
|
/**
|
|
5171
5176
|
* Runs backtest for a symbol with context propagation.
|
|
5172
5177
|
*
|
|
@@ -5268,6 +5273,24 @@ declare class BacktestUtils {
|
|
|
5268
5273
|
* ```
|
|
5269
5274
|
*/
|
|
5270
5275
|
dump: (symbol: string, strategyName: StrategyName, path?: string) => Promise<void>;
|
|
5276
|
+
/**
|
|
5277
|
+
* Lists all active backtest instances with their current status.
|
|
5278
|
+
*
|
|
5279
|
+
* @returns Promise resolving to array of status objects for all instances
|
|
5280
|
+
*
|
|
5281
|
+
* @example
|
|
5282
|
+
* ```typescript
|
|
5283
|
+
* const statusList = await Backtest.list();
|
|
5284
|
+
* statusList.forEach(status => {
|
|
5285
|
+
* console.log(`${status.symbol} - ${status.strategyName}: ${status.status}`);
|
|
5286
|
+
* });
|
|
5287
|
+
* ```
|
|
5288
|
+
*/
|
|
5289
|
+
list: () => Promise<{
|
|
5290
|
+
symbol: string;
|
|
5291
|
+
strategyName: string;
|
|
5292
|
+
status: "pending" | "fulfilled" | "rejected" | "ready";
|
|
5293
|
+
}[]>;
|
|
5271
5294
|
}
|
|
5272
5295
|
/**
|
|
5273
5296
|
* Singleton instance of BacktestUtils for convenient backtest operations.
|
|
@@ -5319,6 +5342,11 @@ declare const Backtest: BacktestUtils;
|
|
|
5319
5342
|
* ```
|
|
5320
5343
|
*/
|
|
5321
5344
|
declare class LiveUtils {
|
|
5345
|
+
/**
|
|
5346
|
+
* Memoized function to get or create LiveInstance for a symbol-strategy pair.
|
|
5347
|
+
* Each symbol-strategy combination gets its own isolated instance.
|
|
5348
|
+
*/
|
|
5349
|
+
private _getInstance;
|
|
5322
5350
|
/**
|
|
5323
5351
|
* Runs live trading for a symbol with context propagation.
|
|
5324
5352
|
*
|
|
@@ -5421,6 +5449,24 @@ declare class LiveUtils {
|
|
|
5421
5449
|
* ```
|
|
5422
5450
|
*/
|
|
5423
5451
|
dump: (symbol: string, strategyName: StrategyName, path?: string) => Promise<void>;
|
|
5452
|
+
/**
|
|
5453
|
+
* Lists all active live trading instances with their current status.
|
|
5454
|
+
*
|
|
5455
|
+
* @returns Promise resolving to array of status objects for all instances
|
|
5456
|
+
*
|
|
5457
|
+
* @example
|
|
5458
|
+
* ```typescript
|
|
5459
|
+
* const statusList = await Live.list();
|
|
5460
|
+
* statusList.forEach(status => {
|
|
5461
|
+
* console.log(`${status.symbol} - ${status.strategyName}: ${status.status}`);
|
|
5462
|
+
* });
|
|
5463
|
+
* ```
|
|
5464
|
+
*/
|
|
5465
|
+
list: () => Promise<{
|
|
5466
|
+
symbol: string;
|
|
5467
|
+
strategyName: string;
|
|
5468
|
+
status: "pending" | "fulfilled" | "rejected" | "ready";
|
|
5469
|
+
}[]>;
|
|
5424
5470
|
}
|
|
5425
5471
|
/**
|
|
5426
5472
|
* Singleton instance of LiveUtils for convenient live trading operations.
|
|
@@ -5651,6 +5697,11 @@ declare class Performance {
|
|
|
5651
5697
|
* ```
|
|
5652
5698
|
*/
|
|
5653
5699
|
declare class WalkerUtils {
|
|
5700
|
+
/**
|
|
5701
|
+
* Memoized function to get or create WalkerInstance for a symbol-walker pair.
|
|
5702
|
+
* Each symbol-walker combination gets its own isolated instance.
|
|
5703
|
+
*/
|
|
5704
|
+
private _getInstance;
|
|
5654
5705
|
/**
|
|
5655
5706
|
* Runs walker comparison for a symbol with context propagation.
|
|
5656
5707
|
*
|
|
@@ -5752,6 +5803,24 @@ declare class WalkerUtils {
|
|
|
5752
5803
|
* ```
|
|
5753
5804
|
*/
|
|
5754
5805
|
dump: (symbol: string, walkerName: WalkerName, path?: string) => Promise<void>;
|
|
5806
|
+
/**
|
|
5807
|
+
* Lists all active walker instances with their current status.
|
|
5808
|
+
*
|
|
5809
|
+
* @returns Promise resolving to array of status objects for all instances
|
|
5810
|
+
*
|
|
5811
|
+
* @example
|
|
5812
|
+
* ```typescript
|
|
5813
|
+
* const statusList = await Walker.list();
|
|
5814
|
+
* statusList.forEach(status => {
|
|
5815
|
+
* console.log(`${status.symbol} - ${status.walkerName}: ${status.status}`);
|
|
5816
|
+
* });
|
|
5817
|
+
* ```
|
|
5818
|
+
*/
|
|
5819
|
+
list: () => Promise<{
|
|
5820
|
+
symbol: string;
|
|
5821
|
+
walkerName: string;
|
|
5822
|
+
status: "pending" | "fulfilled" | "rejected" | "ready";
|
|
5823
|
+
}[]>;
|
|
5755
5824
|
}
|
|
5756
5825
|
/**
|
|
5757
5826
|
* Singleton instance of WalkerUtils for convenient walker operations.
|