backtest-kit 6.8.0 → 6.9.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "6.8.0",
3
+ "version": "6.9.0",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -2173,6 +2173,14 @@ interface ISignalDto {
2173
2173
  /** Cost of this entry in USD. Default: GLOBAL_CONFIG.CC_POSITION_ENTRY_COST */
2174
2174
  cost?: number;
2175
2175
  }
2176
+ /**
2177
+ * Signal dto for IntervalUtils.fn which allows returning multiple signals in one getSignal call.
2178
+ * This will pause the next signal untill interval elapses
2179
+ */
2180
+ interface ISignalIntervalDto extends ISignalDto {
2181
+ /** Unique signal identifier (UUID v4 auto-generated) */
2182
+ id: string;
2183
+ }
2176
2184
  /**
2177
2185
  * Complete signal with auto-generated id.
2178
2186
  * Used throughout the system after validation.
@@ -11070,6 +11078,15 @@ type SignalData = ISignalRow | null;
11070
11078
  type MeasureData = {
11071
11079
  id: string;
11072
11080
  data: unknown;
11081
+ removed: boolean;
11082
+ };
11083
+ /**
11084
+ * Interval.file data type stored in persistence layer.
11085
+ */
11086
+ type IntervalData = {
11087
+ id: string;
11088
+ data: unknown;
11089
+ removed: boolean;
11073
11090
  };
11074
11091
  /**
11075
11092
  * Type helper for PersistBase instance.
@@ -12033,6 +12050,23 @@ declare class PersistMeasureUtils {
12033
12050
  * @returns Promise that resolves when write is complete
12034
12051
  */
12035
12052
  writeMeasureData: (data: MeasureData, bucket: string, key: string) => Promise<void>;
12053
+ /**
12054
+ * Marks a cached entry as removed (soft delete — file is kept on disk).
12055
+ * After this call `readMeasureData` for the same key returns `null`.
12056
+ *
12057
+ * @param bucket - Storage bucket
12058
+ * @param key - Dynamic cache key within the bucket
12059
+ * @returns Promise that resolves when removal is complete
12060
+ */
12061
+ removeMeasureData: (bucket: string, key: string) => Promise<void>;
12062
+ /**
12063
+ * Async generator yielding all non-removed entity keys for a given bucket.
12064
+ * Used by `CacheFileInstance.clear()` to iterate and soft-delete all entries.
12065
+ *
12066
+ * @param bucket - Storage bucket
12067
+ * @returns AsyncGenerator yielding entity keys
12068
+ */
12069
+ listMeasureData(bucket: string): AsyncGenerator<string>;
12036
12070
  /**
12037
12071
  * Clears the memoized storage cache.
12038
12072
  * Call this when process.cwd() changes between strategy iterations
@@ -12053,6 +12087,76 @@ declare class PersistMeasureUtils {
12053
12087
  * Used by Cache.file for persistent caching of external API responses.
12054
12088
  */
12055
12089
  declare const PersistMeasureAdapter: PersistMeasureUtils;
12090
+ /**
12091
+ * Persistence layer for Interval.file once-per-interval signal firing.
12092
+ *
12093
+ * Stores fired-interval markers under `./dump/data/interval/`.
12094
+ * A record's presence means the interval has already fired for that bucket+key;
12095
+ * absence means the function has not yet fired (or returned null last time).
12096
+ */
12097
+ declare class PersistIntervalUtils {
12098
+ private PersistIntervalFactory;
12099
+ private getIntervalStorage;
12100
+ /**
12101
+ * Registers a custom persistence adapter.
12102
+ *
12103
+ * @param Ctor - Custom PersistBase constructor
12104
+ */
12105
+ usePersistIntervalAdapter(Ctor: TPersistBaseCtor<string, IntervalData>): void;
12106
+ /**
12107
+ * Reads interval data for a given bucket and key.
12108
+ *
12109
+ * @param bucket - Storage bucket (instance name + interval + index)
12110
+ * @param key - Entity key within the bucket (symbol + aligned timestamp)
12111
+ * @returns Promise resolving to stored value or null if not found
12112
+ */
12113
+ readIntervalData: (bucket: string, key: string) => Promise<IntervalData | null>;
12114
+ /**
12115
+ * Writes interval data to disk.
12116
+ *
12117
+ * @param data - Data to store
12118
+ * @param bucket - Storage bucket
12119
+ * @param key - Entity key within the bucket
12120
+ * @returns Promise that resolves when write is complete
12121
+ */
12122
+ writeIntervalData: (data: IntervalData, bucket: string, key: string) => Promise<void>;
12123
+ /**
12124
+ * Marks an interval entry as removed (soft delete — file is kept on disk).
12125
+ * After this call `readIntervalData` for the same key returns `null`,
12126
+ * so the function will fire again on the next `IntervalFileInstance.run` call.
12127
+ *
12128
+ * @param bucket - Storage bucket
12129
+ * @param key - Entity key within the bucket
12130
+ * @returns Promise that resolves when removal is complete
12131
+ */
12132
+ removeIntervalData: (bucket: string, key: string) => Promise<void>;
12133
+ /**
12134
+ * Async generator yielding all non-removed entity keys for a given bucket.
12135
+ * Used by `IntervalFileInstance.clear()` to iterate and soft-delete all entries.
12136
+ *
12137
+ * @param bucket - Storage bucket
12138
+ * @returns AsyncGenerator yielding entity keys
12139
+ */
12140
+ listIntervalData(bucket: string): AsyncGenerator<string>;
12141
+ /**
12142
+ * Clears the memoized storage cache.
12143
+ * Call this when process.cwd() changes between strategy iterations.
12144
+ */
12145
+ clear(): void;
12146
+ /**
12147
+ * Switches to the default JSON persist adapter.
12148
+ */
12149
+ useJson(): void;
12150
+ /**
12151
+ * Switches to a dummy persist adapter that discards all writes.
12152
+ */
12153
+ useDummy(): void;
12154
+ }
12155
+ /**
12156
+ * Global singleton instance of PersistIntervalUtils.
12157
+ * Used by Interval.file for persistent once-per-interval signal firing.
12158
+ */
12159
+ declare const PersistIntervalAdapter: PersistIntervalUtils;
12056
12160
  /**
12057
12161
  * Type for persisted memory entry data.
12058
12162
  * Each memory entry is an arbitrary JSON-serializable object.
@@ -12389,6 +12493,73 @@ declare class MarkdownFolderBase implements TMarkdownBase {
12389
12493
  */
12390
12494
  dump(content: string, options: IMarkdownDumpOptions): Promise<void>;
12391
12495
  }
12496
+ /**
12497
+ * Markdown writer with pluggable storage backend and instance memoization.
12498
+ *
12499
+ * Features:
12500
+ * - Adapter pattern for swappable storage implementations (folder, JSONL, dummy)
12501
+ * - Memoized storage instances (one per markdown type)
12502
+ * - Default adapter: MarkdownFolderBase (one .md file per report)
12503
+ * - Lazy initialization on first write
12504
+ *
12505
+ * Use `useMd()` for human-readable folder output, `useJsonl()` for centralized
12506
+ * append-only logging, or `useDummy()` to suppress all markdown output.
12507
+ */
12508
+ declare class MarkdownWriterAdapter {
12509
+ /**
12510
+ * Current markdown storage adapter constructor.
12511
+ * Defaults to MarkdownFolderBase for per-file storage.
12512
+ * Can be changed via useMarkdownAdapter().
12513
+ */
12514
+ private MarkdownFactory;
12515
+ /**
12516
+ * Memoized storage instances cache.
12517
+ * Key: markdownName (backtest, live, walker, etc.)
12518
+ * Value: TMarkdownBase instance created with current MarkdownFactory.
12519
+ * Ensures single instance per markdown type for the lifetime of the application.
12520
+ */
12521
+ private getMarkdownStorage;
12522
+ /**
12523
+ * Sets the markdown storage adapter constructor.
12524
+ * All future markdown instances will use this adapter.
12525
+ *
12526
+ * @param Ctor - Constructor for markdown storage adapter
12527
+ */
12528
+ useMarkdownAdapter(Ctor: TMarkdownBaseCtor): void;
12529
+ /**
12530
+ * Writes markdown content to storage using the configured adapter.
12531
+ * Automatically initializes storage on first write for each markdown type.
12532
+ *
12533
+ * @param markdownName - Type of markdown report (backtest, live, walker, etc.)
12534
+ * @param content - Markdown content to write
12535
+ * @param options - Path and metadata options for the dump
12536
+ * @returns Promise that resolves when write is complete
12537
+ * @throws Error if write fails or storage initialization fails
12538
+ */
12539
+ writeData(markdownName: MarkdownName, content: string, options: IMarkdownDumpOptions): Promise<void>;
12540
+ /**
12541
+ * Switches to the folder-based markdown adapter (default).
12542
+ * Each report is written as a separate .md file.
12543
+ */
12544
+ useMd(): void;
12545
+ /**
12546
+ * Switches to the JSONL markdown adapter.
12547
+ * All reports are appended to a single .jsonl file per markdown type.
12548
+ */
12549
+ useJsonl(): void;
12550
+ /**
12551
+ * Clears the memoized storage cache.
12552
+ * Call this when process.cwd() changes between strategy iterations
12553
+ * so new storage instances are created with the updated base path.
12554
+ */
12555
+ clear(): void;
12556
+ /**
12557
+ * Switches to a dummy markdown adapter that discards all writes.
12558
+ * All future markdown writes will be no-ops.
12559
+ */
12560
+ useDummy(): void;
12561
+ }
12562
+ declare const MarkdownWriter: MarkdownWriterAdapter;
12392
12563
  /**
12393
12564
  * Configuration interface for selective report service enablement.
12394
12565
  * Controls which report services should be activated for JSONL event logging.
@@ -12536,6 +12707,71 @@ declare class ReportBase implements TReportBase {
12536
12707
  */
