backtest-kit 9.8.0 → 9.8.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.
- package/build/index.cjs +263 -129
- package/build/index.mjs +263 -129
- package/package.json +1 -1
- package/types.d.ts +95 -22
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -16682,8 +16682,17 @@ type TLogCtor = new () => Partial<ILog>;
|
|
|
16682
16682
|
* - Convenience methods: usePersist(), useMemory(), useDummy()
|
|
16683
16683
|
*/
|
|
16684
16684
|
declare class LogAdapter implements ILog {
|
|
16685
|
-
/**
|
|
16686
|
-
private
|
|
16685
|
+
/** Factory producing the active log utils instance */
|
|
16686
|
+
private _logFactory;
|
|
16687
|
+
/**
|
|
16688
|
+
* Lazily constructs the log utils from the registered factory and memoizes
|
|
16689
|
+
* the result via `singleshot`.
|
|
16690
|
+
*
|
|
16691
|
+
* The instance is built on the first call and cached for all subsequent calls.
|
|
16692
|
+
* Reset via `clear()` so the next call rebuilds from the current factory
|
|
16693
|
+
* (e.g. when `process.cwd()` changes between strategy iterations).
|
|
16694
|
+
*/
|
|
16695
|
+
private getInstance;
|
|
16687
16696
|
/**
|
|
16688
16697
|
* Lists all stored log entries.
|
|
16689
16698
|
* Proxies call to the underlying log adapter.
|
|
@@ -16749,7 +16758,7 @@ declare class LogAdapter implements ILog {
|
|
|
16749
16758
|
*/
|
|
16750
16759
|
useJsonl: (fileName?: string, dirName?: string) => void;
|
|
16751
16760
|
/**
|
|
16752
|
-
* Clears the
|
|
16761
|
+
* Clears the memoized log instance.
|
|
16753
16762
|
* Call this when process.cwd() changes between strategy iterations
|
|
16754
16763
|
* so a new adapter instance is created with the updated base path.
|
|
16755
16764
|
*/
|
|
@@ -23668,8 +23677,16 @@ type TStorageUtilsCtor = new () => IStorageUtils;
|
|
|
23668
23677
|
* - Convenience methods: usePersist(), useMemory(), useDummy()
|
|
23669
23678
|
*/
|
|
23670
23679
|
declare class StorageBacktestAdapter implements IStorageUtils {
|
|
23671
|
-
/**
|
|
23672
|
-
private
|
|
23680
|
+
/** Factory producing the active storage utils instance */
|
|
23681
|
+
private _signalBacktestFactory;
|
|
23682
|
+
/**
|
|
23683
|
+
* Lazily constructs the storage utils from the registered factory and memoizes
|
|
23684
|
+
* the result via `singleshot`.
|
|
23685
|
+
*
|
|
23686
|
+
* The instance is built on the first call and cached for all subsequent calls.
|
|
23687
|
+
* Reset via `clear()` so the next call rebuilds from the current factory.
|
|
23688
|
+
*/
|
|
23689
|
+
private getInstance;
|
|
23673
23690
|
/**
|
|
23674
23691
|
* Handles signal opened event.
|
|
23675
23692
|
* Proxies call to the underlying storage adapter.
|
|
@@ -23732,7 +23749,7 @@ declare class StorageBacktestAdapter implements IStorageUtils {
|
|
|
23732
23749
|
*/
|
|
23733
23750
|
useMemory: () => void;
|
|
23734
23751
|
/**
|
|
23735
|
-
* Clears the
|
|
23752
|
+
* Clears the memoized utils instance.
|
|
23736
23753
|
* Call this when process.cwd() changes between strategy iterations
|
|
23737
23754
|
* so a new instance is created with the updated base path.
|
|
23738
23755
|
*/
|
|
@@ -23748,8 +23765,16 @@ declare class StorageBacktestAdapter implements IStorageUtils {
|
|
|
23748
23765
|
* - Convenience methods: usePersist(), useMemory(), useDummy()
|
|
23749
23766
|
*/
|
|
23750
23767
|
declare class StorageLiveAdapter implements IStorageUtils {
|
|
23751
|
-
/**
|
|
23752
|
-
private
|
|
23768
|
+
/** Factory producing the active storage utils instance */
|
|
23769
|
+
private _signalLiveFactory;
|
|
23770
|
+
/**
|
|
23771
|
+
* Lazily constructs the storage utils from the registered factory and memoizes
|
|
23772
|
+
* the result via `singleshot`.
|
|
23773
|
+
*
|
|
23774
|
+
* The instance is built on the first call and cached for all subsequent calls.
|
|
23775
|
+
* Reset via `clear()` so the next call rebuilds from the current factory.
|
|
23776
|
+
*/
|
|
23777
|
+
private getInstance;
|
|
23753
23778
|
/**
|
|
23754
23779
|
* Handles signal opened event.
|
|
23755
23780
|
* Proxies call to the underlying storage adapter.
|
|
@@ -23812,7 +23837,7 @@ declare class StorageLiveAdapter implements IStorageUtils {
|
|
|
23812
23837
|
*/
|
|
23813
23838
|
useMemory: () => void;
|
|
23814
23839
|
/**
|
|
23815
|
-
* Clears the
|
|
23840
|
+
* Clears the memoized utils instance.
|
|
23816
23841
|
* Call this when process.cwd() changes between strategy iterations
|
|
23817
23842
|
* so a new instance is created with the updated base path.
|
|
23818
23843
|
*/
|
|
@@ -23930,8 +23955,16 @@ type TRecentUtilsCtor = new () => IRecentUtils;
|
|
|
23930
23955
|
* - Convenience methods: usePersist(), useMemory()
|
|
23931
23956
|
*/
|
|
23932
23957
|
declare class RecentBacktestAdapter implements IRecentUtils {
|
|
23933
|
-
/**
|
|
23934
|
-
private
|
|
23958
|
+
/** Factory producing the active storage utils instance */
|
|
23959
|
+
private _recentBacktestFactory;
|
|
23960
|
+
/**
|
|
23961
|
+
* Lazily constructs the storage utils from the registered factory and memoizes
|
|
23962
|
+
* the result via `singleshot`.
|
|
23963
|
+
*
|
|
23964
|
+
* The instance is built on the first call and cached for all subsequent calls.
|
|
23965
|
+
* Reset via `clear()` so the next call rebuilds from the current factory.
|
|
23966
|
+
*/
|
|
23967
|
+
private getInstance;
|
|
23935
23968
|
/**
|
|
23936
23969
|
* Handles active ping event.
|
|
23937
23970
|
* Proxies call to the underlying storage adapter.
|
|
@@ -23981,7 +24014,9 @@ declare class RecentBacktestAdapter implements IRecentUtils {
|
|
|
23981
24014
|
*/
|
|
23982
24015
|
useMemory: () => void;
|
|
23983
24016
|
/**
|
|
23984
|
-
* Clears the
|
|
24017
|
+
* Clears the memoized utils instance.
|
|
24018
|
+
* Call this when process.cwd() changes between strategy iterations
|
|
24019
|
+
* so a new instance is created with the updated base path.
|
|
23985
24020
|
*/
|
|
23986
24021
|
clear: () => void;
|
|
23987
24022
|
}
|
|
@@ -23995,8 +24030,16 @@ declare class RecentBacktestAdapter implements IRecentUtils {
|
|
|
23995
24030
|
* - Convenience methods: usePersist(), useMemory()
|
|
23996
24031
|
*/
|
|
23997
24032
|
declare class RecentLiveAdapter implements IRecentUtils {
|
|
23998
|
-
/**
|
|
23999
|
-
private
|
|
24033
|
+
/** Factory producing the active storage utils instance */
|
|
24034
|
+
private _recentLiveFactory;
|
|
24035
|
+
/**
|
|
24036
|
+
* Lazily constructs the storage utils from the registered factory and memoizes
|
|
24037
|
+
* the result via `singleshot`.
|
|
24038
|
+
*
|
|
24039
|
+
* The instance is built on the first call and cached for all subsequent calls.
|
|
24040
|
+
* Reset via `clear()` so the next call rebuilds from the current factory.
|
|
24041
|
+
*/
|
|
24042
|
+
private getInstance;
|
|
24000
24043
|
/**
|
|
24001
24044
|
* Handles active ping event.
|
|
24002
24045
|
* Proxies call to the underlying storage adapter.
|
|
@@ -24046,7 +24089,9 @@ declare class RecentLiveAdapter implements IRecentUtils {
|
|
|
24046
24089
|
*/
|
|
24047
24090
|
useMemory: () => void;
|
|
24048
24091
|
/**
|
|
24049
|
-
* Clears the
|
|
24092
|
+
* Clears the memoized utils instance.
|
|
24093
|
+
* Call this when process.cwd() changes between strategy iterations
|
|
24094
|
+
* so a new instance is created with the updated base path.
|
|
24050
24095
|
*/
|
|
24051
24096
|
clear: () => void;
|
|
24052
24097
|
}
|
|
@@ -24292,8 +24337,16 @@ type TNotificationUtilsCtor = new () => INotificationUtils;
|
|
|
24292
24337
|
* - Convenience methods: usePersist(), useMemory(), useDummy()
|
|
24293
24338
|
*/
|
|
24294
24339
|
declare class NotificationBacktestAdapter implements INotificationUtils {
|
|
24295
|
-
/**
|
|
24296
|
-
private
|
|
24340
|
+
/** Factory producing the active notification utils instance */
|
|
24341
|
+
private _notificationBacktestFactory;
|
|
24342
|
+
/**
|
|
24343
|
+
* Lazily constructs the notification utils from the registered factory and
|
|
24344
|
+
* memoizes the result via `singleshot`.
|
|
24345
|
+
*
|
|
24346
|
+
* The instance is built on the first call and cached for all subsequent calls.
|
|
24347
|
+
* Reset via `clear()` so the next call rebuilds from the current factory.
|
|
24348
|
+
*/
|
|
24349
|
+
private getInstance;
|
|
24297
24350
|
/**
|
|
24298
24351
|
* Handles signal events.
|
|
24299
24352
|
* Proxies call to the underlying notification adapter.
|
|
@@ -24389,7 +24442,7 @@ declare class NotificationBacktestAdapter implements INotificationUtils {
|
|
|
24389
24442
|
*/
|
|
24390
24443
|
usePersist: () => void;
|
|
24391
24444
|
/**
|
|
24392
|
-
*
|
|
24445
|
+
* Clears the memoized utils instance.
|
|
24393
24446
|
* Call this when process.cwd() changes between strategy iterations
|
|
24394
24447
|
* so a new instance is created with the updated base path.
|
|
24395
24448
|
*/
|
|
@@ -24405,8 +24458,16 @@ declare class NotificationBacktestAdapter implements INotificationUtils {
|
|
|
24405
24458
|
* - Convenience methods: usePersist(), useMemory(), useDummy()
|
|
24406
24459
|
*/
|
|
24407
24460
|
declare class NotificationLiveAdapter implements INotificationUtils {
|
|
24408
|
-
/**
|
|
24409
|
-
private
|
|
24461
|
+
/** Factory producing the active notification utils instance */
|
|
24462
|
+
private _notificationLiveFactory;
|
|
24463
|
+
/**
|
|
24464
|
+
* Lazily constructs the notification utils from the registered factory and
|
|
24465
|
+
* memoizes the result via `singleshot`.
|
|
24466
|
+
*
|
|
24467
|
+
* The instance is built on the first call and cached for all subsequent calls.
|
|
24468
|
+
* Reset via `clear()` so the next call rebuilds from the current factory.
|
|
24469
|
+
*/
|
|
24470
|
+
private getInstance;
|
|
24410
24471
|
/**
|
|
24411
24472
|
* Handles signal events.
|
|
24412
24473
|
* Proxies call to the underlying notification adapter.
|
|
@@ -24502,7 +24563,7 @@ declare class NotificationLiveAdapter implements INotificationUtils {
|
|
|
24502
24563
|
*/
|
|
24503
24564
|
usePersist: () => void;
|
|
24504
24565
|
/**
|
|
24505
|
-
*
|
|
24566
|
+
* Clears the memoized utils instance.
|
|
24506
24567
|
* Call this when process.cwd() changes between strategy iterations
|
|
24507
24568
|
* so a new instance is created with the updated base path.
|
|
24508
24569
|
*/
|
|
@@ -27476,7 +27537,19 @@ type TBrokerCtor = new () => Partial<IBroker>;
|
|
|
27476
27537
|
* ```
|
|
27477
27538
|
*/
|
|
27478
27539
|
declare class BrokerAdapter {
|
|
27479
|
-
|
|
27540
|
+
/** Factory producing the active `BrokerProxy` instance */
|
|
27541
|
+
private _brokerFactory;
|
|
27542
|
+
/**
|
|
27543
|
+
* Lazily constructs the `BrokerProxy` from the registered factory and
|
|
27544
|
+
* memoizes the result via `singleshot`.
|
|
27545
|
+
*
|
|
27546
|
+
* The proxy is built on the first call and cached for all subsequent calls.
|
|
27547
|
+
* Returns `null` when no adapter has been registered via `useBrokerAdapter()`.
|
|
27548
|
+
*
|
|
27549
|
+
* Reset via `clear()` so the next call rebuilds from the current factory
|
|
27550
|
+
* (e.g. when `process.cwd()` changes between strategy iterations).
|
|
27551
|
+
*/
|
|
27552
|
+
private getInstance;
|
|
27480
27553
|
/**
|
|
27481
27554
|
* Forwards a signal-open event to the registered broker adapter.
|
|
27482
27555
|
*
|