backtest-kit 9.0.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types.d.ts CHANGED
@@ -9593,15 +9593,23 @@ interface IStateInstance {
9593
9593
  waitForInit(initial: boolean): Promise<void>;
9594
9594
  /**
9595
9595
  * Read the current state value.
9596
+ * Returns `initialValue` when the stored `when` is greater than the requested `when`
9597
+ * (look-ahead bias protection).
9598
+ * @param when - Logical timestamp at which the read is happening
9596
9599
  * @returns Current state value
9597
9600
  */
9598
- getState<Value extends object = object>(): Promise<Value>;
9601
+ getState<Value extends object = object>(when: Date): Promise<Value>;
9599
9602
  /**
9600
9603
  * Update the state value.
9604
+ * A write with a smaller `when` overwrites an existing record —
9605
+ * that lets a restarted backtest reset live-written state without breaking live.
9606
+ * The dispatch updater receives the look-ahead-guarded current value
9607
+ * (or `initialValue` when the stored `when` is in the future).
9601
9608
  * @param dispatch - New value or updater function receiving current value
9609
+ * @param when - Logical timestamp this value belongs to
9602
9610
  * @returns Updated state value
9603
9611
  */
9604
- setState<Value extends object = object>(dispatch: Value | Dispatch<Value>): Promise<Value>;
9612
+ setState<Value extends object = object>(dispatch: Value | Dispatch<Value>, when: Date): Promise<Value>;
9605
9613
  /**
9606
9614
  * Releases any resources held by this instance.
9607
9615
  */
@@ -9650,12 +9658,14 @@ declare class StateBacktestAdapter implements TStateAdapter {
9650
9658
  * @param dto.signalId - Signal identifier
9651
9659
  * @param dto.bucketName - Bucket name
9652
9660
  * @param dto.initialValue - Default value when no persisted state exists
9661
+ * @param dto.when - Logical timestamp at which the read is happening (look-ahead guard)
9653
9662
  * @returns Current state value
9654
9663
  */
9655
9664
  getState: <Value extends object = object>(dto: {
9656
9665
  signalId: string;
9657
9666
  bucketName: BucketName;
9658
9667
  initialValue: object;
9668
+ when: Date;
9659
9669
  }) => Promise<Value>;
9660
9670
  /**
9661
9671
  * Update the state value for a signal.
@@ -9663,12 +9673,14 @@ declare class StateBacktestAdapter implements TStateAdapter {
9663
9673
  * @param dto.signalId - Signal identifier
9664
9674
  * @param dto.bucketName - Bucket name
9665
9675
  * @param dto.initialValue - Default value when no persisted state exists
9676
+ * @param dto.when - Logical timestamp this value belongs to
9666
9677
  * @returns Updated state value
9667
9678
  */
9668
9679
  setState: <Value extends object = object>(dispatch: Value | Dispatch<Value>, dto: {
9669
9680
  signalId: string;
9670
9681
  bucketName: BucketName;
9671
9682
  initialValue: object;
9683
+ when: Date;
9672
9684
  }) => Promise<Value>;
9673
9685
  /**
9674
9686
  * Switches to in-memory adapter (default).
@@ -9727,12 +9739,14 @@ declare class StateLiveAdapter implements TStateAdapter {
9727
9739
  * @param dto.signalId - Signal identifier
9728
9740
  * @param dto.bucketName - Bucket name
9729
9741
  * @param dto.initialValue - Default value when no persisted state exists
9742
+ * @param dto.when - Logical timestamp at which the read is happening (look-ahead guard)
9730
9743
  * @returns Current state value
9731
9744
  */
9732
9745
  getState: <Value extends object = object>(dto: {
9733
9746
  signalId: string;
9734
9747
  bucketName: BucketName;
9735
9748
  initialValue: object;
9749
+ when: Date;
9736
9750
  }) => Promise<Value>;
9737
9751
  /**
9738
9752
  * Update the state value for a signal.
@@ -9740,12 +9754,14 @@ declare class StateLiveAdapter implements TStateAdapter {
9740
9754
  * @param dto.signalId - Signal identifier
9741
9755
  * @param dto.bucketName - Bucket name
9742
9756
  * @param dto.initialValue - Default value when no persisted state exists
9757
+ * @param dto.when - Logical timestamp this value belongs to
9743
9758
  * @returns Updated state value
9744
9759
  */
9745
9760
  setState: <Value extends object = object>(dispatch: Value | Dispatch<Value>, dto: {
9746
9761
  signalId: string;
9747
9762
  bucketName: BucketName;
9748
9763
  initialValue: object;
9764
+ when: Date;
9749
9765
  }) => Promise<Value>;
9750
9766
  /**
9751
9767
  * Switches to in-memory adapter.
@@ -9804,6 +9820,7 @@ declare class StateAdapter {
9804
9820
  * @param dto.bucketName - Bucket name
9805
9821
  * @param dto.initialValue - Default value when no persisted state exists
9806
9822
  * @param dto.backtest - Flag indicating if the context is backtest or live
9823
+ * @param dto.when - Logical timestamp at which the read is happening (look-ahead guard)
9807
9824
  * @returns Current state value
9808
9825
  * @throws Error if adapter is not enabled
9809
9826
  */
@@ -9812,6 +9829,7 @@ declare class StateAdapter {
9812
9829
  bucketName: BucketName;
9813
9830
  initialValue: object;
9814
9831
  backtest: boolean;
9832
+ when: Date;
9815
9833
  }) => Promise<Value>;
9816
9834
  /**
9817
9835
  * Update the state value for a signal.
@@ -9821,6 +9839,7 @@ declare class StateAdapter {
9821
9839
  * @param dto.bucketName - Bucket name
9822
9840
  * @param dto.initialValue - Default value when no persisted state exists
9823
9841
  * @param dto.backtest - Flag indicating if the context is backtest or live
9842
+ * @param dto.when - Logical timestamp this value belongs to
9824
9843
  * @returns Updated state value
9825
9844
  * @throws Error if adapter is not enabled
9826
9845
  */
@@ -9829,6 +9848,7 @@ declare class StateAdapter {
9829
9848
  bucketName: BucketName;
9830
9849
  initialValue: object;
9831
9850
  backtest: boolean;
9851
+ when: Date;
9832
9852
  }) => Promise<Value>;