12537
12708
  write<T = any>(data: T, options: IReportDumpOptions): Promise<void>;
12538
12709
  }
12710
+ /**
12711
+ * Report adapter with pluggable storage backend and instance memoization.
12712
+ *
12713
+ * Features:
12714
+ * - Adapter pattern for swappable storage implementations
12715
+ * - Memoized storage instances (one per report type)
12716
+ * - Default adapter: ReportBase (JSONL append)
12717
+ * - Lazy initialization on first write
12718
+ * - Real-time event logging to JSONL files
12719
+ *
12720
+ * Used for structured event logging and analytics pipelines.
12721
+ */
12722
+ declare class ReportWriterAdapter {
12723
+ /**
12724
+ * Current report storage adapter constructor.
12725
+ * Defaults to ReportBase for JSONL storage.
12726
+ * Can be changed via useReportAdapter().
12727
+ */
12728
+ private ReportFactory;
12729
+ /**
12730
+ * Memoized storage instances cache.
12731
+ * Key: reportName (backtest, live, walker, etc.)
12732
+ * Value: TReportBase instance created with current ReportFactory.
12733
+ * Ensures single instance per report type for the lifetime of the application.
12734
+ */
12735
+ private getReportStorage;
12736
+ /**
12737
+ * Sets the report storage adapter constructor.
12738
+ * All future report instances will use this adapter.
12739
+ *
12740
+ * @param Ctor - Constructor for report storage adapter
12741
+ */
12742
+ useReportAdapter(Ctor: TReportBaseCtor): void;
12743
+ /**
12744
+ * Writes report data to storage using the configured adapter.
12745
+ * Automatically initializes storage on first write for each report type.
12746
+ *
12747
+ * @param reportName - Type of report (backtest, live, walker, etc.)
12748
+ * @param data - Event data object to write
12749
+ * @param options - Metadata options for filtering and search
12750
+ * @returns Promise that resolves when write is complete
12751
+ * @throws Error if write fails or storage initialization fails
12752
+ *
12753
+ * @internal - Automatically called by report services, not for direct use
12754
+ */
12755
+ writeData: <T = any>(reportName: ReportName, data: T, options: IReportDumpOptions) => Promise<void>;
12756
+ /**
12757
+ * Clears the memoized storage cache.
12758
+ * Call this when process.cwd() changes between strategy iterations
12759
+ * so new storage instances are created with the updated base path.
12760
+ */
12761
+ clear(): void;
12762
+ /**
12763
+ * Switches to a dummy report adapter that discards all writes.
12764
+ * All future report writes will be no-ops.
12765
+ */
12766
+ useDummy(): void;
12767
+ /**
12768
+ * Switches to the default JSONL report adapter.
12769
+ * All future report writes will use JSONL storage.
12770
+ */
12771
+ useJsonl(): void;
12772
+ }
12773
+
12774
+ declare const ReportWriter: ReportWriterAdapter;
12539
12775
 
12540
12776
  /**
12541
12777
  * Utility class for managing report services.
@@ -17047,6 +17283,47 @@ declare class PositionSizeUtils {
17047
17283
  }
17048
17284
  declare const PositionSize: typeof PositionSizeUtils;
17049
17285
 
17286
+ /**
17287
+ * Utilities for calculating take profit and stop loss price levels.
17288
+ * Automatically inverts direction based on position type (long/short).
17289
+ */
17290
+ declare class Position {
17291
+ /**
17292
+ * Calculates levels for the "moonbag" strategy — fixed TP at 50% from the current price.
17293
+ * @param dto.position - position type: "long" or "short"
17294
+ * @param dto.currentPrice - current asset price
17295
+ * @param dto.percentStopLoss - stop loss percentage from 0 to 100
17296
+ * @returns priceTakeProfit and priceStopLoss in fiat
17297
+ */
17298
+ static moonbag: (dto: {
17299
+ position: "long" | "short";
17300
+ currentPrice: number;
17301
+ percentStopLoss: number;
17302
+ }) => {
17303
+ position: "long" | "short";
17304
+ priceTakeProfit: number;
17305
+ priceStopLoss: number;
17306
+ };
17307
+ /**
17308
+ * Calculates levels for a bracket order with custom TP and SL.
17309
+ * @param dto.position - position type: "long" or "short"
17310
+ * @param dto.currentPrice - current asset price
17311
+ * @param dto.percentStopLoss - stop loss percentage from 0 to 100
17312
+ * @param dto.percentTakeProfit - take profit percentage from 0 to 100
17313
+ * @returns priceTakeProfit and priceStopLoss in fiat
17314
+ */
17315
+ static bracket: (dto: {
17316
+ position: "long" | "short";
17317
+ currentPrice: number;
17318
+ percentStopLoss: number;
17319
+ percentTakeProfit: number;
17320
+ }) => {
17321
+ position: "long" | "short";
17322
+ priceTakeProfit: number;
17323
+ priceStopLoss: number;
17324
+ };
17325
+ }
17326
+
17050
17327
  /**
17051
17328
  * Type alias for column configuration used in partial profit/loss markdown reports.
17052
17329
  *
@@ -19754,7 +20031,7 @@ type CacheFileKeyArgs<T extends CacheFileFunction> = [
19754
20031
  */
19755
20032
  declare class CacheUtils {
19756
20033
  /**
19757
- * Memoized function to get or create CacheInstance for a function.
20034
+ * Memoized function to get or create CacheFnInstance for a function.
19758
20035
  * Each function gets its own isolated cache instance.
19759
20036
  */
19760
20037
  private _getFnInstance;
@@ -19846,29 +20123,29 @@ declare class CacheUtils {
19846
20123
  name: string;
19847
20124
  key?: (args: CacheFileKeyArgs<T>) => string;
19848
20125
  }) => T & {
19849
- clear(): void;
20126
+ clear(): Promise<void>;
19850
20127
  };
19851
20128
  /**
19852
- * Dispose (remove) the memoized CacheInstance for a specific function.
20129
+ * Dispose (remove) the memoized CacheFnInstance for a specific function.
19853
20130
  *
19854
- * Removes the CacheInstance from the internal memoization cache, discarding all cached
20131
+ * Removes the CacheFnInstance from the internal memoization cache, discarding all cached
19855
20132
  * results across all contexts (all strategy/exchange/mode combinations) for that function.
19856
- * The next call to the wrapped function will create a fresh CacheInstance.
20133
+ * The next call to the wrapped function will create a fresh CacheFnInstance.
19857
20134
  *
19858
20135
  * @template T - Function type
19859
- * @param run - Function whose CacheInstance should be disposed.
20136
+ * @param run - Function whose CacheFnInstance should be disposed.
19860
20137
  *
19861
20138
  * @example
19862
20139
  * ```typescript
19863
20140
  * const cachedFn = Cache.fn(calculateIndicator, { interval: "1h" });
19864
20141
  *
19865
- * // Dispose CacheInstance for a specific function
20142
+ * // Dispose CacheFnInstance for a specific function
19866
20143
  * Cache.dispose(calculateIndicator);
19867
20144
  * ```
19868
20145
  */
19869
20146
  dispose: <T extends Function>(run: T) => void;
19870
20147
  /**
19871
- * Clears all memoized CacheInstance and CacheFileInstance objects.
20148
+ * Clears all memoized CacheFnInstance and CacheFileInstance objects.
19872
20149
  * Call this when process.cwd() changes between strategy iterations
19873
20150
  * so new instances are created with the updated base path.
19874
20151
  */
@@ -19890,6 +20167,140 @@ declare class CacheUtils {
19890
20167
  */
19891
20168
  declare const Cache: CacheUtils;
19892
20169
 
20170
+ /**
20171
+ * Signal function type for in-memory once-per-interval firing.
20172
+ * Called at most once per interval boundary per symbol.
20173
+ * Must return a non-null `ISignalIntervalDto` to start the interval countdown,
20174
+ * or `null` to defer firing until the next call.
20175
+ */
20176
+ type TIntervalFn = (symbol: string, when: Date) => Promise<ISignalIntervalDto | null>;
20177
+ /**
20178
+ * Signal function type for persistent file-based once-per-interval firing.
20179
+ * First argument is always `symbol: string`, followed by optional spread args.
20180
+ * Fired state survives process restarts via `PersistIntervalAdapter`.
20181
+ */
20182
+ type TIntervalFileFn = (symbol: string, ...args: any[]) => Promise<ISignalIntervalDto | null>;
20183
+ /**
20184
+ * Utility class for wrapping signal functions with once-per-interval firing.
20185
+ * Provides two modes: in-memory (`fn`) and persistent file-based (`file`).
20186
+ * Exported as singleton instance `Interval` for convenient usage.
20187
+ *
20188
+ * @example
20189
+ * ```typescript
20190
+ * import { Interval } from "./classes/Interval";
20191
+ *
20192
+ * const fireOncePerHour = Interval.fn(mySignalFn, { interval: "1h" });
20193
+ * await fireOncePerHour("BTCUSDT", when); // fn called — returns its result
20194
+ * await fireOncePerHour("BTCUSDT", when); // returns null (same interval)
20195
+ * ```
20196
+ */
20197
+ declare class IntervalUtils {
20198
+ /**
20199
+ * Memoized factory to get or create an `IntervalFnInstance` for a function.
20200
+ * Each function reference gets its own isolated instance.
20201
+ */
20202
+ private _getInstance;
20203
+ /**
20204
+ * Memoized factory to get or create an `IntervalFileInstance` for an async function.
20205
+ * Each function reference gets its own isolated persistent instance.
20206
+ */
20207
+ private _getFileInstance;
20208
+ /**
20209
+ * Wrap a signal function with in-memory once-per-interval firing.
20210
+ *
20211
+ * Returns a wrapped version of the function that fires at most once per interval boundary.
20212
+ * If the function returns `null`, the countdown does not start and the next call retries.
20213
+ *
20214
+ * The `run` function reference is used as the memoization key for the underlying
20215
+ * `IntervalFnInstance`, so each unique function reference gets its own isolated instance.
20216
+ *
20217
+ * @param run - Signal function to wrap
20218
+ * @param context.interval - Candle interval that controls the firing boundary
20219
+ * @returns Wrapped function with the same signature as `TIntervalFn`, plus a `clear()` method
20220
+ *
20221
+ * @example
20222
+ * ```typescript
20223
+ * const fireOnce = Interval.fn(mySignalFn, { interval: "15m" });
20224
+ *
20225
+ * await fireOnce("BTCUSDT", when); // → signal or null (fn called)
20226
+ * await fireOnce("BTCUSDT", when); // → null (same interval, skipped)
20227
+ * ```
20228
+ */
20229
+ fn: (run: TIntervalFn, context: {
20230
+ interval: CandleInterval;
20231
+ }) => TIntervalFn & {
20232
+ clear(): void;
20233
+ };
20234
+ /**
20235
+ * Wrap an async signal function with persistent file-based once-per-interval firing.
20236
+ *
20237
+ * Returns a wrapped version of the function that reads from disk on hit (returns `null`)
20238
+ * and writes the fired signal to disk on the first successful fire.
20239
+ * Fired state survives process restarts.
20240
+ *
20241
+ * The `run` function reference is used as the memoization key for the underlying
20242
+ * `IntervalFileInstance`, so each unique function reference gets its own isolated instance.
20243
+ *
20244
+ * @template T - Async function type to wrap
20245
+ * @param run - Async signal function to wrap with persistent once-per-interval firing
20246
+ * @param context.interval - Candle interval that controls the firing boundary
20247
+ * @param context.name - Human-readable bucket name; becomes the directory prefix
20248
+ * @returns Wrapped function with the same signature as `T`, plus an async `clear()` method
20249
+ * that deletes persisted records from disk and disposes the memoized instance
20250
+ *
20251
+ * @example
20252
+ * ```typescript
20253
+ * const fetchSignal = async (symbol: string, period: number) => { ... };
20254
+ * const fireOnce = Interval.file(fetchSignal, { interval: "1h", name: "fetchSignal" });
20255
+ * await fireOnce.clear(); // delete disk records so the function fires again next call
20256
+ * ```
20257
+ */
20258
+ file: <T extends TIntervalFileFn>(run: T, context: {
20259
+ interval: CandleInterval;
20260
+ name: string;
20261
+ }) => T & {
20262
+ clear(): Promise<void>;
20263
+ };
20264
+ /**
20265
+ * Dispose (remove) the memoized `IntervalFnInstance` for a specific function.
20266
+ *
20267
+ * Removes the instance from the internal memoization cache, discarding all in-memory
20268
+ * fired-interval state across all contexts for that function.
20269
+ * The next call to the wrapped function will create a fresh `IntervalFnInstance`.
20270
+ *
20271
+ * @param run - Function whose `IntervalFnInstance` should be disposed
20272
+ *
20273
+ * @example
20274
+ * ```typescript
20275
+ * const fireOnce = Interval.fn(mySignalFn, { interval: "1h" });
20276
+ * Interval.dispose(mySignalFn);
20277
+ * ```
20278
+ */
20279
+ dispose: (run: TIntervalFn) => void;
20280
+ /**
20281
+ * Clears all memoized `IntervalFnInstance` and `IntervalFileInstance` objects and
20282
+ * resets the `IntervalFileInstance` index counter.
20283
+ * Call this when `process.cwd()` changes between strategy iterations
20284
+ * so new instances are created with the updated base path.
20285
+ */
20286
+ clear: () => void;
20287
+ }
20288
+ /**
20289
+ * Singleton instance of `IntervalUtils` for convenient once-per-interval signal firing.
20290
+ *
20291
+ * @example
20292
+ * ```typescript
20293
+ * import { Interval } from "./classes/Interval";
20294
+ *
20295
+ * // In-memory: fires once per hour, resets on process restart
20296
+ * const fireOnce = Interval.fn(mySignalFn, { interval: "1h" });
20297
+ *
20298
+ * // Persistent: fired state survives restarts
20299
+ * const fireOncePersist = Interval.file(mySignalFn, { interval: "1h", name: "mySignal" });
20300
+ * ```
20301
+ */
20302
+ declare const Interval: IntervalUtils;
20303
+
19893
20304
  /**
19894
20305
  * Type alias for column configuration used in breakeven markdown reports.
19895
20306
  *
@@ -29675,4 +30086,4 @@ declare const getTotalClosed: (signal: Signal) => {
29675
30086
  remainingCostBasis: number;
29676
30087
  };
29677
30088
 
29678
- export { ActionBase, type ActivateScheduledCommit, type ActivateScheduledCommitNotification, type ActivePingContract, type AverageBuyCommit, type AverageBuyCommitNotification, Backtest, type BacktestStatisticsModel, Breakeven, type BreakevenAvailableNotification, type BreakevenCommit, type BreakevenCommitNotification, type BreakevenContract, type BreakevenData, type BreakevenEvent, type BreakevenStatisticsModel, Broker, type BrokerAverageBuyPayload, BrokerBase, type BrokerBreakevenPayload, type BrokerPartialLossPayload, type BrokerPartialProfitPayload, type BrokerSignalClosePayload, type BrokerSignalOpenPayload, type BrokerTrailingStopPayload, type BrokerTrailingTakePayload, Cache, type CancelScheduledCommit, type CancelScheduledCommitNotification, type CandleData, type CandleInterval, type ClosePendingCommit, type ClosePendingCommitNotification, type ColumnConfig, type ColumnModel, Constant, type CriticalErrorNotification, type DoneContract, Dump, type EntityId, Exchange, ExecutionContextService, type FrameInterval, type GlobalConfig, Heat, type HeatmapStatisticsModel, HighestProfit, type HighestProfitContract, type HighestProfitEvent, type HighestProfitStatisticsModel, type IActionSchema, type IActivateScheduledCommitRow, type IAggregatedTradeData, type IBidData, type IBreakevenCommitRow, type IBroker, type ICandleData, type ICommitRow, type IDumpContext, type IDumpInstance, type IExchangeSchema, type IFrameSchema, type IHeatmapRow, type ILog, type ILogEntry, type ILogger, type IMarkdownDumpOptions, type IMemoryInstance, type INotificationUtils, type IOrderBookData, type IPartialLossCommitRow, type IPartialProfitCommitRow, type IPersistBase, type IPositionSizeATRParams, type IPositionSizeFixedPercentageParams, type IPositionSizeKellyParams, type IPublicAction, type IPublicCandleData, type IPublicSignalRow, type IReportDumpOptions, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskSignalRow, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISignalDto, type ISignalRow, type ISizingCalculateParams, type ISizingCalculateParamsATR, type ISizingCalculateParamsFixedPercentage, type ISizingCalculateParamsKelly, type ISizingParams, type ISizingParamsATR, type ISizingParamsFixedPercentage, type ISizingParamsKelly, type ISizingSchema, type ISizingSchemaATR, type ISizingSchemaFixedPercentage, type ISizingSchemaKelly, type IStorageSignalRow, type IStorageUtils, type IStrategyPnL, type IStrategyResult, type IStrategySchema, type IStrategyTickResult, type IStrategyTickResultActive, type IStrategyTickResultCancelled, type IStrategyTickResultClosed, type IStrategyTickResultIdle, type IStrategyTickResultOpened, type IStrategyTickResultScheduled, type IStrategyTickResultWaiting, type ITrailingStopCommitRow, type ITrailingTakeCommitRow, type IWalkerResults, type IWalkerSchema, type IWalkerStrategyResult, type InfoErrorNotification, Live, type LiveStatisticsModel, Log, type LogData, Markdown, MarkdownFileBase, MarkdownFolderBase, type MarkdownName, MaxDrawdown, type MaxDrawdownContract, type MaxDrawdownEvent, type MaxDrawdownStatisticsModel, type MeasureData, Memory, type MemoryData, type MessageModel, type MessageRole, type MessageToolCall, MethodContextService, type MetricStats, Notification, NotificationBacktest, type NotificationData, NotificationLive, type NotificationModel, Partial$1 as Partial, type PartialData, type PartialEvent, type PartialLossAvailableNotification, type PartialLossCommit, type PartialLossCommitNotification, type PartialLossContract, type PartialProfitAvailableNotification, type PartialProfitCommit, type PartialProfitCommitNotification, type PartialProfitContract, type PartialStatisticsModel, Performance, type PerformanceContract, type PerformanceMetricType, type PerformanceStatisticsModel, PersistBase, PersistBreakevenAdapter, PersistCandleAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistMemoryAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PersistStorageAdapter, PositionSize, type ProgressBacktestContract, type ProgressWalkerContract, Report, ReportBase, type ReportName, Risk, type RiskContract, type RiskData, type RiskEvent, type RiskRejectionNotification, type RiskStatisticsModel, Schedule, type ScheduleData, type SchedulePingContract, type ScheduleStatisticsModel, type ScheduledEvent, type SignalCancelledNotification, type SignalCloseContract, type SignalClosedNotification, type SignalData, type SignalInterval, type SignalOpenContract, type SignalOpenedNotification, type SignalScheduledNotification, type SignalSyncCloseNotification, type SignalSyncContract, type SignalSyncOpenNotification, Storage, StorageBacktest, type StorageData, StorageLive, Strategy, type StrategyActionType, type StrategyCancelReason, type StrategyCloseReason, type StrategyCommitContract, type StrategyEvent, type StrategyStatisticsModel, Sync, type SyncEvent, type SyncStatisticsModel, type TBrokerCtor, type TDumpInstanceCtor, type TLogCtor, type TMarkdownBase, type TMemoryInstanceCtor, type TNotificationUtilsCtor, type TPersistBase, type TPersistBaseCtor, type TReportBase, type TStorageUtilsCtor, type TickEvent, type TrailingStopCommit, type TrailingStopCommitNotification, type TrailingTakeCommit, type TrailingTakeCommitNotification, type ValidationErrorNotification, Walker, type WalkerCompleteContract, type WalkerContract, type WalkerMetric, type SignalData$1 as WalkerSignalData, type WalkerStatisticsModel, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitMinutes, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionMaxDrawdownMinutes, getPositionMaxDrawdownPnlCost, getPositionMaxDrawdownPnlPercentage, getPositionMaxDrawdownPrice, getPositionMaxDrawdownTimestamp, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getRawCandles, getRiskSchema, getScheduledSignal, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenMaxDrawdown, listenMaxDrawdownOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenSync, listenSyncOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, percentDiff, percentToCloseCost, percentValue, readMemory, removeMemory, roundTicks, runInMockContext, searchMemory, set, setColumns, setConfig, setLogger, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };
30089
+ export { ActionBase, type ActivateScheduledCommit, type ActivateScheduledCommitNotification, type ActivePingContract, type AverageBuyCommit, type AverageBuyCommitNotification, Backtest, type BacktestStatisticsModel, Breakeven, type BreakevenAvailableNotification, type BreakevenCommit, type BreakevenCommitNotification, type BreakevenContract, type BreakevenData, type BreakevenEvent, type BreakevenStatisticsModel, Broker, type BrokerAverageBuyPayload, BrokerBase, type BrokerBreakevenPayload, type BrokerPartialLossPayload, type BrokerPartialProfitPayload, type BrokerSignalClosePayload, type BrokerSignalOpenPayload, type BrokerTrailingStopPayload, type BrokerTrailingTakePayload, Cache, type CancelScheduledCommit, type CancelScheduledCommitNotification, type CandleData, type CandleInterval, type ClosePendingCommit, type ClosePendingCommitNotification, type ColumnConfig, type ColumnModel, Constant, type CriticalErrorNotification, type DoneContract, Dump, type EntityId, Exchange, ExecutionContextService, type FrameInterval, type GlobalConfig, Heat, type HeatmapStatisticsModel, HighestProfit, type HighestProfitContract, type HighestProfitEvent, type HighestProfitStatisticsModel, type IActionSchema, type IActivateScheduledCommitRow, type IAggregatedTradeData, type IBidData, type IBreakevenCommitRow, type IBroker, type ICandleData, type ICommitRow, type IDumpContext, type IDumpInstance, type IExchangeSchema, type IFrameSchema, type IHeatmapRow, type ILog, type ILogEntry, type ILogger, type IMarkdownDumpOptions, type IMemoryInstance, type INotificationUtils, type IOrderBookData, type IPartialLossCommitRow, type IPartialProfitCommitRow, type IPersistBase, type IPositionSizeATRParams, type IPositionSizeFixedPercentageParams, type IPositionSizeKellyParams, type IPublicAction, type IPublicCandleData, type IPublicSignalRow, type IReportDumpOptions, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskSignalRow, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISignalDto, type ISignalRow, type ISizingCalculateParams, type ISizingCalculateParamsATR, type ISizingCalculateParamsFixedPercentage, type ISizingCalculateParamsKelly, type ISizingParams, type ISizingParamsATR, type ISizingParamsFixedPercentage, type ISizingParamsKelly, type ISizingSchema, type ISizingSchemaATR, type ISizingSchemaFixedPercentage, type ISizingSchemaKelly, type IStorageSignalRow, type IStorageUtils, type IStrategyPnL, type IStrategyResult, type IStrategySchema, type IStrategyTickResult, type IStrategyTickResultActive, type IStrategyTickResultCancelled, type IStrategyTickResultClosed, type IStrategyTickResultIdle, type IStrategyTickResultOpened, type IStrategyTickResultScheduled, type IStrategyTickResultWaiting, type ITrailingStopCommitRow, type ITrailingTakeCommitRow, type IWalkerResults, type IWalkerSchema, type IWalkerStrategyResult, type InfoErrorNotification, Interval, type IntervalData, Live, type LiveStatisticsModel, Log, type LogData, Markdown, MarkdownFileBase, MarkdownFolderBase, type MarkdownName, MarkdownWriter, MaxDrawdown, type MaxDrawdownContract, type MaxDrawdownEvent, type MaxDrawdownStatisticsModel, type MeasureData, Memory, type MemoryData, type MessageModel, type MessageRole, type MessageToolCall, MethodContextService, type MetricStats, Notification, NotificationBacktest, type NotificationData, NotificationLive, type NotificationModel, Partial$1 as Partial, type PartialData, type PartialEvent, type PartialLossAvailableNotification, type PartialLossCommit, type PartialLossCommitNotification, type PartialLossContract, type PartialProfitAvailableNotification, type PartialProfitCommit, type PartialProfitCommitNotification, type PartialProfitContract, type PartialStatisticsModel, Performance, type PerformanceContract, type PerformanceMetricType, type PerformanceStatisticsModel, PersistBase, PersistBreakevenAdapter, PersistCandleAdapter, PersistIntervalAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistMemoryAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PersistStorageAdapter, Position, PositionSize, type ProgressBacktestContract, type ProgressWalkerContract, Report, ReportBase, type ReportName, ReportWriter, Risk, type RiskContract, type RiskData, type RiskEvent, type RiskRejectionNotification, type RiskStatisticsModel, Schedule, type ScheduleData, type SchedulePingContract, type ScheduleStatisticsModel, type ScheduledEvent, type SignalCancelledNotification, type SignalCloseContract, type SignalClosedNotification, type SignalData, type SignalInterval, type SignalOpenContract, type SignalOpenedNotification, type SignalScheduledNotification, type SignalSyncCloseNotification, type SignalSyncContract, type SignalSyncOpenNotification, Storage, StorageBacktest, type StorageData, StorageLive, Strategy, type StrategyActionType, type StrategyCancelReason, type StrategyCloseReason, type StrategyCommitContract, type StrategyEvent, type StrategyStatisticsModel, Sync, type SyncEvent, type SyncStatisticsModel, type TBrokerCtor, type TDumpInstanceCtor, type TLogCtor, type TMarkdownBase, type TMemoryInstanceCtor, type TNotificationUtilsCtor, type TPersistBase, type TPersistBaseCtor, type TReportBase, type TStorageUtilsCtor, type TickEvent, type TrailingStopCommit, type TrailingStopCommitNotification, type TrailingTakeCommit, type TrailingTakeCommitNotification, type ValidationErrorNotification, Walker, type WalkerCompleteContract, type WalkerContract, type WalkerMetric, type SignalData$1 as WalkerSignalData, type WalkerStatisticsModel, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitMinutes, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionMaxDrawdownMinutes, getPositionMaxDrawdownPnlCost, getPositionMaxDrawdownPnlPercentage, getPositionMaxDrawdownPrice, getPositionMaxDrawdownTimestamp, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getRawCandles, getRiskSchema, getScheduledSignal, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenMaxDrawdown, listenMaxDrawdownOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenSync, listenSyncOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, percentDiff, percentToCloseCost, percentValue, readMemory, removeMemory, roundTicks, runInMockContext, searchMemory, set, setColumns, setConfig, setLogger, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };