backtest-kit 7.5.0 → 7.6.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": "7.5.0",
3
+ "version": "7.6.0",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -9423,6 +9423,53 @@ declare function setSignalState<Value extends object = object>(dispatch: Value |
9423
9423
  initialValue: Value;
9424
9424
  }): Promise<Value>;
9425
9425
 
9426
+ /**
9427
+ * Reads the session value scoped to the current (symbol, strategy, exchange, frame) context.
9428
+ *
9429
+ * Session data persists across candles within a single run and can survive process
9430
+ * restarts in live mode — useful for caching LLM inference results, intermediate
9431
+ * indicator state, or any cross-candle accumulator that is not tied to a specific signal.
9432
+ *
9433
+ * Automatically detects backtest/live mode from execution context.
9434
+ *
9435
+ * @param symbol - Trading pair symbol
9436
+ * @returns Promise resolving to current session value, or null if not set
9437
+ *
9438
+ * @example
9439
+ * ```typescript
9440
+ * import { getSession } from "backtest-kit";
9441
+ *
9442
+ * const session = await getSession<{ lastLlmSignal: string }>("BTCUSDT");
9443
+ * if (session?.lastLlmSignal === "buy") {
9444
+ * // reuse cached LLM result instead of calling the model again
9445
+ * }
9446
+ * ```
9447
+ */
9448
+ declare function getSessionData<Value extends object = object>(symbol: string): Promise<Value | null>;
9449
+ /**
9450
+ * Writes a session value scoped to the current (symbol, strategy, exchange, frame) context.
9451
+ *
9452
+ * Session data persists across candles within a single run and can survive process
9453
+ * restarts in live mode — useful for caching LLM inference results, intermediate
9454
+ * indicator state, or any cross-candle accumulator that is not tied to a specific signal.
9455
+ *
9456
+ * Pass null to clear the session.
9457
+ *
9458
+ * Automatically detects backtest/live mode from execution context.
9459
+ *
9460
+ * @param symbol - Trading pair symbol
9461
+ * @param value - New value or null to clear
9462
+ * @returns Promise that resolves when the session has been written
9463
+ *
9464
+ * @example
9465
+ * ```typescript
9466
+ * import { setSession } from "backtest-kit";
9467
+ *
9468
+ * await setSession("BTCUSDT", { lastLlmSignal: "buy" });
9469
+ * ```
9470
+ */
9471
+ declare function setSessionData<Value extends object = object>(symbol: string, value: Value | null): Promise<void>;
9472
+
9426
9473
  /**
9427
9474
  * Updater function for setState — receives current value and returns the next value.
9428
9475
  * Used for functional updates to state, e.g. `setState(prev => ({ ...prev, peakPercent: newPeak }))`
@@ -14023,6 +14070,11 @@ declare class PersistStateUtils {
14023
14070
  * All future persistence writes will be no-ops.
14024
14071
  */
14025
14072
  useDummy: () => void;
14073
+ /**
14074
+ * Switches to the default JSON persist adapter.
14075
+ * All future persistence writes will use JSON storage.
14076
+ */
14077
+ useJson: () => void;
14026
14078
  /**
14027
14079
  * Clears the memoized storage cache.
14028
14080
  * Call this when process.cwd() changes between strategy iterations
@@ -14043,6 +14095,93 @@ declare class PersistStateUtils {
14043
14095
  * Used by StatePersistInstance for crash-safe state persistence.
14044
14096
  */
14045
14097
  declare const PersistStateAdapter: PersistStateUtils;