9833
9853
  }
9834
9854
  /**
@@ -12827,6 +12847,7 @@ type MeasureData = {
12827
12847
  type IntervalData = {
12828
12848
  id: string;
12829
12849
  data: unknown;
12850
+ when: Date;
12830
12851
  removed: boolean;
12831
12852
  };
12832
12853
  /**
@@ -14532,7 +14553,7 @@ interface IPersistMeasureInstance {
14532
14553
  * @param key - Cache key within the bucket
14533
14554
  * @returns Promise that resolves when write is complete
14534
14555
  */
14535
- writeMeasureData(data: MeasureData, key: string): Promise<void>;
14556
+ writeMeasureData(data: MeasureData, key: string, when: Date): Promise<void>;
14536
14557
  /**
14537
14558
  * Soft-delete an entry by setting its `removed` flag.
14538
14559
  * File stays on disk, but subsequent reads return null.
@@ -14662,7 +14683,7 @@ declare class PersistMeasureUtils {
14662
14683
  * @param key - Cache key within the bucket
14663
14684
  * @returns Promise that resolves when write is complete
14664
14685
  */
14665
- writeMeasureData: (data: MeasureData, bucket: string, key: string) => Promise<void>;
14686
+ writeMeasureData: (data: MeasureData, bucket: string, key: string, when: Date) => Promise<void>;
14666
14687
  /**
14667
14688
  * Soft-deletes a measure entry in the given bucket by setting `removed: true`.
14668
14689
  * Lazily initializes the bucket instance on first access.
@@ -14732,7 +14753,7 @@ interface IPersistIntervalInstance {
14732
14753
  * @param key - Marker key within the bucket
14733
14754
  * @returns Promise that resolves when write is complete
14734
14755
  */
14735
- writeIntervalData(data: IntervalData, key: string): Promise<void>;
14756
+ writeIntervalData(data: IntervalData, key: string, when: Date): Promise<void>;
14736
14757
  /**
14737
14758
  * Soft-delete a marker. After this call the function will fire again
14738
14759
  * on the next IntervalFileInstance.run call for the same key.
@@ -14859,7 +14880,7 @@ declare class PersistIntervalUtils {
14859
14880
  * @param key - Marker key within the bucket
14860
14881
  * @returns Promise that resolves when write is complete
14861
14882
  */
14862
- writeIntervalData: (data: IntervalData, bucket: string, key: string) => Promise<void>;
14883
+ writeIntervalData: (data: IntervalData, bucket: string, key: string, when: Date) => Promise<void>;
14863
14884
  /**
14864
14885
  * Soft-deletes a marker in the given bucket by setting `removed: true`.
14865
14886
  * Lazily initializes the bucket instance on first access.
@@ -14905,6 +14926,7 @@ type MemoryData = {
14905
14926
  data: object;
14906
14927
  removed: boolean;
14907
14928
  index: string;
14929
+ when: number;
14908
14930
  };
14909
14931
  /**
14910
14932
  * Per-context memory entry persistence instance interface.
@@ -15375,6 +15397,7 @@ declare const PersistRecentAdapter: PersistRecentUtils;
15375
15397
  type StateData = {
15376
15398
  id: string;
15377
15399
  data: object;
15400
+ when: number;
15378
15401
  };
15379
15402
  /**
15380
15403
  * Per-context state persistence instance interface.
@@ -15562,6 +15585,7 @@ declare const PersistStateAdapter: PersistStateUtils;
15562
15585
  type SessionData = {
15563
15586
  id: string;
15564
15587
  data: object | null;
15588
+ when: number;
15565
15589
  };
15566
15590
  /**
15567
15591
  * Per-context session persistence instance interface.
@@ -16628,13 +16652,19 @@ interface ISessionInstance {
16628
16652
  /**
16629
16653
  * Write a new session value.
16630
16654
  * @param value - New value or null to clear
16655
+ * @param when - Logical timestamp this value belongs to.
16656
+ * A write with a smaller `when` overwrites an existing record —
16657
+ * that lets a restarted backtest reset live-written state.
16631
16658
  */
16632
- setData<Value extends object = object>(value: Value | null): Promise<void>;
16659
+ setData<Value extends object = object>(value: Value | null, when: Date): Promise<void>;
16633
16660
  /**
16634
16661
  * Read the current session value.
16635
- * @returns Current session value, or null if not set
16662
+ * Returns null when the stored `when` is greater than the requested `when`
16663
+ * (look-ahead bias protection).
16664
+ * @param when - Logical timestamp at which the read is happening
16665
+ * @returns Current session value, or null if not set / look-ahead
16636
16666
  */
16637
- getData<Value extends object = object>(): Promise<Value | null>;
16667
+ getData<Value extends object = object>(when: Date): Promise<Value | null>;
16638
16668
  /**
16639
16669
  * Releases any resources held by this instance.
16640
16670
  */
