backtest-kit 6.12.0 → 6.14.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/types.d.ts CHANGED
@@ -4748,6 +4748,79 @@ interface IPositionOverlapLadder {
4748
4748
  lowerPercent: number;
4749
4749
  }
4750
4750
 
4751
+ /**
4752
+ * Optional payload for signal info notifications.
4753
+ * Both fields are optional — omitting notificationNote falls back to the signal's own note.
4754
+ */
4755
+ type SignalNotificationPayload = {
4756
+ /** Optional user-defined identifier for correlating the notification with external systems (e.g. Telegram message ID) */
4757
+ notificationId: string;
4758
+ /** Human-readable note to attach to the notification. Falls back to signal.note if omitted. */
4759
+ notificationNote: string;
4760
+ };
4761
+ /**
4762
+ * Helper service for emitting signal info notifications.
4763
+ *
4764
+ * Handles validation (memoized per context) and emission of `signal.info` events
4765
+ * via `signalNotifySubject`. Used internally by the framework action pipeline —
4766
+ * end users interact with this via `commitSignalNotify()` in `onActivePing` callbacks.
4767
+ */
4768
+ declare class NotificationHelperService {
4769
+ private readonly loggerService;
4770
+ private readonly strategySchemaService;
4771
+ private readonly riskValidationService;
4772
+ private readonly strategyValidationService;
4773
+ private readonly exchangeValidationService;
4774
+ private readonly frameValidationService;
4775
+ private readonly actionValidationService;
4776
+ private readonly strategyCoreService;
4777
+ private readonly timeMetaService;
4778
+ /**
4779
+ * Validates strategy, exchange, frame, risk, and action schemas for the given context.
4780
+ *
4781
+ * Memoized per unique `"strategyName:exchangeName[:frameName]"` key — subsequent calls
4782
+ * with the same context are no-ops, so validation runs at most once per context.
4783
+ *
4784
+ * @param context - Routing context: strategyName, exchangeName, frameName
4785
+ * @throws {Error} If any registered schema fails validation
4786
+ */
4787
+ validate: ((context: {
4788
+ strategyName: StrategyName;
4789
+ exchangeName: ExchangeName;
4790
+ frameName: FrameName;
4791
+ }) => Promise<void>) & functools_kit.IClearableMemoize<string> & functools_kit.IControlMemoize<string, Promise<void>>;
4792
+ /**
4793
+ * Emits a `signal.info` notification for the currently active pending signal.
4794
+ *
4795
+ * Validates all schemas (via memoized `validate`), resolves the pending signal
4796
+ * for the given symbol, then emits a `SignalInfoContract` via `signalNotifySubject`,
4797
+ * which is routed to all registered `listenSignalNotify` callbacks and persisted
4798
+ * by `NotificationAdapter`.
4799
+ *
4800
+ * @param payload - Optional notification fields (notificationId, notificationNote)
4801
+ * @param symbol - Trading pair symbol (e.g. "BTCUSDT")
4802
+ * @param currentPrice - Market price at the time of the call
4803
+ * @param context - Routing context: strategyName, exchangeName, frameName
4804
+ * @param backtest - true when called during a backtest run
4805
+ *
4806
+ * @throws {Error} If no active pending signal is found for the given symbol
4807
+ *
4808
+ * @example
4809
+ * ```typescript
4810
+ * // Inside onActivePing callback:
4811
+ * await commitSignalNotify("BTCUSDT", {
4812
+ * notificationNote: "RSI crossed 70, consider closing",
4813
+ * notificationId: "msg-123",
4814
+ * });
4815
+ * ```
4816
+ */
4817
+ commitSignalNotify: (payload: Partial<SignalNotificationPayload>, symbol: string, currentPrice: number, context: {
4818
+ strategyName: StrategyName;
4819
+ exchangeName: ExchangeName;
4820
+ frameName: FrameName;
4821
+ }, backtest: boolean) => Promise<void>;
4822
+ }
4823
+
4751
4824
  /**
4752
4825
  * Cancels the scheduled signal without stopping the strategy.
4753
4826
  *
@@ -5868,6 +5941,38 @@ declare function hasNoPendingSignal(symbol: string): Promise<boolean>;
5868
5941
  * ```
5869
5942
  */
5870
5943
  declare function hasNoScheduledSignal(symbol: string): Promise<boolean>;
5944
+ /**
5945
+ * Emits a `signal.info` notification for the currently active pending signal.
5946
+ *
5947
+ * Broadcasts a user-defined informational note without affecting position state.
5948
+ * Useful for annotating strategy decisions, triggering external alerts, or logging
5949
+ * mid-position events (e.g. RSI crossing a threshold, volume spike detected).
5950
+ *
5951
+ * Automatically reads backtest/live mode from execution context.
5952
+ * Automatically reads strategyName, exchangeName, frameName from method context.
5953
+ * Automatically fetches current price via getAveragePrice.
5954
+ *
5955
+ * @param symbol - Trading pair symbol (e.g. "BTCUSDT")
5956
+ * @param payload - Optional notification fields
5957
+ * @param payload.notificationNote - Human-readable note. Falls back to signal.note if omitted.
5958
+ * @param payload.notificationId - Optional correlation ID for external systems (e.g. Telegram message ID).
5959
+ *
5960
+ * @throws {Error} If called outside an execution context
5961
+ * @throws {Error} If called outside a method context
5962
+ * @throws {Error} If no active pending signal exists for the given symbol
5963
+ *
5964
+ * @example
5965
+ * ```typescript
5966
+ * import { commitSignalNotify } from "backtest-kit";
5967
+ *
5968
+ * // Inside onActivePing callback:
5969
+ * await commitSignalNotify("BTCUSDT", {
5970
+ * notificationNote: "RSI crossed 70, consider closing",
5971
+ * notificationId: "msg-123",
5972
+ * });
5973
+ * ```
5974
+ */
5975
+ declare function commitSignalNotify(symbol: string, payload?: Partial<SignalNotificationPayload>): Promise<void>;
5871
5976
 
5872
5977
  /**
5873
5978
  * Stops the strategy from generating new signals.
@@ -7581,6 +7686,89 @@ interface MaxDrawdownContract {
7581
7686
  backtest: boolean;
7582
7687
  }
7583
7688
 
7689
+ /**
7690
+ * Contract for signal info notification events.
7691
+ *
7692
+ * Emitted by signalNotifySubject when a strategy calls commitSignalInfo() to broadcast
7693
+ * a user-defined informational message for an open position.
7694
+ * Used for custom strategy annotations, debug output, and external notification routing.
7695
+ *
7696
+ * Consumers:
7697
+ * - User callbacks via listenSignalNotify() / listenSignalNotifyOnce()
7698
+ *
7699
+ * @example
7700
+ * ```typescript
7701
+ * import { listenSignalNotify } from "backtest-kit";
7702
+ *
7703
+ * // Listen to all signal info events
7704
+ * listenSignalNotify((event) => {
7705
+ * console.log(`[${event.backtest ? "Backtest" : "Live"}] Signal ${event.data.id}: ${event.note}`);
7706
+ * console.log(`Symbol: ${event.symbol}, Price: ${event.currentPrice}`);
7707
+ * });
7708
+ *
7709
+ * // Wait for the first info event on BTCUSDT
7710
+ * listenSignalNotifyOnce(
7711
+ * (event) => event.symbol === "BTCUSDT",
7712
+ * (event) => console.log("BTCUSDT info:", event.note)
7713
+ * );
7714
+ * ```
7715
+ */
7716
+ interface SignalInfoContract {
7717
+ /**
7718
+ * Trading pair symbol (e.g., "BTCUSDT").
7719
+ * Identifies which market this info event belongs to.
7720
+ */
7721
+ symbol: string;
7722
+ /**
7723
+ * Strategy name that generated this signal.
7724
+ * Identifies which strategy execution this info event belongs to.
7725
+ */
7726
+ strategyName: StrategyName;
7727
+ /**
7728
+ * Exchange name where this signal is being executed.
7729
+ * Identifies which exchange this info event belongs to.
7730
+ */
7731
+ exchangeName: ExchangeName;
7732
+ /**
7733
+ * Frame name where this signal is being executed.
7734
+ * Identifies which frame this info event belongs to (empty string for live mode).
7735
+ */
7736
+ frameName: FrameName;
7737
+ /**
7738
+ * Complete signal row data with original prices.
7739
+ * Contains all signal information including originalPriceStopLoss, originalPriceTakeProfit, and partialExecuted.
7740
+ */
7741
+ data: IPublicSignalRow;
7742
+ /**
7743
+ * Current market price at the moment the info event was emitted.
7744
+ */
7745
+ currentPrice: number;
7746
+ /**
7747
+ * User-defined informational note attached to this event.
7748
+ * Provided by the strategy when calling commitSignalInfo().
7749
+ */
7750
+ note: string;
7751
+ /**
7752
+ * Optional user-defined identifier for correlating this event with external systems.
7753
+ * Provided by the strategy when calling commitSignalInfo().
7754
+ */
7755
+ notificationId?: string;
7756
+ /**
7757
+ * Execution mode flag.
7758
+ * - true: Event from backtest execution (historical candle data)
7759
+ * - false: Event from live trading (real-time tick)
7760
+ */
7761
+ backtest: boolean;
7762
+ /**
7763
+ * Event timestamp in milliseconds since Unix epoch.
7764
+ *
7765
+ * Timing semantics:
7766
+ * - Live mode: when.getTime() at the moment the info event was emitted
7767
+ * - Backtest mode: candle.timestamp of the candle that triggered the event
7768
+ */
7769
+ timestamp: number;
7770
+ }
7771
+
7584
7772
  /**
7585
7773
  * Subscribes to all signal events with queued async processing.
7586
7774
  *
@@ -8636,6 +8824,24 @@ declare function listenMaxDrawdown(fn: (event: MaxDrawdownContract) => void): ()
8636
8824
  * @return Unsubscribe function to cancel the listener before it fires
8637
8825
  */
8638
8826
  declare function listenMaxDrawdownOnce(filterFn: (event: MaxDrawdownContract) => boolean, fn: (event: MaxDrawdownContract) => void): () => void;
8827
+ /**
8828
+ * Subscribes to signal info events with queued async processing.
8829
+ * Emits when a strategy calls commitSignalInfo() to broadcast a user-defined note for an open position.
8830
+ * Events are processed sequentially in order received, even if callback is async.
8831
+ * Uses queued wrapper to prevent concurrent execution of the callback.
8832
+ * @param fn - Callback function to handle signal info events
8833
+ * @return Unsubscribe function to stop listening to events
8834
+ */
8835
+ declare function listenSignalNotify(fn: (event: SignalInfoContract) => void): () => void;
8836
+ /**
8837
+ * Subscribes to filtered signal info events with one-time execution.
8838
+ * Listens for events matching the filter predicate, then executes callback once
8839
+ * and automatically unsubscribes.
8840
+ * @param filterFn - Predicate to filter which events trigger the callback
8841
+ * @param fn - Callback function to handle the filtered event (called only once)
8842
+ * @return Unsubscribe function to cancel the listener before it fires
8843
+ */
8844
+ declare function listenSignalNotifyOnce(filterFn: (event: SignalInfoContract) => boolean, fn: (event: SignalInfoContract) => void): () => void;
8639
8845
 
8640
8846
  /**
8641
8847
  * Checks if trade context is active (execution and method contexts).
@@ -8891,6 +9097,34 @@ declare function getNextCandles(symbol: string, interval: CandleInterval, limit:
8891
9097
  */
8892
9098
  declare function getAggregatedTrades(symbol: string, limit?: number): Promise<IAggregatedTradeData[]>;
8893
9099
 
9100
+ /**
9101
+ * Returns the latest signal (pending or closed) for the current strategy context.
9102
+ *
9103
+ * Does not distinguish between active and closed signals — returns whichever
9104
+ * was recorded last. Useful for cooldown logic: e.g. skip opening a new position
9105
+ * for 4 hours after a stop-loss by checking the timestamp of the latest signal
9106
+ * regardless of its outcome.
9107
+ *
9108
+ * Searches backtest storage first, then live storage.
9109
+ * Returns null if no signal exists at all.
9110
+ *
9111
+ * Automatically detects backtest/live mode from execution context.
9112
+ *
9113
+ * @param symbol - Trading pair symbol
9114
+ * @returns Promise resolving to the latest signal or null
9115
+ *
9116
+ * @example
9117
+ * ```typescript
9118
+ * import { getLatestSignal } from "backtest-kit";
9119
+ *
9120
+ * const latest = await getLatestSignal("BTCUSDT");
9121
+ * if (latest && Date.now() - latest.closedAt < 4 * 60 * 60 * 1000) {
9122
+ * return; // cooldown after SL — skip new signal for 4 hours
9123
+ * }
9124
+ * ```
9125
+ */
9126
+ declare function getLatestSignal(symbol: string): Promise<IPublicSignalRow | null>;
9127
+
8894
9128
  /**
8895
9129
  * Writes a value to memory scoped to the current signal.
8896
9130
  *
@@ -10550,6 +10784,70 @@ interface ClosePendingCommitNotification {
10550
10784
  /** Unix timestamp in milliseconds when the notification was created */
10551
10785
  createdAt: number;
10552
10786
  }
10787
+ /**
10788
+ * Signal info notification.
10789
+ * Emitted when a strategy broadcasts a user-defined informational note for an open position.
10790
+ */
10791
+ interface SignalInfoNotification {
10792
+ /** Discriminator for type-safe union */
10793
+ type: "signal.info";
10794
+ /** Unique notification identifier */
10795
+ id: string;
10796
+ /** Unix timestamp in milliseconds when the info event was emitted */
10797
+ timestamp: number;
10798
+ /** Whether this notification is from backtest mode (true) or live mode (false) */
10799
+ backtest: boolean;
10800
+ /** Trading pair symbol (e.g., "BTCUSDT") */
10801
+ symbol: string;
10802
+ /** Strategy name that generated this signal */
10803
+ strategyName: StrategyName;
10804
+ /** Exchange name where signal was executed */
10805
+ exchangeName: ExchangeName;
10806
+ /** Unique signal identifier (UUID v4) */
10807
+ signalId: string;
10808
+ /** Current market price when the info event was emitted */
10809
+ currentPrice: number;
10810
+ /** Trade direction: "long" (buy) or "short" (sell) */
10811
+ position: "long" | "short";
10812
+ /** Entry price for the position */
10813
+ priceOpen: number;
10814
+ /** Effective take profit price (with trailing if set) */
10815
+ priceTakeProfit: number;
10816
+ /** Effective stop loss price (with trailing if set) */
10817
+ priceStopLoss: number;
10818
+ /** Original take profit price before any trailing adjustments */
10819
+ originalPriceTakeProfit: number;
10820
+ /** Original stop loss price before any trailing adjustments */
10821
+ originalPriceStopLoss: number;
10822
+ /** Original entry price at signal creation (unchanged by DCA averaging) */
10823
+ originalPriceOpen: number;
10824
+ /** Total number of DCA entries (_entry.length). 1 = no averaging. */
10825
+ totalEntries: number;
10826
+ /** Total number of partial closes executed (_partial.length). 0 = no partial closes done. */
10827
+ totalPartials: number;
10828
+ /** Unrealized PNL at the moment the info event was emitted (from data.pnl) */
10829
+ pnl: IStrategyPnL;
10830
+ /** Profit/loss as percentage (e.g., 1.5 for +1.5%, -2.3 for -2.3%) */
10831
+ pnlPercentage: number;
10832
+ /** Entry price from PNL calculation (effective price adjusted with slippage and fees) */
10833
+ pnlPriceOpen: number;
10834
+ /** Exit price from PNL calculation (adjusted with slippage and fees) */
10835
+ pnlPriceClose: number;
10836
+ /** Absolute profit/loss in USD */
10837
+ pnlCost: number;
10838
+ /** Total invested capital in USD */
10839
+ pnlEntries: number;
10840
+ /** User-defined informational note provided by the strategy */
10841
+ note: string;
10842
+ /** Optional user-defined identifier for correlating this notification with external systems */
10843
+ notificationId?: string;
10844
+ /** Signal creation timestamp in milliseconds (when signal was first created/scheduled) */
10845
+ scheduledAt: number;
10846
+ /** Pending timestamp in milliseconds (when position became pending/active at priceOpen) */
10847
+ pendingAt: number;
10848
+ /** Unix timestamp in milliseconds when the notification was created */
10849
+ createdAt: number;
10850
+ }
10553
10851
  /**
10554
10852
  * Root discriminated union of all notification types.
10555
10853
  * Type discrimination is done via the `type` field.
@@ -10576,7 +10874,7 @@ interface ClosePendingCommitNotification {
10576
10874
  * }
10577
10875
  * ```
10578
10876
  */
10579
- type NotificationModel = SignalOpenedNotification | SignalClosedNotification | PartialProfitAvailableNotification | PartialLossAvailableNotification | BreakevenAvailableNotification | PartialProfitCommitNotification | PartialLossCommitNotification | BreakevenCommitNotification | AverageBuyCommitNotification | ActivateScheduledCommitNotification | TrailingStopCommitNotification | TrailingTakeCommitNotification | CancelScheduledCommitNotification | ClosePendingCommitNotification | SignalSyncOpenNotification | SignalSyncCloseNotification | RiskRejectionNotification | SignalScheduledNotification | SignalCancelledNotification | InfoErrorNotification | CriticalErrorNotification | ValidationErrorNotification;
10877
+ type NotificationModel = SignalOpenedNotification | SignalClosedNotification | PartialProfitAvailableNotification | PartialLossAvailableNotification | BreakevenAvailableNotification | PartialProfitCommitNotification | PartialLossCommitNotification | BreakevenCommitNotification | AverageBuyCommitNotification | ActivateScheduledCommitNotification | TrailingStopCommitNotification | TrailingTakeCommitNotification | CancelScheduledCommitNotification | ClosePendingCommitNotification | SignalSyncOpenNotification | SignalSyncCloseNotification | RiskRejectionNotification | SignalScheduledNotification | SignalCancelledNotification | InfoErrorNotification | CriticalErrorNotification | ValidationErrorNotification | SignalInfoNotification;
10580
10878
 
10581
10879
  /**
10582
10880
  * Unified tick event data for report generation.
@@ -12519,6 +12817,80 @@ declare class PersistMemoryUtils {
12519
12817
  * ```
12520
12818
  */
12521
12819
  declare const PersistMemoryAdapter: PersistMemoryUtils;
12820
+ /**
12821
+ * Type for persisted recent signal data.
12822
+ * Stores the latest active signal per context key.
12823
+ */
12824
+ type RecentData = IPublicSignalRow | null;
12825
+ /**
12826
+ * Utility class for managing recent signal persistence.
12827
+ *
12828
+ * Features:
12829
+ * - Memoized storage instances per (symbol, strategyName, exchangeName, frameName) context
12830
+ * - Custom adapter support
12831
+ * - Atomic read/write operations
12832
+ * - Crash-safe recent signal state management
12833
+ *
12834
+ * Used by RecentPersistBacktestUtils/RecentPersistLiveUtils for recent signal persistence.
12835
+ */
12836
+ declare class PersistRecentUtils {
12837
+ private PersistRecentFactory;
12838
+ private getStorage;
12839
+ private createKeyParts;
12840
+ /**
12841
+ * Registers a custom persistence adapter.
12842
+ *
12843
+ * @param Ctor - Custom PersistBase constructor
12844
+ */
12845
+ usePersistRecentAdapter(Ctor: TPersistBaseCtor<string, IPublicSignalRow>): void;
12846
+ /**
12847
+ * Reads the latest persisted recent signal for a given context.
12848
+ *
12849
+ * Returns null if no recent signal exists.
12850
+ *
12851
+ * @param symbol - Trading pair symbol
12852
+ * @param strategyName - Strategy identifier
12853
+ * @param exchangeName - Exchange identifier
12854
+ * @param frameName - Frame identifier
12855
+ * @returns Promise resolving to recent signal or null
12856
+ */
12857
+ readRecentData: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<IPublicSignalRow | null>;
12858
+ /**
12859
+ * Writes the latest recent signal to disk with atomic file writes.
12860
+ *
12861
+ * Uses symbol as the entity ID within the per-context storage instance.
12862
+ * Uses atomic writes to prevent corruption on crashes.
12863
+ *
12864
+ * @param signalRow - Recent signal data to persist
12865
+ * @param symbol - Trading pair symbol
12866
+ * @param strategyName - Strategy identifier
12867
+ * @param exchangeName - Exchange identifier
12868
+ * @param frameName - Frame identifier
12869
+ * @returns Promise that resolves when write is complete
12870
+ */
12871
+ writeRecentData: (signalRow: IPublicSignalRow, symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<void>;
12872
+ /**
12873
+ * Clears the memoized storage cache.
12874
+ * Call this when process.cwd() changes between strategy iterations
12875
+ * so new storage instances are created with the updated base path.
12876
+ */
12877
+ clear(): void;
12878
+ /**
12879
+ * Switches to the default JSON persist adapter.
12880
+ * All future persistence writes will use JSON storage.
12881
+ */
12882
+ useJson(): void;
12883
+ /**
12884
+ * Switches to a dummy persist adapter that discards all writes.
12885
+ * All future persistence writes will be no-ops.
12886
+ */
12887
+ useDummy(): void;
12888
+ }
12889
+ /**
12890
+ * Global singleton instance of PersistRecentUtils.
12891
+ * Used by RecentPersistBacktestUtils/RecentPersistLiveUtils for recent signal persistence.
12892
+ */
12893
+ declare const PersistRecentAdapter: PersistRecentUtils;
12522
12894
 
12523
12895
  /**
12524
12896
  * Configuration interface for selective markdown service enablement.
@@ -13184,6 +13556,33 @@ declare class MarkdownUtils {
13184
13556
  * ```
13185
13557
  */
13186
13558
  disable: ({ backtest: bt, breakeven, heat, live, partial, performance, risk, strategy, schedule, walker, sync, highest_profit, max_drawdown, }?: Partial<IMarkdownTarget>) => void;
13559
+ /**
13560
+ * Clears markdown report data selectively.
13561
+ *
13562
+ * Clears accumulated data for specified markdown services without unsubscribing.
13563
+ * Use this method to reset report data for specific services while keeping them active.
13564
+ *
13565
+ * Each cleared service will:
13566
+ * - Clear accumulated data for all reports
13567
+ * - Start fresh with new data for future events
13568
+ * - Not affect event subscriptions or report generation status
13569
+ *
13570
+ * @param config - Service configuration object specifying which services to clear. Defaults to clearing all services.
13571
+ * @param config.backtest - Clear backtest result report data
13572
+ * @param config.breakeven - Clear breakeven event tracking data
13573
+ * @param config.partial - Clear partial profit/loss event tracking data
13574
+ * @param config.heat - Clear portfolio heatmap analysis data
13575
+ * @param config.walker - Clear walker strategy comparison report data
13576
+ * @param config.performance - Clear performance bottleneck analysis data
13577
+ * @param config.risk - Clear risk rejection tracking data
13578
+ * @param config.schedule - Clear scheduled signal tracking data
13579
+ * @param config.live - Clear live trading event report data
13580
+ * @param config.strategy - Clear strategy report data
13581
+ * @param config.sync - Clear sync report data
13582
+ * @param config.highest_profit - Clear highest profit report data
13583
+ * @param config.max_drawdown - Clear max drawdown report data
13584
+ */
13585
+ clear: ({ backtest: bt, breakeven, heat, live, partial, performance, risk, strategy, schedule, walker, sync, highest_profit, max_drawdown, }?: Partial<IMarkdownTarget>) => void;
13187
13586
  }
13188
13587
  /**
13189
13588
  * Markdown adapter with pluggable storage backend and instance memoization.
@@ -13216,12 +13615,6 @@ declare class MarkdownAdapter extends MarkdownUtils {
13216
13615
  * All dumps append to a single .jsonl file per markdown type.
13217
13616
  */
13218
13617
  useJsonl(): void;
13219
- /**
13220
- * Clears the memoized storage cache.
13221
- * Call this when process.cwd() changes between strategy iterations
13222
- * so new storage instances are created with the updated base path.
13223
- */
13224
- clear(): void;
13225
13618
  /**
13226
13619
  * Switches to a dummy markdown adapter that discards all writes.
13227
13620
  * All future markdown writes will be no-ops.
@@ -13338,6 +13731,23 @@ declare class LogAdapter implements ILog {
13338
13731
  */
13339
13732
  declare const Log: LogAdapter;
13340
13733
 
13734
+ /** Callable that restores a previously saved subject snapshot */
13735
+ type RestoreSnapshot = () => void;
13736
+ /**
13737
+ * Manages isolation of global event-bus state between backtest sessions.
13738
+ * Allows temporarily detaching all subject subscriptions so that one session
13739
+ * does not interfere with another, then restoring them afterwards.
13740
+ */
13741
+ declare class SessionUtils {
13742
+ /**
13743
+ * Snapshots the current listener state of every global subject by replacing
13744
+ * their internal `_events` map with an empty object.
13745
+ * @returns A restore function that, when called, puts all original listeners back.
13746
+ */
13747
+ createSnapshot: () => RestoreSnapshot;
13748
+ }
13749
+ declare const Session: SessionUtils;
13750
+
13341
13751
  /**
13342
13752
  * Type alias for column configuration used in backtest markdown reports.
13343
13753
  *
@@ -14680,6 +15090,30 @@ declare class BacktestUtils {
14680
15090
  exchangeName: ExchangeName;
14681
15091
  frameName: FrameName;
14682
15092
  }, cost?: number) => Promise<boolean>;
15093
+ /**
15094
+ * Emits a `signal.info` notification for the currently active pending signal.
15095
+ *
15096
+ * @param symbol - Trading pair symbol
15097
+ * @param currentPrice - Market price at the time of the call
15098
+ * @param context - Execution context with strategyName, exchangeName, frameName
15099
+ * @param payload - Optional notification fields (notificationNote, notificationId)
15100
+ *
15101
+ * @throws {Error} If no active pending signal exists for the given symbol
15102
+ *
15103
+ * @example
15104
+ * ```typescript
15105
+ * await Backtest.commitSignalNotify("BTCUSDT", 42000, {
15106
+ * strategyName: "my-strategy",
15107
+ * exchangeName: "binance",
15108
+ * frameName: "1h"
15109
+ * }, { notificationNote: "RSI crossed 70" });
15110
+ * ```
15111
+ */
15112
+ commitSignalNotify: (symbol: string, currentPrice: number, context: {
15113
+ strategyName: StrategyName;
15114
+ exchangeName: ExchangeName;
15115
+ frameName: FrameName;
15116
+ }, payload?: Partial<SignalNotificationPayload>) => Promise<void>;
14683
15117
  /**
14684
15118
  * Gets statistical data from all closed signals for a symbol-strategy pair.
14685
15119
  *
@@ -16092,6 +16526,28 @@ declare class LiveUtils {
16092
16526
  strategyName: StrategyName;
16093
16527
  exchangeName: ExchangeName;
16094
16528
  }, cost?: number) => Promise<boolean>;
16529
+ /**
16530
+ * Emits a `signal.info` notification for the currently active pending signal.
16531
+ *
16532
+ * @param symbol - Trading pair symbol
16533
+ * @param currentPrice - Market price at the time of the call
16534
+ * @param context - Execution context with strategyName and exchangeName
16535
+ * @param payload - Optional notification fields (notificationNote, notificationId)
16536
+ *
16537
+ * @throws {Error} If no active pending signal exists for the given symbol
16538
+ *
16539
+ * @example
16540
+ * ```typescript
16541
+ * await Live.commitSignalNotify("BTCUSDT", 42000, {
16542
+ * strategyName: "my-strategy",
16543
+ * exchangeName: "binance",
16544
+ * }, { notificationNote: "RSI crossed 70" });
16545
+ * ```
16546
+ */
16547
+ commitSignalNotify: (symbol: string, currentPrice: number, context: {
16548
+ strategyName: StrategyName;
16549
+ exchangeName: ExchangeName;
16550
+ }, payload?: Partial<SignalNotificationPayload>) => Promise<void>;
16095
16551
  /**
16096
16552
  * Gets statistical data from all live trading events for a symbol-strategy pair.
16097
16553
  *
@@ -20064,6 +20520,184 @@ declare const StorageLive: StorageLiveAdapter;
20064
20520
  */
20065
20521
  declare const StorageBacktest: StorageBacktestAdapter;
20066
20522
 
20523
+ /**
20524
+ * Base interface for recent signal storage adapters.
20525
+ */
20526
+ interface IRecentUtils {
20527
+ /**
20528
+ * Handles active ping event and persists the latest signal.
20529
+ * @param event - Active ping contract with signal data
20530
+ */
20531
+ handleActivePing(event: ActivePingContract): Promise<void>;
20532
+ /**
20533
+ * Retrieves the latest active signal for the given context.
20534
+ * @param symbol - Trading pair symbol
20535
+ * @param strategyName - Strategy identifier
20536
+ * @param exchangeName - Exchange identifier
20537
+ * @param frameName - Frame identifier
20538
+ * @param backtest - Flag indicating if the context is backtest or live
20539
+ * @returns The latest signal or null if not found
20540
+ */
20541
+ getLatestSignal(symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean): Promise<IPublicSignalRow | null>;
20542
+ }
20543
+ /**
20544
+ * Constructor type for recent signal storage adapters.
20545
+ */
20546
+ type TRecentUtilsCtor = new () => IRecentUtils;
20547
+ /**
20548
+ * Backtest recent signal adapter with pluggable storage backend.
20549
+ *
20550
+ * Features:
20551
+ * - Adapter pattern for swappable storage implementations
20552
+ * - Default adapter: RecentMemoryBacktestUtils (in-memory storage)
20553
+ * - Alternative adapter: RecentPersistBacktestUtils
20554
+ * - Convenience methods: usePersist(), useMemory()
20555
+ */
20556
+ declare class RecentBacktestAdapter implements IRecentUtils {
20557
+ /** Internal storage utils instance */
20558
+ private _recentBacktestUtils;
20559
+ /**
20560
+ * Handles active ping event.
20561
+ * Proxies call to the underlying storage adapter.
20562
+ * @param event - Active ping contract with signal data
20563
+ */
20564
+ handleActivePing: (event: ActivePingContract) => Promise<void>;
20565
+ /**
20566
+ * Retrieves the latest signal for the given context.
20567
+ * Proxies call to the underlying storage adapter.
20568
+ * @param symbol - Trading pair symbol
20569
+ * @param strategyName - Strategy identifier
20570
+ * @param exchangeName - Exchange identifier
20571
+ * @param frameName - Frame identifier
20572
+ * @param backtest - Flag indicating if the context is backtest or live
20573
+ * @returns The latest signal or null if not found
20574
+ */
20575
+ getLatestSignal: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<IPublicSignalRow | null>;
20576
+ /**
20577
+ * Sets the storage adapter constructor.
20578
+ * All future storage operations will use this adapter.
20579
+ * @param Ctor - Constructor for recent adapter
20580
+ */
20581
+ useRecentAdapter: (Ctor: TRecentUtilsCtor) => void;
20582
+ /**
20583
+ * Switches to persistent storage adapter.
20584
+ * Signals will be persisted to disk.
20585
+ */
20586
+ usePersist: () => void;
20587
+ /**
20588
+ * Switches to in-memory storage adapter (default).
20589
+ * Signals will be stored in memory only.
20590
+ */
20591
+ useMemory: () => void;
20592
+ /**
20593
+ * Clears the cached utils instance by resetting to the default in-memory adapter.
20594
+ */
20595
+ clear: () => void;
20596
+ }
20597
+ /**
20598
+ * Live recent signal adapter with pluggable storage backend.
20599
+ *
20600
+ * Features:
20601
+ * - Adapter pattern for swappable storage implementations
20602
+ * - Default adapter: RecentPersistLiveUtils (persistent storage)
20603
+ * - Alternative adapter: RecentMemoryLiveUtils
20604
+ * - Convenience methods: usePersist(), useMemory()
20605
+ */
20606
+ declare class RecentLiveAdapter implements IRecentUtils {
20607
+ /** Internal storage utils instance */
20608
+ private _recentLiveUtils;
20609
+ /**
20610
+ * Handles active ping event.
20611
+ * Proxies call to the underlying storage adapter.
20612
+ * @param event - Active ping contract with signal data
20613
+ */
20614
+ handleActivePing: (event: ActivePingContract) => Promise<void>;
20615
+ /**
20616
+ * Retrieves the latest signal for the given context.
20617
+ * Proxies call to the underlying storage adapter.
20618
+ * @param symbol - Trading pair symbol
20619
+ * @param strategyName - Strategy identifier
20620
+ * @param exchangeName - Exchange identifier
20621
+ * @param frameName - Frame identifier
20622
+ * @param backtest - Flag indicating if the context is backtest or live
20623
+ * @returns The latest signal or null if not found
20624
+ */
20625
+ getLatestSignal: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<IPublicSignalRow | null>;
20626
+ /**
20627
+ * Sets the storage adapter constructor.
20628
+ * All future storage operations will use this adapter.
20629
+ * @param Ctor - Constructor for recent adapter
20630
+ */
20631
+ useRecentAdapter: (Ctor: TRecentUtilsCtor) => void;
20632
+ /**
20633
+ * Switches to persistent storage adapter (default).
20634
+ * Signals will be persisted to disk.
20635
+ */
20636
+ usePersist: () => void;
20637
+ /**
20638
+ * Switches to in-memory storage adapter.
20639
+ * Signals will be stored in memory only.
20640
+ */
20641
+ useMemory: () => void;
20642
+ /**
20643
+ * Clears the cached utils instance by resetting to the default persistent adapter.
20644
+ */
20645
+ clear: () => void;
20646
+ }
20647
+ /**
20648
+ * Main recent signal adapter that manages both backtest and live recent signal storage.
20649
+ *
20650
+ * Features:
20651
+ * - Subscribes to activePingSubject for automatic storage updates
20652
+ * - Provides unified access to the latest signal for any context
20653
+ * - Singleshot enable pattern prevents duplicate subscriptions
20654
+ * - Cleanup function for proper unsubscription
20655
+ */
20656
+ declare class RecentAdapter {
20657
+ /**
20658
+ * Enables recent signal storage by subscribing to activePingSubject.
20659
+ * Uses singleshot to ensure one-time subscription.
20660
+ *
20661
+ * @returns Cleanup function that unsubscribes from all emitters
20662
+ */
20663
+ enable: (() => (...args: any[]) => any) & functools_kit.ISingleshotClearable;
20664
+ /**
20665
+ * Disables recent signal storage by unsubscribing from all emitters.
20666
+ * Safe to call multiple times.
20667
+ */
20668
+ disable: () => void;
20669
+ /**
20670
+ * Retrieves the latest active signal for the given symbol and context.
20671
+ * Searches backtest storage first, then live storage.
20672
+ *
20673
+ * @param symbol - Trading pair symbol
20674
+ * @param context - Execution context with strategyName, exchangeName, and frameName
20675
+ * @param backtest - Flag indicating if the context is backtest or live
20676
+ * @returns The latest signal or null if not found
20677
+ * @throws Error if RecentAdapter is not enabled
20678
+ */
20679
+ getLatestSignal: (symbol: string, context: {
20680
+ strategyName: StrategyName;
20681
+ exchangeName: ExchangeName;
20682
+ frameName: FrameName;
20683
+ }) => Promise<IPublicSignalRow | null>;
20684
+ }
20685
+ /**
20686
+ * Global singleton instance of RecentAdapter.
20687
+ * Provides unified recent signal management for backtest and live trading.
20688
+ */
20689
+ declare const Recent: RecentAdapter;
20690
+ /**
20691
+ * Global singleton instance of RecentLiveAdapter.
20692
+ * Provides live trading recent signal storage with pluggable backends.
20693
+ */
20694
+ declare const RecentLive: RecentLiveAdapter;
20695
+ /**
20696
+ * Global singleton instance of RecentBacktestAdapter.
20697
+ * Provides backtest recent signal storage with pluggable backends.
20698
+ */
20699
+ declare const RecentBacktest: RecentBacktestAdapter;
20700
+
20067
20701
  /**
20068
20702
  * Base interface for notification adapters.
20069
20703
  * All notification adapters must implement this interface.
@@ -20074,6 +20708,7 @@ interface INotificationUtils {
20074
20708
  * @param data - The strategy tick result data
20075
20709
  */
20076
20710
  handleSignal(data: IStrategyTickResult): Promise<void>;
20711
+ handleSignalNotify(data: SignalInfoContract): Promise<void>;
20077
20712
  /**
20078
20713
  * Handles partial profit availability event.
20079
20714
  * @param data - The partial profit contract data
@@ -20152,6 +20787,7 @@ declare class NotificationBacktestAdapter implements INotificationUtils {
20152
20787
  * @param data - The strategy tick result data
20153
20788
  */
20154
20789
  handleSignal: (data: IStrategyTickResult) => Promise<void>;
20790
+ handleSignalNotify: (data: SignalInfoContract) => Promise<void>;
20155
20791
  /**
20156
20792
  * Handles partial profit availability event.
20157
20793
  * Proxies call to the underlying notification adapter.
@@ -20264,6 +20900,7 @@ declare class NotificationLiveAdapter implements INotificationUtils {
20264
20900
  * @param data - The strategy tick result data
20265
20901
  */
20266
20902
  handleSignal: (data: IStrategyTickResult) => Promise<void>;
20903
+ handleSignalNotify: (data: SignalInfoContract) => Promise<void>;
20267
20904
  /**
20268
20905
  * Handles partial profit availability event.
20269
20906
  * Proxies call to the underlying notification adapter.
@@ -21026,6 +21663,7 @@ declare class CacheUtils {
21026
21663
  }) => T & {
21027
21664
  clear(): void;
21028
21665
  gc(): number | undefined;
21666
+ hasValue(...args: Parameters<T>): boolean;
21029
21667
  };
21030
21668
  /**
21031
21669
  * Wrap an async function with persistent file-based caching.
@@ -21071,6 +21709,7 @@ declare class CacheUtils {
21071
21709
  key?: (args: CacheFileKeyArgs<T>) => string;
21072
21710
  }) => T & {
21073
21711
  clear(): Promise<void>;
21712
+ hasValue(...args: Parameters<T>): Promise<boolean>;
21074
21713
  };
21075
21714
  /**
21076
21715
  * Dispose (remove) the memoized CacheFnInstance for a specific function.
@@ -21210,6 +21849,7 @@ declare class IntervalUtils {
21210
21849
  }) => F & {
21211
21850
  clear(): void;
21212
21851
  gc(): number | undefined;
21852
+ hasValue(...args: Parameters<F>): boolean;
21213
21853
  };
21214
21854
  /**
21215
21855
  * Wrap an async signal function with persistent file-based once-per-interval firing.
@@ -21246,6 +21886,7 @@ declare class IntervalUtils {
21246
21886
  key?: (args: IntervalFileKeyArgs<F>) => string;
21247
21887
  }) => F & {
21248
21888
  clear(): Promise<void>;
21889
+ hasValue(...args: Parameters<F>): Promise<boolean>;
21249
21890
  };
21250
21891
  /**
21251
21892
  * Dispose (remove) the memoized `IntervalFnInstance` for a specific function.
@@ -23750,6 +24391,11 @@ declare const highestProfitSubject: Subject<HighestProfitContract>;
23750
24391
  * Allows users to track drawdown levels and implement custom risk management logic based on drawdown thresholds.
23751
24392
  */
23752
24393
  declare const maxDrawdownSubject: Subject<MaxDrawdownContract>;
24394
+ /**
24395
+ * Signal info emitter for user-defined informational notes on open positions.
24396
+ * Emits when a strategy calls commitSignalInfo() to broadcast a custom annotation.
24397
+ */
24398
+ declare const signalNotifySubject: Subject<SignalInfoContract>;
23753
24399
 
23754
24400
  declare const emitters_activePingSubject: typeof activePingSubject;
23755
24401
  declare const emitters_backtestScheduleOpenSubject: typeof backtestScheduleOpenSubject;
@@ -23772,6 +24418,7 @@ declare const emitters_shutdownEmitter: typeof shutdownEmitter;
23772
24418
  declare const emitters_signalBacktestEmitter: typeof signalBacktestEmitter;
23773
24419
  declare const emitters_signalEmitter: typeof signalEmitter;
23774
24420
  declare const emitters_signalLiveEmitter: typeof signalLiveEmitter;
24421
+ declare const emitters_signalNotifySubject: typeof signalNotifySubject;
23775
24422
  declare const emitters_strategyCommitSubject: typeof strategyCommitSubject;
23776
24423
  declare const emitters_syncSubject: typeof syncSubject;
23777
24424
  declare const emitters_validationSubject: typeof validationSubject;
@@ -23779,7 +24426,7 @@ declare const emitters_walkerCompleteSubject: typeof walkerCompleteSubject;
23779
24426
  declare const emitters_walkerEmitter: typeof walkerEmitter;
23780
24427
  declare const emitters_walkerStopSubject: typeof walkerStopSubject;
23781
24428
  declare namespace emitters {
23782
- export { emitters_activePingSubject as activePingSubject, emitters_backtestScheduleOpenSubject as backtestScheduleOpenSubject, emitters_breakevenSubject as breakevenSubject, emitters_doneBacktestSubject as doneBacktestSubject, emitters_doneLiveSubject as doneLiveSubject, emitters_doneWalkerSubject as doneWalkerSubject, emitters_errorEmitter as errorEmitter, emitters_exitEmitter as exitEmitter, emitters_highestProfitSubject as highestProfitSubject, emitters_maxDrawdownSubject as maxDrawdownSubject, emitters_partialLossSubject as partialLossSubject, emitters_partialProfitSubject as partialProfitSubject, emitters_performanceEmitter as performanceEmitter, emitters_progressBacktestEmitter as progressBacktestEmitter, emitters_progressWalkerEmitter as progressWalkerEmitter, emitters_riskSubject as riskSubject, emitters_schedulePingSubject as schedulePingSubject, emitters_shutdownEmitter as shutdownEmitter, emitters_signalBacktestEmitter as signalBacktestEmitter, emitters_signalEmitter as signalEmitter, emitters_signalLiveEmitter as signalLiveEmitter, emitters_strategyCommitSubject as strategyCommitSubject, emitters_syncSubject as syncSubject, emitters_validationSubject as validationSubject, emitters_walkerCompleteSubject as walkerCompleteSubject, emitters_walkerEmitter as walkerEmitter, emitters_walkerStopSubject as walkerStopSubject };
24429
+ export { emitters_activePingSubject as activePingSubject, emitters_backtestScheduleOpenSubject as backtestScheduleOpenSubject, emitters_breakevenSubject as breakevenSubject, emitters_doneBacktestSubject as doneBacktestSubject, emitters_doneLiveSubject as doneLiveSubject, emitters_doneWalkerSubject as doneWalkerSubject, emitters_errorEmitter as errorEmitter, emitters_exitEmitter as exitEmitter, emitters_highestProfitSubject as highestProfitSubject, emitters_maxDrawdownSubject as maxDrawdownSubject, emitters_partialLossSubject as partialLossSubject, emitters_partialProfitSubject as partialProfitSubject, emitters_performanceEmitter as performanceEmitter, emitters_progressBacktestEmitter as progressBacktestEmitter, emitters_progressWalkerEmitter as progressWalkerEmitter, emitters_riskSubject as riskSubject, emitters_schedulePingSubject as schedulePingSubject, emitters_shutdownEmitter as shutdownEmitter, emitters_signalBacktestEmitter as signalBacktestEmitter, emitters_signalEmitter as signalEmitter, emitters_signalLiveEmitter as signalLiveEmitter, emitters_signalNotifySubject as signalNotifySubject, emitters_strategyCommitSubject as strategyCommitSubject, emitters_syncSubject as syncSubject, emitters_validationSubject as validationSubject, emitters_walkerCompleteSubject as walkerCompleteSubject, emitters_walkerEmitter as walkerEmitter, emitters_walkerStopSubject as walkerStopSubject };
23783
24430
  }
23784
24431
 
23785
24432
  /**
@@ -31087,6 +31734,7 @@ declare class MaxDrawdownReportService {
31087
31734
  }
31088
31735
 
31089
31736
  declare const backtest: {
31737
+ notificationHelperService: NotificationHelperService;
31090
31738
  exchangeValidationService: ExchangeValidationService;
31091
31739
  strategyValidationService: StrategyValidationService;
31092
31740
  frameValidationService: FrameValidationService;
@@ -31278,4 +31926,4 @@ declare const getTotalClosed: (signal: Signal) => {
31278
31926
  remainingCostBasis: number;
31279
31927
  };
31280
31928
 
31281
- 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 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 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, 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, 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, getMaxDrawdownDistancePnlCost, getMaxDrawdownDistancePnlPercentage, getMode, getNextCandles, getOrderBook, getPendingSignal, 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, 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 };
31929
+ 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 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 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, PersistRecentAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, 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, 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 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, 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, getMode, getNextCandles, getOrderBook, getPendingSignal, 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, 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, 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, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };