backtest-kit 3.3.2 → 3.4.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.mjs CHANGED
@@ -422,6 +422,14 @@ const GLOBAL_CONFIG = {
422
422
  * Default: 50 signals
423
423
  */
424
424
  CC_MAX_SIGNALS: 50,
425
+ /**
426
+ * Maximum number of log lines to keep in storage.
427
+ * Older log lines are removed when this limit is exceeded.
428
+ * This helps prevent unbounded log growth which can consume memory and degrade performance over time.
429
+ *
430
+ * Default: 1000 log lines
431
+ */
432
+ CC_MAX_LOG_LINES: 1000,
425
433
  /**
426
434
  * Enables mutex locking for candle fetching to prevent concurrent fetches of the same candles.
427
435
  * This can help avoid redundant API calls and ensure data consistency when multiple processes/threads attempt to fetch candles simultaneously.
@@ -756,6 +764,11 @@ const PERSIST_NOTIFICATION_UTILS_METHOD_NAME_WRITE_DATA = "PersistNotificationUt
756
764
  const PERSIST_NOTIFICATION_UTILS_METHOD_NAME_USE_JSON = "PersistNotificationUtils.useJson";
757
765
  const PERSIST_NOTIFICATION_UTILS_METHOD_NAME_USE_DUMMY = "PersistNotificationUtils.useDummy";
758
766
  const PERSIST_NOTIFICATION_UTILS_METHOD_NAME_USE_PERSIST_NOTIFICATION_ADAPTER = "PersistNotificationUtils.usePersistNotificationAdapter";
767
+ const PERSIST_LOG_UTILS_METHOD_NAME_READ_DATA = "PersistLogUtils.readLogData";
768
+ const PERSIST_LOG_UTILS_METHOD_NAME_WRITE_DATA = "PersistLogUtils.writeLogData";
769
+ const PERSIST_LOG_UTILS_METHOD_NAME_USE_JSON = "PersistLogUtils.useJson";
770
+ const PERSIST_LOG_UTILS_METHOD_NAME_USE_DUMMY = "PersistLogUtils.useDummy";
771
+ const PERSIST_LOG_UTILS_METHOD_NAME_USE_PERSIST_LOG_ADAPTER = "PersistLogUtils.usePersistLogAdapter";
759
772
  const BASE_WAIT_FOR_INIT_FN_METHOD_NAME = "PersistBase.waitForInitFn";
760
773
  const BASE_UNLINK_RETRY_COUNT = 5;
761
774
  const BASE_UNLINK_RETRY_DELAY = 1000;
@@ -1926,6 +1939,106 @@ class PersistNotificationUtils {
1926
1939
  * Used by NotificationPersistLiveUtils/NotificationPersistBacktestUtils for notification persistence.
1927
1940
  */
1928
1941
  const PersistNotificationAdapter = new PersistNotificationUtils();
1942
+ /**
1943
+ * Utility class for managing log entry persistence.
1944
+ *
1945
+ * Features:
1946
+ * - Memoized storage instance
1947
+ * - Custom adapter support
1948
+ * - Atomic read/write operations for LogData
1949
+ * - Each log entry stored as separate file keyed by id
1950
+ * - Crash-safe log state management
1951
+ *
1952
+ * Used by LogPersistUtils for log entry persistence.
1953
+ */
1954
+ class PersistLogUtils {
1955
+ constructor() {
1956
+ this.PersistLogFactory = PersistBase;
1957
+ this._logStorage = null;
1958
+ /**
1959
+ * Reads persisted log entries.
1960
+ *
1961
+ * Called by LogPersistUtils.waitForInit() to restore state.
1962
+ * Uses keys() from PersistBase to iterate over all stored entries.
1963
+ * Returns empty array if no entries exist.
1964
+ *
1965
+ * @returns Promise resolving to array of log entries
1966
+ */
1967
+ this.readLogData = async () => {
1968
+ bt.loggerService.info(PERSIST_LOG_UTILS_METHOD_NAME_READ_DATA);
1969
+ const isInitial = !this._logStorage;
1970
+ const stateStorage = this.getLogStorage();
1971
+ await stateStorage.waitForInit(isInitial);
1972
+ const entries = [];
1973
+ for await (const entryId of stateStorage.keys()) {
1974
+ const entry = await stateStorage.readValue(entryId);
1975
+ entries.push(entry);
1976
+ }
1977
+ return entries;
1978
+ };
1979
+ /**
1980
+ * Writes log entries to disk with atomic file writes.
1981
+ *
1982
+ * Called by LogPersistUtils after each log call to persist state.
1983
+ * Uses entry.id as the storage key for individual file storage.
1984
+ * Uses atomic writes to prevent corruption on crashes.
1985
+ *
1986
+ * @param logData - Log entries to persist
1987
+ * @returns Promise that resolves when write is complete
1988
+ */
1989
+ this.writeLogData = async (logData) => {
1990
+ bt.loggerService.info(PERSIST_LOG_UTILS_METHOD_NAME_WRITE_DATA);
1991
+ const isInitial = !this._logStorage;
1992
+ const stateStorage = this.getLogStorage();
1993
+ await stateStorage.waitForInit(isInitial);
1994
+ for (const entry of logData) {
1995
+ if (await stateStorage.hasValue(entry.id)) {
1996
+ continue;
1997
+ }
1998
+ await stateStorage.writeValue(entry.id, entry);
1999
+ }
2000
+ };
2001
+ }
2002
+ getLogStorage() {
2003
+ if (!this._logStorage) {
2004
+ this._logStorage = Reflect.construct(this.PersistLogFactory, [
2005
+ `log`,
2006
+ `./dump/data/log/`,
2007
+ ]);
2008
+ }
2009
+ return this._logStorage;
2010
+ }
2011
+ /**
2012
+ * Registers a custom persistence adapter.
2013
+ *
2014
+ * @param Ctor - Custom PersistBase constructor
2015
+ */
2016
+ usePersistLogAdapter(Ctor) {
2017
+ bt.loggerService.info(PERSIST_LOG_UTILS_METHOD_NAME_USE_PERSIST_LOG_ADAPTER);
2018
+ this.PersistLogFactory = Ctor;
2019
+ }
2020
+ /**
2021
+ * Switches to the default JSON persist adapter.
2022
+ * All future persistence writes will use JSON storage.
2023
+ */
2024
+ useJson() {
2025
+ bt.loggerService.log(PERSIST_LOG_UTILS_METHOD_NAME_USE_JSON);
2026
+ this.usePersistLogAdapter(PersistBase);
2027
+ }
2028
+ /**
2029
+ * Switches to a dummy persist adapter that discards all writes.
2030
+ * All future persistence writes will be no-ops.
2031
+ */
2032
+ useDummy() {
2033
+ bt.loggerService.log(PERSIST_LOG_UTILS_METHOD_NAME_USE_DUMMY);
2034
+ this.usePersistLogAdapter(PersistDummy);
2035
+ }
2036
+ }
2037
+ /**
2038
+ * Global singleton instance of PersistLogUtils.
2039
+ * Used by LogPersistUtils for log entry persistence.
2040
+ */
2041
+ const PersistLogAdapter = new PersistLogUtils();
1929
2042
 
1930
2043
  var _a$2, _b$2;
1931
2044
  const BUSY_DELAY = 100;
@@ -30862,6 +30975,416 @@ async function dumpMessages(resultId, history, result, outputDir = "./dump/strat
30862
30975
  }
30863
30976
  }
30864
30977
 
30978
+ const LOG_PERSIST_METHOD_NAME_WAIT_FOR_INIT = "LogPersistUtils.waitForInit";
30979
+ const LOG_PERSIST_METHOD_NAME_LOG = "LogPersistUtils.log";
30980
+ const LOG_PERSIST_METHOD_NAME_DEBUG = "LogPersistUtils.debug";
30981
+ const LOG_PERSIST_METHOD_NAME_INFO = "LogPersistUtils.info";
30982
+ const LOG_PERSIST_METHOD_NAME_WARN = "LogPersistUtils.warn";
30983
+ const LOG_PERSIST_METHOD_NAME_GET_LIST = "LogPersistUtils.getList";
30984
+ const LOG_MEMORY_METHOD_NAME_LOG = "LogMemoryUtils.log";
30985
+ const LOG_MEMORY_METHOD_NAME_DEBUG = "LogMemoryUtils.debug";
30986
+ const LOG_MEMORY_METHOD_NAME_INFO = "LogMemoryUtils.info";
30987
+ const LOG_MEMORY_METHOD_NAME_WARN = "LogMemoryUtils.warn";
30988
+ const LOG_MEMORY_METHOD_NAME_GET_LIST = "LogMemoryUtils.getList";
30989
+ const LOG_ADAPTER_METHOD_NAME_USE_LOGGER = "LogAdapter.useLogger";
30990
+ const LOG_ADAPTER_METHOD_NAME_USE_PERSIST = "LogAdapter.usePersist";
30991
+ const LOG_ADAPTER_METHOD_NAME_USE_MEMORY = "LogAdapter.useMemory";
30992
+ const LOG_ADAPTER_METHOD_NAME_USE_DUMMY = "LogAdapter.useDummy";
30993
+ /**
30994
+ * Backtest execution time retrieval function.
30995
+ * Returns the 'when' timestamp from the execution context if available, otherwise returns the current time.
30996
+ * This allows log entries to be timestamped according to the backtest timeline rather than real-world time, improving log relevance and user experience during backtest analysis.
30997
+ */
30998
+ const GET_DATE_FN = async () => {
30999
+ if (ExecutionContextService.hasContext()) {
31000
+ return new Date(bt.executionContextService.context.when);
31001
+ }
31002
+ return new Date();
31003
+ };
31004
+ /**
31005
+ * Persistent log adapter.
31006
+ *
31007
+ * Features:
31008
+ * - Persists log entries to disk using PersistLogAdapter
31009
+ * - Lazy initialization with singleshot pattern
31010
+ * - Maintains up to CC_MAX_LOG_LINES most recent entries
31011
+ * - Each entry stored individually keyed by its id
31012
+ *
31013
+ * Use this adapter (default) for log persistence across sessions.
31014
+ */
31015
+ class LogPersistUtils {
31016
+ constructor() {
31017
+ /** Array of log entries */
31018
+ this._entries = [];
31019
+ /**
31020
+ * Singleshot initialization function that loads entries from disk.
31021
+ * Protected by singleshot to ensure one-time execution.
31022
+ */
31023
+ this.waitForInit = singleshot(async () => {
31024
+ bt.loggerService.info(LOG_PERSIST_METHOD_NAME_WAIT_FOR_INIT);
31025
+ const list = await PersistLogAdapter.readLogData();
31026
+ list.sort((a, b) => a.timestamp - b.timestamp);
31027
+ this._entries = list.slice(-GLOBAL_CONFIG.CC_MAX_LOG_LINES);
31028
+ });
31029
+ /**
31030
+ * Logs a general-purpose message.
31031
+ * Persists entry to disk after appending.
31032
+ * @param topic - The log topic / method name
31033
+ * @param args - Additional arguments
31034
+ */
31035
+ this.log = async (topic, ...args) => {
31036
+ bt.loggerService.info(LOG_PERSIST_METHOD_NAME_LOG, { topic });
31037
+ await this.waitForInit();
31038
+ const date = await GET_DATE_FN();
31039
+ this._entries.push({
31040
+ id: randomString(),
31041
+ type: "log",
31042
+ timestamp: Date.now(),
31043
+ createdAt: date.toISOString(),
31044
+ topic,
31045
+ args,
31046
+ });
31047
+ this._enforceLimit();
31048
+ await PersistLogAdapter.writeLogData(this._entries);
31049
+ };
31050
+ /**
31051
+ * Logs a debug-level message.
31052
+ * Persists entry to disk after appending.
31053
+ * @param topic - The log topic / method name
31054
+ * @param args - Additional arguments
31055
+ */
31056
+ this.debug = async (topic, ...args) => {
31057
+ bt.loggerService.info(LOG_PERSIST_METHOD_NAME_DEBUG, { topic });
31058
+ await this.waitForInit();
31059
+ const date = await GET_DATE_FN();
31060
+ this._entries.push({
31061
+ id: randomString(),
31062
+ type: "debug",
31063
+ timestamp: Date.now(),
31064
+ createdAt: date.toISOString(),
31065
+ topic,
31066
+ args,
31067
+ });
31068
+ this._enforceLimit();
31069
+ await PersistLogAdapter.writeLogData(this._entries);
31070
+ };
31071
+ /**
31072
+ * Logs an info-level message.
31073
+ * Persists entry to disk after appending.
31074
+ * @param topic - The log topic / method name
31075
+ * @param args - Additional arguments
31076
+ */
31077
+ this.info = async (topic, ...args) => {
31078
+ bt.loggerService.info(LOG_PERSIST_METHOD_NAME_INFO, { topic });
31079
+ await this.waitForInit();
31080
+ const date = await GET_DATE_FN();
31081
+ this._entries.push({
31082
+ id: randomString(),
31083
+ type: "info",
31084
+ timestamp: Date.now(),
31085
+ createdAt: date.toISOString(),
31086
+ topic,
31087
+ args,
31088
+ });
31089
+ this._enforceLimit();
31090
+ await PersistLogAdapter.writeLogData(this._entries);
31091
+ };
31092
+ /**
31093
+ * Logs a warning-level message.
31094
+ * Persists entry to disk after appending.
31095
+ * @param topic - The log topic / method name
31096
+ * @param args - Additional arguments
31097
+ */
31098
+ this.warn = async (topic, ...args) => {
31099
+ bt.loggerService.info(LOG_PERSIST_METHOD_NAME_WARN, { topic });
31100
+ await this.waitForInit();
31101
+ const date = await GET_DATE_FN();
31102
+ this._entries.push({
31103
+ id: randomString(),
31104
+ type: "warn",
31105
+ timestamp: Date.now(),
31106
+ createdAt: date.toISOString(),
31107
+ topic,
31108
+ args,
31109
+ });
31110
+ this._enforceLimit();
31111
+ await PersistLogAdapter.writeLogData(this._entries);
31112
+ };
31113
+ /**
31114
+ * Lists all stored log entries.
31115
+ * @returns Array of all log entries
31116
+ */
31117
+ this.getList = async () => {
31118
+ bt.loggerService.info(LOG_PERSIST_METHOD_NAME_GET_LIST);
31119
+ await this.waitForInit();
31120
+ return [...this._entries];
31121
+ };
31122
+ }
31123
+ /**
31124
+ * Removes oldest entries if limit is exceeded.
31125
+ */
31126
+ _enforceLimit() {
31127
+ if (this._entries.length > GLOBAL_CONFIG.CC_MAX_LOG_LINES) {
31128
+ this._entries.splice(0, this._entries.length - GLOBAL_CONFIG.CC_MAX_LOG_LINES);
31129
+ }
31130
+ }
31131
+ }
31132
+ /**
31133
+ * In-memory log adapter.
31134
+ *
31135
+ * Features:
31136
+ * - Stores log entries in memory only (no persistence)
31137
+ * - Maintains up to CC_MAX_LOG_LINES most recent entries
31138
+ * - Data is lost when application restarts
31139
+ * - Handles all log levels (log, debug, info, warn)
31140
+ *
31141
+ * Use this adapter for testing or when persistence is not required.
31142
+ */
31143
+ class LogMemoryUtils {
31144
+ constructor() {
31145
+ /** Array of log entries */
31146
+ this._entries = [];
31147
+ /**
31148
+ * Logs a general-purpose message.
31149
+ * Appends entry to in-memory array.
31150
+ * @param topic - The log topic / method name
31151
+ * @param args - Additional arguments
31152
+ */
31153
+ this.log = async (topic, ...args) => {
31154
+ bt.loggerService.info(LOG_MEMORY_METHOD_NAME_LOG, { topic });
31155
+ const date = await GET_DATE_FN();
31156
+ this._entries.push({
31157
+ id: randomString(),
31158
+ type: "log",
31159
+ timestamp: Date.now(),
31160
+ createdAt: date.toISOString(),
31161
+ topic,
31162
+ args,
31163
+ });
31164
+ this._enforceLimit();
31165
+ };
31166
+ /**
31167
+ * Logs a debug-level message.
31168
+ * Appends entry to in-memory array.
31169
+ * @param topic - The log topic / method name
31170
+ * @param args - Additional arguments
31171
+ */
31172
+ this.debug = async (topic, ...args) => {
31173
+ bt.loggerService.info(LOG_MEMORY_METHOD_NAME_DEBUG, { topic });
31174
+ const date = await GET_DATE_FN();
31175
+ this._entries.push({
31176
+ id: randomString(),
31177
+ type: "debug",
31178
+ timestamp: Date.now(),
31179
+ createdAt: date.toISOString(),
31180
+ topic,
31181
+ args,
31182
+ });
31183
+ this._enforceLimit();
31184
+ };
31185
+ /**
31186
+ * Logs an info-level message.
31187
+ * Appends entry to in-memory array.
31188
+ * @param topic - The log topic / method name
31189
+ * @param args - Additional arguments
31190
+ */
31191
+ this.info = async (topic, ...args) => {
31192
+ bt.loggerService.info(LOG_MEMORY_METHOD_NAME_INFO, { topic });
31193
+ const date = await GET_DATE_FN();
31194
+ this._entries.push({
31195
+ id: randomString(),
31196
+ type: "info",
31197
+ timestamp: Date.now(),
31198
+ createdAt: date.toISOString(),
31199
+ topic,
31200
+ args,
31201
+ });
31202
+ this._enforceLimit();
31203
+ };
31204
+ /**
31205
+ * Logs a warning-level message.
31206
+ * Appends entry to in-memory array.
31207
+ * @param topic - The log topic / method name
31208
+ * @param args - Additional arguments
31209
+ */
31210
+ this.warn = async (topic, ...args) => {
31211
+ bt.loggerService.info(LOG_MEMORY_METHOD_NAME_WARN, { topic });
31212
+ const date = await GET_DATE_FN();
31213
+ this._entries.push({
31214
+ id: randomString(),
31215
+ type: "warn",
31216
+ timestamp: Date.now(),
31217
+ createdAt: date.toISOString(),
31218
+ topic,
31219
+ args,
31220
+ });
31221
+ this._enforceLimit();
31222
+ };
31223
+ /**
31224
+ * Lists all stored log entries.
31225
+ * @returns Array of all log entries
31226
+ */
31227
+ this.getList = async () => {
31228
+ bt.loggerService.info(LOG_MEMORY_METHOD_NAME_GET_LIST);
31229
+ return [...this._entries];
31230
+ };
31231
+ }
31232
+ /**
31233
+ * Removes oldest entries if limit is exceeded.
31234
+ */
31235
+ _enforceLimit() {
31236
+ if (this._entries.length > GLOBAL_CONFIG.CC_MAX_LOG_LINES) {
31237
+ this._entries.splice(0, this._entries.length - GLOBAL_CONFIG.CC_MAX_LOG_LINES);
31238
+ }
31239
+ }
31240
+ }
31241
+ /**
31242
+ * Dummy log adapter that discards all writes.
31243
+ *
31244
+ * Features:
31245
+ * - No-op implementation for all methods
31246
+ * - getList always returns empty array
31247
+ *
31248
+ * Use this adapter to disable log storage completely.
31249
+ */
31250
+ class LogDummyUtils {
31251
+ /**
31252
+ * Always returns empty array (no storage).
31253
+ * @returns Empty array
31254
+ */
31255
+ async getList() {
31256
+ return [];
31257
+ }
31258
+ /**
31259
+ * No-op handler for general-purpose log.
31260
+ */
31261
+ log() {
31262
+ }
31263
+ /**
31264
+ * No-op handler for debug-level log.
31265
+ */
31266
+ debug() {
31267
+ }
31268
+ /**
31269
+ * No-op handler for info-level log.
31270
+ */
31271
+ info() {
31272
+ }
31273
+ /**
31274
+ * No-op handler for warning-level log.
31275
+ */
31276
+ warn() {
31277
+ }
31278
+ }
31279
+ /**
31280
+ * Log adapter with pluggable storage backend.
31281
+ *
31282
+ * Features:
31283
+ * - Adapter pattern for swappable log implementations
31284
+ * - Default adapter: LogMemoryUtils (in-memory storage)
31285
+ * - Alternative adapters: LogPersistUtils, LogDummyUtils
31286
+ * - Convenience methods: usePersist(), useMemory(), useDummy()
31287
+ */
31288
+ class LogAdapter {
31289
+ constructor() {
31290
+ /** Internal log utils instance */
31291
+ this._log = new LogMemoryUtils();
31292
+ /**
31293
+ * Lists all stored log entries.
31294
+ * Proxies call to the underlying log adapter.
31295
+ * @returns Array of all log entries
31296
+ */
31297
+ this.getList = async () => {
31298
+ if (this._log.getList) {
31299
+ return await this._log.getList();
31300
+ }
31301
+ return [];
31302
+ };
31303
+ /**
31304
+ * Logs a general-purpose message.
31305
+ * Proxies call to the underlying log adapter.
31306
+ * @param topic - The log topic / method name
31307
+ * @param args - Additional arguments
31308
+ */
31309
+ this.log = (topic, ...args) => {
31310
+ if (this._log.log) {
31311
+ this._log.log(topic, ...args);
31312
+ }
31313
+ };
31314
+ /**
31315
+ * Logs a debug-level message.
31316
+ * Proxies call to the underlying log adapter.
31317
+ * @param topic - The log topic / method name
31318
+ * @param args - Additional arguments
31319
+ */
31320
+ this.debug = (topic, ...args) => {
31321
+ if (this._log.debug) {
31322
+ this._log.debug(topic, ...args);
31323
+ }
31324
+ };
31325
+ /**
31326
+ * Logs an info-level message.
31327
+ * Proxies call to the underlying log adapter.
31328
+ * @param topic - The log topic / method name
31329
+ * @param args - Additional arguments
31330
+ */
31331
+ this.info = (topic, ...args) => {
31332
+ if (this._log.info) {
31333
+ this._log.info(topic, ...args);
31334
+ }
31335
+ };
31336
+ /**
31337
+ * Logs a warning-level message.
31338
+ * Proxies call to the underlying log adapter.
31339
+ * @param topic - The log topic / method name
31340
+ * @param args - Additional arguments
31341
+ */
31342
+ this.warn = (topic, ...args) => {
31343
+ if (this._log.warn) {
31344
+ this._log.warn(topic, ...args);
31345
+ }
31346
+ };
31347
+ /**
31348
+ * Sets the log adapter constructor.
31349
+ * All future log operations will use this adapter.
31350
+ * @param Ctor - Constructor for log adapter
31351
+ */
31352
+ this.useLogger = (Ctor) => {
31353
+ bt.loggerService.info(LOG_ADAPTER_METHOD_NAME_USE_LOGGER);
31354
+ this._log = Reflect.construct(Ctor, []);
31355
+ };
31356
+ /**
31357
+ * Switches to persistent log adapter.
31358
+ * Log entries will be persisted to disk.
31359
+ */
31360
+ this.usePersist = () => {
31361
+ bt.loggerService.info(LOG_ADAPTER_METHOD_NAME_USE_PERSIST);
31362
+ this._log = new LogPersistUtils();
31363
+ };
31364
+ /**
31365
+ * Switches to in-memory log adapter (default).
31366
+ * Log entries will be stored in memory only.
31367
+ */
31368
+ this.useMemory = () => {
31369
+ bt.loggerService.info(LOG_ADAPTER_METHOD_NAME_USE_MEMORY);
31370
+ this._log = new LogMemoryUtils();
31371
+ };
31372
+ /**
31373
+ * Switches to dummy log adapter.
31374
+ * All future log writes will be no-ops.
31375
+ */
31376
+ this.useDummy = () => {
31377
+ bt.loggerService.info(LOG_ADAPTER_METHOD_NAME_USE_DUMMY);
31378
+ this._log = new LogDummyUtils();
31379
+ };
31380
+ }
31381
+ }
31382
+ /**
31383
+ * Global singleton instance of LogAdapter.
31384
+ * Provides unified log management with pluggable backends.
31385
+ */
31386
+ const Log = new LogAdapter();
31387
+
30865
31388
  const BACKTEST_METHOD_NAME_RUN = "BacktestUtils.run";
30866
31389
  const BACKTEST_METHOD_NAME_BACKGROUND = "BacktestUtils.background";
30867
31390
  const BACKTEST_METHOD_NAME_STOP = "BacktestUtils.stop";
@@ -38260,4 +38783,4 @@ const set = (object, path, value) => {
38260
38783
  }
38261
38784
  };
38262
38785
 
38263
- export { ActionBase, Backtest, Breakeven, Cache, Constant, Exchange, ExecutionContextService, Heat, Live, Markdown, MarkdownFileBase, MarkdownFolderBase, MethodContextService, Notification, NotificationBacktest, NotificationLive, Partial, Performance, PersistBase, PersistBreakevenAdapter, PersistCandleAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PersistStorageAdapter, PositionSize, Report, ReportBase, Risk, Schedule, Storage, StorageBacktest, StorageLive, Strategy, Walker, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialProfit, commitTrailingStop, commitTrailingTake, dumpMessages, emitters, formatPrice, formatQuantity, get, getActionSchema, getAveragePrice, getBacktestTimeframe, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getExchangeSchema, getFrameSchema, getMode, getNextCandles, getOrderBook, getRawCandles, getRiskSchema, getSizingSchema, getStrategySchema, getSymbol, getWalkerSchema, hasTradeContext, backtest as lib, listExchangeSchema, listFrameSchema, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, roundTicks, set, setColumns, setConfig, setLogger, stopStrategy, validate, waitForCandle, warmCandles };
38786
+ export { ActionBase, Backtest, Breakeven, Cache, Constant, Exchange, ExecutionContextService, Heat, Live, Log, Markdown, MarkdownFileBase, MarkdownFolderBase, MethodContextService, Notification, NotificationBacktest, NotificationLive, Partial, Performance, PersistBase, PersistBreakevenAdapter, PersistCandleAdapter, PersistLogAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PersistStorageAdapter, PositionSize, Report, ReportBase, Risk, Schedule, Storage, StorageBacktest, StorageLive, Strategy, Walker, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialProfit, commitTrailingStop, commitTrailingTake, dumpMessages, emitters, formatPrice, formatQuantity, get, getActionSchema, getAveragePrice, getBacktestTimeframe, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getExchangeSchema, getFrameSchema, getMode, getNextCandles, getOrderBook, getRawCandles, getRiskSchema, getSizingSchema, getStrategySchema, getSymbol, getWalkerSchema, hasTradeContext, backtest as lib, listExchangeSchema, listFrameSchema, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, roundTicks, set, setColumns, setConfig, setLogger, stopStrategy, validate, waitForCandle, warmCandles };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "3.3.2",
3
+ "version": "3.4.1",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
@@ -74,10 +74,10 @@
74
74
  "typescript": "^5.0.0"
75
75
  },
76
76
  "dependencies": {
77
- "di-kit": "^1.0.18",
77
+ "di-kit": "^1.1.1",
78
78
  "di-scoped": "^1.0.21",
79
79
  "functools-kit": "^1.0.95",
80
- "get-moment-stamp": "^1.1.1"
80
+ "get-moment-stamp": "^1.1.2"
81
81
  },
82
82
  "publishConfig": {
83
83
  "access": "public"