@@ -16671,13 +16701,14 @@ declare class SessionBacktestAdapter implements TSessionAdapter {
16671
16701
  * @param context.strategyName - Strategy identifier
16672
16702
  * @param context.exchangeName - Exchange identifier
16673
16703
  * @param context.frameName - Frame identifier
16674
- * @returns Current session value, or null if not set
16704
+ * @param when - Logical timestamp at which the read is happening (look-ahead guard)
16705
+ * @returns Current session value, or null if not set / look-ahead
16675
16706
  */
16676
16707
  getData: <Value extends object = object>(symbol: string, context: {
16677
16708
  strategyName: StrategyName;
16678
16709
  exchangeName: ExchangeName;
16679
16710
  frameName: FrameName;
16680
- }) => Promise<Value | null>;
16711
+ }, when: Date) => Promise<Value | null>;
16681
16712
  /**
16682
16713
  * Update the session value for a backtest run.
16683
16714
  * @param symbol - Trading pair symbol
@@ -16685,12 +16716,13 @@ declare class SessionBacktestAdapter implements TSessionAdapter {
16685
16716
  * @param context.strategyName - Strategy identifier
16686
16717
  * @param context.exchangeName - Exchange identifier
16687
16718
  * @param context.frameName - Frame identifier
16719
+ * @param when - Logical timestamp this value belongs to
16688
16720
  */
16689
16721
  setData: <Value extends object = object>(symbol: string, value: Value | null, context: {
16690
16722
  strategyName: StrategyName;
16691
16723
  exchangeName: ExchangeName;
16692
16724
  frameName: FrameName;
16693
- }) => Promise<void>;
16725
+ }, when: Date) => Promise<void>;
16694
16726
  /**
16695
16727
  * Switches to in-memory adapter (default).
16696
16728
  * All data lives in process memory only.
@@ -16736,13 +16768,14 @@ declare class SessionLiveAdapter implements TSessionAdapter {
16736
16768
  * @param context.strategyName - Strategy identifier
16737
16769
  * @param context.exchangeName - Exchange identifier
16738
16770
  * @param context.frameName - Frame identifier
16739
- * @returns Current session value, or null if not set
16771
+ * @param when - Logical timestamp at which the read is happening (look-ahead guard)
16772
+ * @returns Current session value, or null if not set / look-ahead
16740
16773
  */
16741
16774
  getData: <Value extends object = object>(symbol: string, context: {
16742
16775
  strategyName: StrategyName;
16743
16776
  exchangeName: ExchangeName;
16744
16777
  frameName: FrameName;
16745
- }) => Promise<Value | null>;
16778
+ }, when: Date) => Promise<Value | null>;
16746
16779
  /**
16747
16780
  * Update the session value for a live run.
16748
16781
  * @param symbol - Trading pair symbol
@@ -16750,12 +16783,13 @@ declare class SessionLiveAdapter implements TSessionAdapter {
16750
16783
  * @param context.strategyName - Strategy identifier
16751
16784
  * @param context.exchangeName - Exchange identifier
16752
16785
  * @param context.frameName - Frame identifier
16786
+ * @param when - Logical timestamp this value belongs to
16753
16787
  */
16754
16788
  setData: <Value extends object = object>(symbol: string, value: Value | null, context: {
16755
16789
  strategyName: StrategyName;
16756
16790
  exchangeName: ExchangeName;
16757
16791
  frameName: FrameName;
16758
- }) => Promise<void>;
16792
+ }, when: Date) => Promise<void>;
16759
16793
  /**
16760
16794
  * Switches to in-memory adapter.
16761
16795
  * All data lives in process memory only.
@@ -16797,13 +16831,14 @@ declare class SessionAdapter {
16797
16831
  * @param context.exchangeName - Exchange identifier
16798
16832
  * @param context.frameName - Frame identifier
16799
16833
  * @param backtest - Flag indicating if the context is backtest or live
16800
- * @returns Current session value, or null if not set
16834
+ * @param when - Logical timestamp at which the read is happening (look-ahead guard)
16835
+ * @returns Current session value, or null if not set / look-ahead
16801
16836
  */
16802
16837
  getData: <Value extends object = object>(symbol: string, context: {
16803
16838
  strategyName: StrategyName;
16804
16839
  exchangeName: ExchangeName;
16805
16840
  frameName: FrameName;
16806
- }, backtest: boolean) => Promise<Value | null>;
16841
+ }, backtest: boolean, when: Date) => Promise<Value | null>;
16807
16842
  /**
16808
16843
  * Update the session value for a signal.
16809
16844
  * Routes to SessionBacktest or SessionLive based on backtest.
@@ -16813,12 +16848,13 @@ declare class SessionAdapter {
16813
16848
  * @param context.exchangeName - Exchange identifier
16814
16849
  * @param context.frameName - Frame identifier
16815
16850
  * @param backtest - Flag indicating if the context is backtest or live
16851
+ * @param when - Logical timestamp this value belongs to
16816
16852
  */
16817
16853
  setData: <Value extends object = object>(symbol: string, value: Value | null, context: {
16818
16854
  strategyName: StrategyName;
16819
16855
  exchangeName: ExchangeName;
16820
16856
  frameName: FrameName;
16821
- }, backtest: boolean) => Promise<void>;
16857
+ }, backtest: boolean, when: Date) => Promise<void>;
16822
16858
  }
16823
16859
  /**
16824
16860
  * Global singleton instance of SessionAdapter.
@@ -23707,23 +23743,28 @@ interface IRecentUtils {
23707
23743
  handleActivePing(event: ActivePingContract): Promise<void>;
23708
23744
  /**
23709
23745
  * Retrieves the latest active signal for the given context.
23746
+ * Returns null if the stored signal's `timestamp` is greater than the requested `when`
23747
+ * (look-ahead bias protection).
23710
23748
  * @param symbol - Trading pair symbol
23711
23749
  * @param strategyName - Strategy identifier
23712
23750
  * @param exchangeName - Exchange identifier
23713
23751
  * @param frameName - Frame identifier
23714
23752
  * @param backtest - Flag indicating if the context is backtest or live
23715
- * @returns The latest signal or null if not found
23753
+ * @param when - Logical timestamp at which the read is happening (look-ahead guard)
23754
+ * @returns The latest signal or null if not found / shadowed by look-ahead
23716
23755
  */
23717
- getLatestSignal(symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean): Promise<IPublicSignalRow | null>;
23756
+ getLatestSignal(symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean, when: Date): Promise<IPublicSignalRow | null>;
23718
23757
  /**
23719
23758
  * Returns the number of minutes elapsed since the latest signal's timestamp.
23759
+ * `timestamp` doubles as the look-ahead cutoff — a signal whose `timestamp`
23760
+ * exceeds the requested one is treated as not yet visible.
23761
+ * @param timestamp - Current timestamp in milliseconds (also serves as look-ahead cutoff)
23720
23762
  * @param symbol - Trading pair symbol
23721
23763
  * @param strategyName - Strategy identifier
23722
23764
  * @param exchangeName - Exchange identifier
23723
23765
  * @param frameName - Frame identifier
23724
23766
  * @param backtest - Flag indicating if the context is backtest or live
23725
- * @param currentTimestamp - Current timestamp in milliseconds
23726
- * @returns Minutes since the latest signal, or null if no signal found
23767
+ * @returns Minutes since the latest signal, or null if no signal found / shadowed by look-ahead
23727
23768
  */
23728
23769
  getMinutesSinceLatestSignalCreated(timestamp: number, symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean): Promise<number | null>;
23729
23770
  }
@@ -23757,19 +23798,22 @@ declare class RecentBacktestAdapter implements IRecentUtils {
23757
23798
  * @param exchangeName - Exchange identifier
23758
23799
  * @param frameName - Frame identifier
23759
23800
  * @param backtest - Flag indicating if the context is backtest or live
23760
- * @returns The latest signal or null if not found
23801
+ * @param when - Logical timestamp at which the read is happening (look-ahead guard)
23802
+ * @returns The latest signal or null if not found / shadowed by look-ahead
23761
23803
  */
23762
- getLatestSignal: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<IPublicSignalRow | null>;
23804
+ getLatestSignal: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean, when: Date) => Promise<IPublicSignalRow | null>;
23763
23805
  /**
23764
23806
  * Returns the number of whole minutes elapsed since the latest signal's creation timestamp.
23765
- * Proxies call to the underlying storage adapter.
23766
- * @param timestamp - Current timestamp in milliseconds
23807
+ * Proxies call to the underlying storage adapter. `timestamp` doubles as the
23808
+ * look-ahead cutoff a signal whose `timestamp` exceeds the requested one is
23809
+ * treated as not yet visible.
23810
+ * @param timestamp - Current timestamp in milliseconds (also serves as look-ahead cutoff)
23767
23811
  * @param symbol - Trading pair symbol
23768
23812
  * @param strategyName - Strategy identifier
23769
23813
  * @param exchangeName - Exchange identifier
23770
23814
  * @param frameName - Frame identifier
23771
23815
  * @param backtest - Flag indicating if the context is backtest or live
23772
- * @returns Whole minutes since the latest signal was created, or null if no signal found
23816
+ * @returns Whole minutes since the latest signal was created, or null if no signal found / shadowed by look-ahead
23773
23817
  */
23774
23818
  getMinutesSinceLatestSignalCreated: (timestamp: number, symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<number | null>;
23775
23819
  /**
@@ -23819,19 +23863,22 @@ declare class RecentLiveAdapter implements IRecentUtils {
23819
23863
  * @param exchangeName - Exchange identifier
23820
23864
  * @param frameName - Frame identifier
23821
23865
  * @param backtest - Flag indicating if the context is backtest or live
23822
- * @returns The latest signal or null if not found
23866
+ * @param when - Logical timestamp at which the read is happening (look-ahead guard)
23867
+ * @returns The latest signal or null if not found / shadowed by look-ahead
23823
23868
  */
23824
- getLatestSignal: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<IPublicSignalRow | null>;
23869
+ getLatestSignal: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean, when: Date) => Promise<IPublicSignalRow | null>;
23825
23870
  /**
23826
23871
  * Returns the number of whole minutes elapsed since the latest signal's creation timestamp.
23827
- * Proxies call to the underlying storage adapter.
23828
- * @param timestamp - Current timestamp in milliseconds
23872
+ * Proxies call to the underlying storage adapter. `timestamp` doubles as the
23873
+ * look-ahead cutoff a signal whose `timestamp` exceeds the requested one is
23874
+ * treated as not yet visible.
23875
+ * @param timestamp - Current timestamp in milliseconds (also serves as look-ahead cutoff)
23829
23876
  * @param symbol - Trading pair symbol
23830
23877
  * @param strategyName - Strategy identifier
23831
23878
  * @param exchangeName - Exchange identifier
23832
23879
  * @param frameName - Frame identifier
23833
23880
  * @param backtest - Flag indicating if the context is backtest or live
23834
- * @returns Whole minutes since the latest signal was created, or null if no signal found
23881
+ * @returns Whole minutes since the latest signal was created, or null if no signal found / shadowed by look-ahead
23835
23882
  */
23836
23883
  getMinutesSinceLatestSignalCreated: (timestamp: number, symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<number | null>;
23837
23884
  /**
@@ -23880,32 +23927,37 @@ declare class RecentAdapter {
23880
23927
  /**
23881
23928
  * Retrieves the latest active signal for the given symbol and context.
23882
23929
  * Searches backtest storage first, then live storage.
23930
+ * Returns null if the stored signal's `timestamp` is greater than the requested `when`
23931
+ * (look-ahead bias protection).
23883
23932
  *
23884
23933
  * @param symbol - Trading pair symbol
23885
23934
  * @param context - Execution context with strategyName, exchangeName, and frameName
23886
- * @param backtest - Flag indicating if the context is backtest or live
23887
- * @returns The latest signal or null if not found
23935
+ * @param when - Logical timestamp at which the read is happening (look-ahead guard)
23936
+ * @returns The latest signal or null if not found / shadowed by look-ahead
23888
23937
  * @throws Error if RecentAdapter is not enabled
23889
23938
  */
23890
23939
  getLatestSignal: (symbol: string, context: {
23891
23940
  strategyName: StrategyName;
23892
23941
  exchangeName: ExchangeName;
23893
23942
  frameName: FrameName;
23894
- }) => Promise<IPublicSignalRow | null>;
23943
+ }, when: Date) => Promise<IPublicSignalRow | null>;
23895
23944
  /**
23896
23945
  * Returns the number of whole minutes elapsed since the latest signal's creation timestamp.
23897
23946
  * Searches backtest storage first, then live storage.
23898
- * @param timestamp - Current timestamp in milliseconds
23947
+ * `when` doubles as the look-ahead cutoff — a signal whose `timestamp` exceeds
23948
+ * `when.getTime()` is treated as not yet visible — and as the "now" against
23949
+ * which elapsed minutes are computed.
23899
23950
  * @param symbol - Trading pair symbol
23900
23951
  * @param context - Execution context with strategyName, exchangeName, and frameName
23901
- * @returns Whole minutes since the latest signal was created, or null if no signal found
23952
+ * @param when - Logical timestamp at which the read is happening (look-ahead cutoff + "now")
23953
+ * @returns Whole minutes since the latest signal was created, or null if no signal found / shadowed by look-ahead
23902
23954
  * @throws Error if RecentAdapter is not enabled
23903
23955
  */
23904
23956
  getMinutesSinceLatestSignalCreated: (symbol: string, context: {
23905
23957
  strategyName: StrategyName;
23906
23958
  exchangeName: ExchangeName;
23907
23959
  frameName: FrameName;
23908
- }) => Promise<number | null>;
23960
+ }, when: Date) => Promise<number | null>;
23909
23961
  }
23910
23962
  /**
23911
23963
  * Global singleton instance of RecentAdapter.
@@ -24400,38 +24452,46 @@ interface IMemoryInstance {
24400
24452
  * @param memoryId - Unique entry identifier
24401
24453
  * @param value - Value to store
24402
24454
  * @param description - Optional BM25 index string; defaults to JSON.stringify(value)
24455
+ * @param when - Logical timestamp this entry belongs to (look-ahead guard)
24403
24456
  */
24404
- writeMemory<T extends object = object>(memoryId: string, value: T, description: string): Promise<void>;
24457
+ writeMemory<T extends object = object>(memoryId: string, value: T, description: string, when: Date): Promise<void>;
24405
24458
  /**
24406
24459
  * Search memory using BM25 full-text scoring.
24460
+ * Filters out entries whose `when` is greater than the requested `when`.
24407
24461
  * @param query - Search query string
24462
+ * @param when - Logical timestamp at which the read is happening (look-ahead guard)
24408
24463
  * @returns Array of matching entries with scores
24409
24464
  */
24410
- searchMemory<T extends object = object>(query: string, settings?: SearchSettings): Promise<Array<{
24465
+ searchMemory<T extends object = object>(query: string, when: Date, settings?: SearchSettings): Promise<Array<{
24411
24466
  memoryId: string;
24412
24467
  score: number;
24413
24468
  content: T;
24414
24469
  }>>;
24415
24470
  /**
24416
24471
  * List all entries in memory.
24472
+ * Filters out entries whose `when` is greater than the requested `when`.
24473
+ * @param when - Logical timestamp at which the read is happening (look-ahead guard)
24417
24474
  * @returns Array of all stored entries
24418
24475
  */
24419
- listMemory<T extends object = object>(): Promise<Array<{
24476
+ listMemory<T extends object = object>(when: Date): Promise<Array<{
24420
24477
  memoryId: string;
24421
24478
  content: T;
24422
24479
  }>>;
24423
24480
  /**
24424
24481
  * Remove an entry from memory.
24425
24482
  * @param memoryId - Unique entry identifier
24483
+ * @param when - Logical timestamp (kept for API consistency; removal is by UUID)
24426
24484
  */
24427
- removeMemory(memoryId: string): Promise<void>;
24485
+ removeMemory(memoryId: string, when: Date): Promise<void>;
24428
24486
  /**
24429
24487
  * Read a single entry from memory.
24488
+ * Behaves as not-found if the stored `when` is greater than the requested `when`.
24430
24489
  * @param memoryId - Unique entry identifier
24490
+ * @param when - Logical timestamp at which the read is happening (look-ahead guard)
24431
24491
  * @returns Entry value
24432
- * @throws Error if entry not found
24492
+ * @throws Error if entry not found (or shadowed by look-ahead)
24433
24493
  */
24434
- readMemory<T extends object = object>(memoryId: string): Promise<T>;
24494
+ readMemory<T extends object = object>(memoryId: string, when: Date): Promise<T>;
24435
24495
  /**
24436
24496
  * Releases any resources held by this instance.
24437
24497
  */
@@ -24480,6 +24540,7 @@ declare class MemoryBacktestAdapter implements TMemoryInstance {
24480
24540
  * @param dto.signalId - Signal identifier
24481
24541
  * @param dto.bucketName - Bucket name
24482
24542
  * @param dto.description - BM25 index string; defaults to JSON.stringify(value)
24543
+ * @param dto.when - Logical timestamp this entry belongs to (look-ahead guard)
24483
24544
  */
24484
24545
  writeMemory: <T extends object = object>(dto: {
24485
24546
  memoryId: string;
@@ -24487,18 +24548,21 @@ declare class MemoryBacktestAdapter implements TMemoryInstance {
24487
24548
  signalId: string;
24488
24549
  bucketName: string;
24489
24550
  description: string;
24551
+ when: Date;
24490
24552
  }) => Promise<void>;
24491
24553
  /**
24492
24554
  * Search memory using BM25 full-text scoring.
24493
24555
  * @param dto.query - Search query string
24494
24556
  * @param dto.signalId - Signal identifier
24495
24557
  * @param dto.bucketName - Bucket name
24558
+ * @param dto.when - Logical timestamp at which the search is happening (look-ahead guard)
24496
24559
  * @returns Matching entries sorted by relevance score
24497
24560
  */
24498
24561
  searchMemory: <T extends object = object>(dto: {
24499
24562
  query: string;
24500
24563
  signalId: string;
24501
24564
  bucketName: string;
24565
+ when: Date;
24502
24566
  settings?: SearchSettings;
24503
24567
  }) => Promise<{
24504
24568
  memoryId: string;
@@ -24509,11 +24573,13 @@ declare class MemoryBacktestAdapter implements TMemoryInstance {
24509
24573
  * List all entries in memory.
24510
24574
  * @param dto.signalId - Signal identifier
24511
24575
  * @param dto.bucketName - Bucket name
24576
+ * @param dto.when - Logical timestamp at which the list is happening (look-ahead guard)
24512
24577
  * @returns Array of all stored entries
24513
24578
  */
24514
24579
  listMemory: <T extends object = object>(dto: {
24515
24580
  signalId: string;
24516
24581
  bucketName: string;
24582
+ when: Date;
24517
24583
  }) => Promise<{
24518
24584
  memoryId: string;
24519
24585
  content: T;
@@ -24523,17 +24589,20 @@ declare class MemoryBacktestAdapter implements TMemoryInstance {
24523
24589
  * @param dto.memoryId - Unique entry identifier
24524
24590
  * @param dto.signalId - Signal identifier
24525
24591
  * @param dto.bucketName - Bucket name
24592
+ * @param dto.when - Logical timestamp (kept for API consistency; removal is by UUID)
24526
24593
  */
24527
24594
  removeMemory: (dto: {
24528
24595
  memoryId: string;
24529
24596
  signalId: string;
24530
24597
  bucketName: string;
24598
+ when: Date;
24531
24599
  }) => Promise<void>;
24532
24600
  /**
24533
24601
  * Read a single entry from memory.
24534
24602
  * @param dto.memoryId - Unique entry identifier
24535
24603
  * @param dto.signalId - Signal identifier
24536
24604
  * @param dto.bucketName - Bucket name
24605
+ * @param dto.when - Logical timestamp at which the read is happening (look-ahead guard)
24537
24606
  * @returns Entry value
24538
24607
  * @throws Error if entry not found
24539
24608
  */
@@ -24541,6 +24610,7 @@ declare class MemoryBacktestAdapter implements TMemoryInstance {
24541
24610
  memoryId: string;
24542
24611
  signalId: string;
24543
24612
  bucketName: string;
24613
+ when: Date;
24544
24614
  }) => Promise<T>;
24545
24615
  /**
24546
24616
  * Switches to in-memory BM25 adapter (default).
@@ -24596,6 +24666,7 @@ declare class MemoryLiveAdapter implements TMemoryInstance {
24596
24666
  * @param dto.signalId - Signal identifier
24597
24667
  * @param dto.bucketName - Bucket name
24598
24668
  * @param dto.description - BM25 index string; defaults to JSON.stringify(value)
24669
+ * @param dto.when - Logical timestamp this entry belongs to (look-ahead guard)
24599
24670
  */
24600
24671
  writeMemory: <T extends object = object>(dto: {
24601
24672
  memoryId: string;
@@ -24603,18 +24674,21 @@ declare class MemoryLiveAdapter implements TMemoryInstance {
24603
24674
  signalId: string;
24604
24675
  bucketName: string;
24605
24676
  description: string;
24677
+ when: Date;
24606
24678
  }) => Promise<void>;
24607
24679
  /**
24608
24680
  * Search memory using BM25 full-text scoring.
24609
24681
  * @param dto.query - Search query string
24610
24682
  * @param dto.signalId - Signal identifier
24611
24683
  * @param dto.bucketName - Bucket name
24684
+ * @param dto.when - Logical timestamp at which the search is happening (look-ahead guard)
24612
24685
  * @returns Matching entries sorted by relevance score
24613
24686
  */
24614
24687
  searchMemory: <T extends object = object>(dto: {
24615
24688
  query: string;
24616
24689
  signalId: string;
24617
24690
  bucketName: string;
24691
+ when: Date;
24618
24692
  settings?: SearchSettings;
24619
24693
  }) => Promise<{
24620
24694
  memoryId: string;
@@ -24625,11 +24699,13 @@ declare class MemoryLiveAdapter implements TMemoryInstance {
24625
24699
  * List all entries in memory.
24626
24700
  * @param dto.signalId - Signal identifier
24627
24701
  * @param dto.bucketName - Bucket name
24702
+ * @param dto.when - Logical timestamp at which the list is happening (look-ahead guard)
24628
24703
  * @returns Array of all stored entries
24629
24704
  */
24630
24705
  listMemory: <T extends object = object>(dto: {
24631
24706
  signalId: string;
24632
24707
  bucketName: string;
24708
+ when: Date;
24633
24709
  }) => Promise<{
24634
24710
  memoryId: string;
24635
24711
  content: T;
@@ -24639,17 +24715,20 @@ declare class MemoryLiveAdapter implements TMemoryInstance {
24639
24715
  * @param dto.memoryId - Unique entry identifier
24640
24716
  * @param dto.signalId - Signal identifier
24641
24717
  * @param dto.bucketName - Bucket name
24718
+ * @param dto.when - Logical timestamp (kept for API consistency; removal is by UUID)
24642
24719
  */
24643
24720
  removeMemory: (dto: {
24644
24721
  memoryId: string;
24645
24722
  signalId: string;
24646
24723
  bucketName: string;
24724
+ when: Date;
24647
24725
  }) => Promise<void>;
24648
24726
  /**
24649
24727
  * Read a single entry from memory.
24650
24728
  * @param dto.memoryId - Unique entry identifier
24651
24729
  * @param dto.signalId - Signal identifier
24652
24730
  * @param dto.bucketName - Bucket name
24731
+ * @param dto.when - Logical timestamp at which the read is happening (look-ahead guard)
24653
24732
  * @returns Entry value
24654
24733
  * @throws Error if entry not found
24655
24734
  */
@@ -24657,6 +24736,7 @@ declare class MemoryLiveAdapter implements TMemoryInstance {
24657
24736
  memoryId: string;
24658
24737
  signalId: string;
24659
24738
  bucketName: string;
24739
+ when: Date;
24660
24740
  }) => Promise<T>;
24661
24741
  /**
24662
24742
  * Switches to in-memory BM25 adapter.
@@ -24717,6 +24797,7 @@ declare class MemoryAdapter {
24717
24797
  * @param dto.bucketName - Bucket name
24718
24798
  * @param dto.description - BM25 index string; defaults to JSON.stringify(value)
24719
24799
  * @param dto.backtest - Flag indicating if the context is backtest or live
24800
+ * @param dto.when - Logical timestamp this entry belongs to (look-ahead guard)
24720
24801
  */
24721
24802
  writeMemory: <T extends object = object>(dto: {
24722
24803
  memoryId: string;
@@ -24725,6 +24806,7 @@ declare class MemoryAdapter {
24725
24806
  bucketName: string;
24726
24807
  description: string;
24727
24808
  backtest: boolean;
24809
+ when: Date;
24728
24810
  }) => Promise<void>;
24729
24811
  /**
24730
24812
  * Search memory using BM25 full-text scoring.
@@ -24733,6 +24815,7 @@ declare class MemoryAdapter {
24733
24815
  * @param dto.signalId - Signal identifier
24734
24816
  * @param dto.bucketName - Bucket name
24735
24817
  * @param dto.backtest - Flag indicating if the context is backtest or live
24818
+ * @param dto.when - Logical timestamp at which the search is happening (look-ahead guard)
24736
24819
  * @returns Matching entries sorted by relevance score
24737
24820
  */
24738
24821
  searchMemory: <T extends object = object>(dto: {
@@ -24741,6 +24824,7 @@ declare class MemoryAdapter {
24741
24824
  bucketName: string;
24742
24825
  settings?: SearchSettings;
24743
24826
  backtest: boolean;
24827
+ when: Date;
24744
24828
  }) => Promise<{
24745
24829
  memoryId: string;
24746
24830
  score: number;
@@ -24752,12 +24836,14 @@ declare class MemoryAdapter {
24752
24836
  * @param dto.signalId - Signal identifier
24753
24837
  * @param dto.bucketName - Bucket name
24754
24838
  * @param dto.backtest - Flag indicating if the context is backtest or live
24839
+ * @param dto.when - Logical timestamp at which the list is happening (look-ahead guard)
24755
24840
  * @returns Array of all stored entries
24756
24841
  */
24757
24842
  listMemory: <T extends object = object>(dto: {
24758
24843
  signalId: string;
24759
24844
  bucketName: string;
24760
24845
  backtest: boolean;
24846
+ when: Date;
24761
24847
  }) => Promise<{
24762
24848
  memoryId: string;
24763
24849
  content: T;
@@ -24769,12 +24855,14 @@ declare class MemoryAdapter {
24769
24855
  * @param dto.signalId - Signal identifier
24770
24856
  * @param dto.bucketName - Bucket name
24771
24857
  * @param dto.backtest - Flag indicating if the context is backtest or live
24858
+ * @param dto.when - Logical timestamp (kept for API consistency; removal is by UUID)
24772
24859
  */
24773
24860
  removeMemory: (dto: {
24774
24861
  memoryId: string;
24775
24862
  signalId: string;
24776
24863
  bucketName: string;
24777
24864
  backtest: boolean;
24865
+ when: Date;
24778
24866
  }) => Promise<void>;
24779
24867
  /**
24780
24868
  * Read a single entry from memory.
@@ -24783,6 +24871,7 @@ declare class MemoryAdapter {
24783
24871
  * @param dto.signalId - Signal identifier
24784
24872
  * @param dto.bucketName - Bucket name
24785
24873
  * @param dto.backtest - Flag indicating if the context is backtest or live
24874
+ * @param dto.when - Logical timestamp at which the read is happening (look-ahead guard)
24786
24875
  * @returns Entry value
24787
24876
  * @throws Error if entry not found
24788
24877
  */
@@ -24791,6 +24880,7 @@ declare class MemoryAdapter {
24791
24880
  signalId: string;
24792
24881
  bucketName: string;
24793
24882
  backtest: boolean;
24883
+ when: Date;
24794
24884
  }) => Promise<T>;
24795
24885
  }
24796
24886
  /**
@@ -28052,6 +28142,15 @@ declare namespace emitters {
28052
28142
  */
28053
28143
  declare const alignToInterval: (date: Date, interval: CandleInterval) => Date;
28054
28144
 
28145
+ /**
28146
+ * Returns the step in milliseconds for a given candle interval.
28147
+ * For example, for "15m" interval, it returns 900000 (15 * 60 * 1000).
28148
+ *
28149
+ * @param interval - Candle interval (e.g., "1m", "15m", "1h")
28150
+ * @returns Step in milliseconds corresponding to the interval
28151
+ */
28152
+ declare const intervalStepMs: (interval: CandleInterval) => number;
28153
+
28055
28154
  /**
28056
28155
  * Waits for the next candle interval to start and returns the timestamp of the new candle.
28057
28156
  * @param {CandleInterval} interval - The candle interval (e.g., "1m", "1h") to wait for.
@@ -35727,4 +35826,4 @@ declare const getTotalClosed: (signal: Signal) => {
35727
35826
  remainingCostBasis: number;
35728
35827
  };
35729
35828
 
35730
- 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 IPersistBreakevenInstance, type IPersistCandleInstance, type IPersistIntervalInstance, type IPersistLogInstance, type IPersistMeasureInstance, type IPersistMemoryInstance, type IPersistNotificationInstance, type IPersistPartialInstance, type IPersistRecentInstance, type IPersistRiskInstance, type IPersistScheduleInstance, type IPersistSessionInstance, type IPersistSignalInstance, type IPersistStateInstance, type IPersistStorageInstance, 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, PersistBreakevenInstance, PersistCandleAdapter, PersistCandleInstance, PersistIntervalAdapter, PersistIntervalInstance, PersistLogAdapter, PersistLogInstance, PersistMeasureAdapter, PersistMeasureInstance, PersistMemoryAdapter, PersistMemoryInstance, PersistNotificationAdapter, PersistNotificationInstance, PersistPartialAdapter, PersistPartialInstance, PersistRecentAdapter, PersistRecentInstance, PersistRiskAdapter, PersistRiskInstance, PersistScheduleAdapter, PersistScheduleInstance, PersistSessionAdapter, PersistSessionInstance, PersistSignalAdapter, PersistSignalInstance, PersistStateAdapter, PersistStateInstance, PersistStorageAdapter, PersistStorageInstance, 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 TPersistBreakevenInstanceCtor, type TPersistCandleInstanceCtor, type TPersistIntervalInstanceCtor, type TPersistLogInstanceCtor, type TPersistMeasureInstanceCtor, type TPersistMemoryInstanceCtor, type TPersistNotificationInstanceCtor, type TPersistPartialInstanceCtor, type TPersistRecentInstanceCtor, type TPersistRiskInstanceCtor, type TPersistScheduleInstanceCtor, type TPersistSessionInstanceCtor, type TPersistSignalInstanceCtor, type TPersistStateInstanceCtor, type TPersistStorageInstanceCtor, 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, getClosePrice, 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 };
35829
+ 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 IPersistBreakevenInstance, type IPersistCandleInstance, type IPersistIntervalInstance, type IPersistLogInstance, type IPersistMeasureInstance, type IPersistMemoryInstance, type IPersistNotificationInstance, type IPersistPartialInstance, type IPersistRecentInstance, type IPersistRiskInstance, type IPersistScheduleInstance, type IPersistSessionInstance, type IPersistSignalInstance, type IPersistStateInstance, type IPersistStorageInstance, 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, PersistBreakevenInstance, PersistCandleAdapter, PersistCandleInstance, PersistIntervalAdapter, PersistIntervalInstance, PersistLogAdapter, PersistLogInstance, PersistMeasureAdapter, PersistMeasureInstance, PersistMemoryAdapter, PersistMemoryInstance, PersistNotificationAdapter, PersistNotificationInstance, PersistPartialAdapter, PersistPartialInstance, PersistRecentAdapter, PersistRecentInstance, PersistRiskAdapter, PersistRiskInstance, PersistScheduleAdapter, PersistScheduleInstance, PersistSessionAdapter, PersistSessionInstance, PersistSignalAdapter, PersistSignalInstance, PersistStateAdapter, PersistStateInstance, PersistStorageAdapter, PersistStorageInstance, 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 TPersistBreakevenInstanceCtor, type TPersistCandleInstanceCtor, type TPersistIntervalInstanceCtor, type TPersistLogInstanceCtor, type TPersistMeasureInstanceCtor, type TPersistMemoryInstanceCtor, type TPersistNotificationInstanceCtor, type TPersistPartialInstanceCtor, type TPersistRecentInstanceCtor, type TPersistRiskInstanceCtor, type TPersistScheduleInstanceCtor, type TPersistSessionInstanceCtor, type TPersistSignalInstanceCtor, type TPersistStateInstanceCtor, type TPersistStorageInstanceCtor, 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, getClosePrice, 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, intervalStepMs, 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 };