14098
+ /**
14099
+ * Session data structure for session persistence.
14100
+ * Each session is identified by a unique id and contains an arbitrary JSON-serializable data object.
14101
+ */
14102
+ type SessionData = {
14103
+ id: string;
14104
+ data: object | null;
14105
+ };
14106
+ /**
14107
+ * Utility class for managing session persistence.
14108
+ *
14109
+ * Features:
14110
+ * - Memoized storage instances per (strategyName, exchangeName, frameName) key
14111
+ * - Custom adapter support
14112
+ * - Atomic read/write operations
14113
+ *
14114
+ * Storage layout: ./dump/session/<strategyName>/<exchangeName>/<frameName>.json
14115
+ *
14116
+ * Used by SessionPersistInstance for crash-safe session persistence.
14117
+ */
14118
+ declare class PersistSessionUtils {
14119
+ private PersistSessionFactory;
14120
+ private getSessionStorage;
14121
+ /**
14122
+ * Registers a custom persistence adapter.
14123
+ *
14124
+ * @param Ctor - Custom PersistBase constructor
14125
+ */
14126
+ usePersistSessionAdapter(Ctor: TPersistBaseCtor<string, SessionData>): void;
14127
+ /**
14128
+ * Initializes the storage for a given (strategyName, exchangeName, frameName) triple.
14129
+ *
14130
+ * @param strategyName - Strategy identifier
14131
+ * @param exchangeName - Exchange identifier
14132
+ * @param frameName - Frame identifier
14133
+ * @param initial - Whether this is the first initialization
14134
+ */
14135
+ waitForInit: (strategyName: string, exchangeName: string, frameName: string, initial: boolean) => Promise<void>;
14136
+ /**
14137
+ * Reads a session entry from persistence storage.
14138
+ *
14139
+ * @param strategyName - Strategy identifier
14140
+ * @param exchangeName - Exchange identifier
14141
+ * @param frameName - Frame identifier
14142
+ * @returns Promise resolving to entry data or null if not found
14143
+ */
14144
+ readSessionData: (strategyName: string, exchangeName: string, frameName: string) => Promise<SessionData | null>;
14145
+ /**
14146
+ * Writes a session entry to disk with atomic file writes.
14147
+ *
14148
+ * @param data - Entry data to persist
14149
+ * @param strategyName - Strategy identifier
14150
+ * @param exchangeName - Exchange identifier
14151
+ * @param frameName - Frame identifier
14152
+ */
14153
+ writeSessionData: (data: SessionData, strategyName: string, exchangeName: string, frameName: string) => Promise<void>;
14154
+ /**
14155
+ * Switches to a dummy persist adapter that discards all writes.
14156
+ * All future persistence writes will be no-ops.
14157
+ */
14158
+ useDummy: () => void;
14159
+ /**
14160
+ * Switches to the default JSON persist adapter.
14161
+ * All future persistence writes will use JSON storage.
14162
+ */
14163
+ useJson: () => void;
14164
+ /**
14165
+ * Clears the memoized storage cache.
14166
+ * Call this when process.cwd() changes between strategy iterations
14167
+ * so new storage instances are created with the updated base path.
14168
+ */
14169
+ clear: () => void;
14170
+ /**
14171
+ * Disposes of the session adapter and releases any resources.
14172
+ * Call this when a session is removed to clean up its associated storage.
14173
+ *
14174
+ * @param strategyName - Strategy identifier
14175
+ * @param exchangeName - Exchange identifier
14176
+ * @param frameName - Frame identifier
14177
+ */
14178
+ dispose: (strategyName: string, exchangeName: string, frameName: string) => void;
14179
+ }
14180
+ /**
14181
+ * Global singleton instance of PersistSessionUtils.
14182
+ * Used by SessionPersistInstance for crash-safe session persistence.
14183
+ */
14184
+ declare const PersistSessionAdapter: PersistSessionUtils;
14046
14185
 
14047
14186
  /**
14048
14187
  * Configuration interface for selective markdown service enablement.
@@ -14890,7 +15029,7 @@ type RestoreSnapshot = () => void;
14890
15029
  * Allows temporarily detaching all subject subscriptions so that one session
14891
15030
  * does not interfere with another, then restoring them afterwards.
14892
15031
  */
14893
- declare class SessionUtils {
15032
+ declare class SystemUtils {
14894
15033
  /**
14895
15034
  * Snapshots the current listener state of every global subject by replacing
14896
15035
  * their internal `_events` map with an empty object.
@@ -14898,7 +15037,237 @@ declare class SessionUtils {
14898
15037
  */
14899
15038
  createSnapshot: () => RestoreSnapshot;
14900
15039
  }
14901
- declare const Session: SessionUtils;
15040
+ declare const System: SystemUtils;
15041
+
15042
+ /**
15043
+ * Interface for session instance implementations.
15044
+ * Defines the contract for local, persist, and dummy backends.
15045
+ *
15046
+ * Intended use: per-(symbol, strategy, exchange, frame) mutable session data
15047
+ * shared across strategy callbacks within a single run — e.g. caching LLM
15048
+ * inference results, intermediate indicator state, or cross-candle accumulators.
15049
+ *
15050
+ * Example shape:
15051
+ * ```ts
15052
+ * { lastLlmSignal: "buy" | "sell" | null; confirmedAt: number }
15053
+ * ```
15054
+ */
15055
+ interface ISessionInstance {
15056
+ /**
15057
+ * Initialize the session instance.
15058
+ * @param initial - Whether this is the first initialization
15059
+ */
15060
+ waitForInit(initial: boolean): Promise<void>;
15061
+ /**
15062
+ * Write a new session value.
15063
+ * @param value - New value or null to clear
15064
+ */
15065
+ setData<Value extends object = object>(value: Value | null): Promise<void>;
15066
+ /**
15067
+ * Read the current session value.
15068
+ * @returns Current session value, or null if not set
15069
+ */
15070
+ getData<Value extends object = object>(): Promise<Value | null>;
15071
+ /**
15072
+ * Releases any resources held by this instance.
15073
+ */
15074
+ dispose(): Promise<void>;
15075
+ }
15076
+ /**
15077
+ * Constructor type for session instance implementations.
15078
+ * Used for swapping backends via SessionBacktestAdapter / SessionLiveAdapter.
15079
+ */
15080
+ type TSessionInstanceCtor = new (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => ISessionInstance;
15081
+ /**
15082
+ * Public surface of SessionBacktestAdapter / SessionLiveAdapter — ISessionInstance minus waitForInit and dispose.
15083
+ * waitForInit and dispose are managed internally by the adapter.
15084
+ */
15085
+ type TSessionAdapter = {
15086
+ [key in Exclude<keyof ISessionInstance, "waitForInit" | "dispose">]: any;
15087
+ };
15088
+ /**
15089
+ * Backtest session adapter with pluggable storage backend.
15090
+ *
15091
+ * Features:
15092
+ * - Adapter pattern for swappable session instance implementations
15093
+ * - Default backend: SessionLocalInstance (in-memory, no disk persistence)
15094
+ * - Alternative backends: SessionPersistInstance, SessionDummyInstance
15095
+ * - Convenience methods: useLocal(), usePersist(), useDummy(), useSessionAdapter()
15096
+ * - Memoized instances per (symbol, strategyName, exchangeName, frameName) tuple
15097
+ */
15098
+ declare class SessionBacktestAdapter implements TSessionAdapter {
15099
+ private SessionFactory;
15100
+ private getInstance;
15101
+ /**
15102
+ * Read the current session value for a backtest run.
15103
+ * @param symbol - Trading pair symbol
15104
+ * @param context.strategyName - Strategy identifier
15105
+ * @param context.exchangeName - Exchange identifier
15106
+ * @param context.frameName - Frame identifier
15107
+ * @returns Current session value, or null if not set
15108
+ */
15109
+ getData: <Value extends object = object>(symbol: string, context: {
15110
+ strategyName: StrategyName;
15111
+ exchangeName: ExchangeName;
15112
+ frameName: FrameName;
15113
+ }) => Promise<Value | null>;
15114
+ /**
15115
+ * Update the session value for a backtest run.
15116
+ * @param symbol - Trading pair symbol
15117
+ * @param value - New value or null to clear
15118
+ * @param context.strategyName - Strategy identifier
15119
+ * @param context.exchangeName - Exchange identifier
15120
+ * @param context.frameName - Frame identifier
15121
+ */
15122
+ setData: <Value extends object = object>(symbol: string, value: Value | null, context: {
15123
+ strategyName: StrategyName;
15124
+ exchangeName: ExchangeName;
15125
+ frameName: FrameName;
15126
+ }) => Promise<void>;
15127
+ /**
15128
+ * Switches to in-memory adapter (default).
15129
+ * All data lives in process memory only.
15130
+ */
15131
+ useLocal: () => void;
15132
+ /**
15133
+ * Switches to file-system backed adapter.
15134
+ * Data is persisted to disk via PersistSessionAdapter.
15135
+ */
15136
+ usePersist: () => void;
15137
+ /**
15138
+ * Switches to dummy adapter that discards all writes.
15139
+ */
15140
+ useDummy: () => void;
15141
+ /**
15142
+ * Switches to a custom session adapter implementation.
15143
+ * @param Ctor - Constructor for the custom session instance
15144
+ */
15145
+ useSessionAdapter: (Ctor: TSessionInstanceCtor) => void;
15146
+ /**
15147
+ * Clears the memoized instance cache.
15148
+ * Call this when process.cwd() changes between strategy iterations
15149
+ * so new instances are created with the updated base path.
15150
+ */
15151
+ clear: () => void;
15152
+ }
15153
+ /**
15154
+ * Live trading session adapter with pluggable storage backend.
15155
+ *
15156
+ * Features:
15157
+ * - Adapter pattern for swappable session instance implementations
15158
+ * - Default backend: SessionPersistInstance (file-system backed, survives restarts)
15159
+ * - Alternative backends: SessionLocalInstance, SessionDummyInstance
15160
+ * - Convenience methods: useLocal(), usePersist(), useDummy(), useSessionAdapter()
15161
+ * - Memoized instances per (symbol, strategyName, exchangeName, frameName) tuple
15162
+ */
15163
+ declare class SessionLiveAdapter implements TSessionAdapter {
15164
+ private SessionFactory;
15165
+ private getInstance;
15166
+ /**
15167
+ * Read the current session value for a live run.
15168
+ * @param symbol - Trading pair symbol
15169
+ * @param context.strategyName - Strategy identifier
15170
+ * @param context.exchangeName - Exchange identifier
15171
+ * @param context.frameName - Frame identifier
15172
+ * @returns Current session value, or null if not set
15173
+ */
15174
+ getData: <Value extends object = object>(symbol: string, context: {
15175
+ strategyName: StrategyName;
15176
+ exchangeName: ExchangeName;
15177
+ frameName: FrameName;
15178
+ }) => Promise<Value | null>;
15179
+ /**
15180
+ * Update the session value for a live run.
15181
+ * @param symbol - Trading pair symbol
15182
+ * @param value - New value or null to clear
15183
+ * @param context.strategyName - Strategy identifier
15184
+ * @param context.exchangeName - Exchange identifier
15185
+ * @param context.frameName - Frame identifier
15186
+ */
15187
+ setData: <Value extends object = object>(symbol: string, value: Value | null, context: {
15188
+ strategyName: StrategyName;
15189
+ exchangeName: ExchangeName;
15190
+ frameName: FrameName;
15191
+ }) => Promise<void>;
15192
+ /**
15193
+ * Switches to in-memory adapter.
15194
+ * All data lives in process memory only.
15195
+ */
15196
+ useLocal: () => void;
15197
+ /**
15198
+ * Switches to file-system backed adapter (default).
15199
+ * Data is persisted to disk via PersistSessionAdapter.
15200
+ */
15201
+ usePersist: () => void;
15202
+ /**
15203
+ * Switches to dummy adapter that discards all writes.
15204
+ */
15205
+ useDummy: () => void;
15206
+ /**
15207
+ * Switches to a custom session adapter implementation.
15208
+ * @param Ctor - Constructor for the custom session instance
15209
+ */
15210
+ useSessionAdapter: (Ctor: TSessionInstanceCtor) => void;
15211
+ /**
15212
+ * Clears the memoized instance cache.
15213
+ * Call this when process.cwd() changes between strategy iterations
15214
+ * so new instances are created with the updated base path.
15215
+ */
15216
+ clear: () => void;
15217
+ }
15218
+ /**
15219
+ * Main session adapter that manages both backtest and live session storage.
15220
+ *
15221
+ * Features:
15222
+ * - Routes all operations to SessionBacktest or SessionLive based on the backtest flag
15223
+ */
15224
+ declare class SessionAdapter {
15225
+ /**
15226
+ * Read the current session value for a signal.
15227
+ * Routes to SessionBacktest or SessionLive based on backtest.
15228
+ * @param symbol - Trading pair symbol
15229
+ * @param context.strategyName - Strategy identifier
15230
+ * @param context.exchangeName - Exchange identifier
15231
+ * @param context.frameName - Frame identifier
15232
+ * @param backtest - Flag indicating if the context is backtest or live
15233
+ * @returns Current session value, or null if not set
15234
+ */
15235
+ getData: <Value extends object = object>(symbol: string, context: {
15236
+ strategyName: StrategyName;
15237
+ exchangeName: ExchangeName;
15238
+ frameName: FrameName;
15239
+ }, backtest: boolean) => Promise<Value | null>;
15240
+ /**
15241
+ * Update the session value for a signal.
15242
+ * Routes to SessionBacktest or SessionLive based on backtest.
15243
+ * @param symbol - Trading pair symbol
15244
+ * @param value - New value or null to clear
15245
+ * @param context.strategyName - Strategy identifier
15246
+ * @param context.exchangeName - Exchange identifier
15247
+ * @param context.frameName - Frame identifier
15248
+ * @param backtest - Flag indicating if the context is backtest or live
15249
+ */
15250
+ setData: <Value extends object = object>(symbol: string, value: Value | null, context: {
15251
+ strategyName: StrategyName;
15252
+ exchangeName: ExchangeName;
15253
+ frameName: FrameName;
15254
+ }, backtest: boolean) => Promise<void>;
15255
+ }
15256
+ /**
15257
+ * Global singleton instance of SessionAdapter.
15258
+ * Provides unified session management for backtest and live trading.
15259
+ */
15260
+ declare const Session: SessionAdapter;
15261
+ /**
15262
+ * Global singleton instance of SessionLiveAdapter.
15263
+ * Provides live trading session storage with pluggable backends.
15264
+ */
15265
+ declare const SessionLive: SessionLiveAdapter;
15266
+ /**
15267
+ * Global singleton instance of SessionBacktestAdapter.
15268
+ * Provides backtest session storage with pluggable backends.
15269
+ */
15270
+ declare const SessionBacktest: SessionBacktestAdapter;
14902
15271
 
14903
15272
  /**
14904
15273
  * Type alias for column configuration used in backtest markdown reports.
@@ -33675,4 +34044,4 @@ declare const getTotalClosed: (signal: Signal) => {
33675
34044
  remainingCostBasis: number;
33676
34045
  };
33677
34046
 
33678
- 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, type CommitPayload, 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 IRecentUtils, type IReportDumpOptions, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskSignalRow, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISignalDto, type ISignalIntervalDto, 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 IStateInstance, 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 IdlePingContract, 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, MemoryBacktest, MemoryBacktestAdapter, type MemoryData, MemoryLive, MemoryLiveAdapter, 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, PersistRecentAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PersistStateAdapter, PersistStorageAdapter, Position, PositionSize, type ProgressBacktestContract, type ProgressWalkerContract, Recent, RecentBacktest, type RecentData, RecentLive, Reflect, 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, Session, type SignalCancelledNotification, type SignalCloseContract, type SignalClosedNotification, type SignalData, type SignalInfoContract, type SignalInfoNotification, type SignalInterval, type SignalOpenContract, type SignalOpenedNotification, type SignalScheduledNotification, type SignalSyncCloseNotification, type SignalSyncContract, type SignalSyncOpenNotification, State, StateBacktest, StateBacktestAdapter, type StateData, StateLive, StateLiveAdapter, 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 TRecentUtilsCtor, type TReportBase, type TStateInstanceCtor, 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, commitSignalNotify, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, createSignalState, 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, getLatestSignal, getMaxDrawdownDistancePnlCost, getMaxDrawdownDistancePnlPercentage, getMinutesSinceLatestSignalCreated, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionActiveMinutes, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestMaxDrawdownPnlCost, getPositionHighestMaxDrawdownPnlPercentage, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitDistancePnlCost, getPositionHighestProfitDistancePnlPercentage, getPositionHighestProfitMinutes, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionMaxDrawdownMinutes, getPositionMaxDrawdownPnlCost, getPositionMaxDrawdownPnlPercentage, getPositionMaxDrawdownPrice, getPositionMaxDrawdownTimestamp, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getPositionWaitingMinutes, getRawCandles, getRiskSchema, getScheduledSignal, getSignalState, 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, listenIdlePing, listenIdlePingOnce, listenMaxDrawdown, listenMaxDrawdownOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalNotify, listenSignalNotifyOnce, 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, setSignalState, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };
34047
+ 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, type CommitPayload, 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 IRecentUtils, type IReportDumpOptions, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskSignalRow, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISessionInstance, type ISignalDto, type ISignalIntervalDto, 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 IStateInstance, 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 IdlePingContract, 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, MemoryBacktest, MemoryBacktestAdapter, type MemoryData, MemoryLive, MemoryLiveAdapter, 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, PersistRecentAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSessionAdapter, PersistSignalAdapter, PersistStateAdapter, PersistStorageAdapter, Position, PositionSize, type ProgressBacktestContract, type ProgressWalkerContract, Recent, RecentBacktest, type RecentData, RecentLive, Reflect, 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, Session, SessionBacktest, type SessionData, SessionLive, type SignalCancelledNotification, type SignalCloseContract, type SignalClosedNotification, type SignalData, type SignalInfoContract, type SignalInfoNotification, type SignalInterval, type SignalOpenContract, type SignalOpenedNotification, type SignalScheduledNotification, type SignalSyncCloseNotification, type SignalSyncContract, type SignalSyncOpenNotification, State, StateBacktest, StateBacktestAdapter, type StateData, StateLive, StateLiveAdapter, Storage, StorageBacktest, type StorageData, StorageLive, Strategy, type StrategyActionType, type StrategyCancelReason, type StrategyCloseReason, type StrategyCommitContract, type StrategyEvent, type StrategyStatisticsModel, Sync, type SyncEvent, type SyncStatisticsModel, System, type TBrokerCtor, type TDumpInstanceCtor, type TLogCtor, type TMarkdownBase, type TMemoryInstanceCtor, type TNotificationUtilsCtor, type TPersistBase, type TPersistBaseCtor, type TRecentUtilsCtor, type TReportBase, type TSessionInstanceCtor, type TStateInstanceCtor, 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, commitSignalNotify, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, createSignalState, 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, getLatestSignal, getMaxDrawdownDistancePnlCost, getMaxDrawdownDistancePnlPercentage, getMinutesSinceLatestSignalCreated, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionActiveMinutes, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestMaxDrawdownPnlCost, getPositionHighestMaxDrawdownPnlPercentage, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitDistancePnlCost, getPositionHighestProfitDistancePnlPercentage, getPositionHighestProfitMinutes, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionMaxDrawdownMinutes, getPositionMaxDrawdownPnlCost, getPositionMaxDrawdownPnlPercentage, getPositionMaxDrawdownPrice, getPositionMaxDrawdownTimestamp, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getPositionWaitingMinutes, getRawCandles, getRiskSchema, getScheduledSignal, getSessionData, getSignalState, 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, listenIdlePing, listenIdlePingOnce, listenMaxDrawdown, listenMaxDrawdownOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalNotify, listenSignalNotifyOnce, 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, setSessionData, setSignalState, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };