backtest-kit 9.0.2 → 9.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.cjs +215 -108
- package/build/index.mjs +215 -109
- package/package.json +1 -1
- package/types.d.ts +166 -113
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -142,6 +142,95 @@ interface IFrame {
|
|
|
142
142
|
*/
|
|
143
143
|
type FrameName = string;
|
|
144
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Service for tracking the latest candle timestamp per symbol-strategy-exchange-frame combination.
|
|
147
|
+
*
|
|
148
|
+
* Maintains a memoized BehaviorSubject per unique key that is updated on every strategy tick
|
|
149
|
+
* by StrategyConnectionService. Consumers can synchronously read the last known timestamp or
|
|
150
|
+
* await the first value if none has arrived yet.
|
|
151
|
+
*
|
|
152
|
+
* Primary use case: providing the current candle time outside of a tick execution context,
|
|
153
|
+
* e.g., when a command is triggered between ticks.
|
|
154
|
+
*
|
|
155
|
+
* Features:
|
|
156
|
+
* - One BehaviorSubject per (symbol, strategyName, exchangeName, frameName, backtest) key
|
|
157
|
+
* - Falls back to ExecutionContextService.context.when when called inside an execution context
|
|
158
|
+
* - Waits up to LISTEN_TIMEOUT ms for the first timestamp if none is cached yet
|
|
159
|
+
* - clear() disposes the BehaviorSubject for a single key or all keys
|
|
160
|
+
*
|
|
161
|
+
* Architecture:
|
|
162
|
+
* - Registered as singleton in DI container
|
|
163
|
+
* - Updated by StrategyConnectionService after each tick
|
|
164
|
+
* - Cleared by Backtest/Live/Walker at strategy start to prevent stale data
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* const ts = await backtest.timeMetaService.getTimestamp("BTCUSDT", context, false);
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
declare class TimeMetaService {
|
|
172
|
+
private readonly loggerService;
|
|
173
|
+
private readonly executionContextService;
|
|
174
|
+
/**
|
|
175
|
+
* Memoized factory for BehaviorSubject streams keyed by (symbol, strategyName, exchangeName, frameName, backtest).
|
|
176
|
+
*
|
|
177
|
+
* Each subject holds the latest createdAt timestamp emitted by the strategy iterator for that key.
|
|
178
|
+
* Instances are cached until clear() is called.
|
|
179
|
+
*/
|
|
180
|
+
private getSource;
|
|
181
|
+
/**
|
|
182
|
+
* Returns the current candle timestamp (in milliseconds) for the given symbol and context.
|
|
183
|
+
*
|
|
184
|
+
* When called inside an execution context (i.e., during a signal handler or action),
|
|
185
|
+
* reads the timestamp directly from ExecutionContextService.context.when.
|
|
186
|
+
* Otherwise, reads the last value from the cached BehaviorSubject. If no value has
|
|
187
|
+
* been emitted yet, waits up to LISTEN_TIMEOUT ms for the first tick before throwing.
|
|
188
|
+
*
|
|
189
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
190
|
+
* @param context - Strategy, exchange, and frame identifiers
|
|
191
|
+
* @param backtest - True if backtest mode, false if live mode
|
|
192
|
+
* @returns Unix timestamp in milliseconds of the latest processed candle
|
|
193
|
+
* @throws When no timestamp arrives within LISTEN_TIMEOUT ms
|
|
194
|
+
*/
|
|
195
|
+
getTimestamp: (symbol: string, context: {
|
|
196
|
+
strategyName: string;
|
|
197
|
+
exchangeName: string;
|
|
198
|
+
frameName: string;
|
|
199
|
+
}, backtest: boolean) => Promise<number>;
|
|
200
|
+
/**
|
|
201
|
+
* Pushes a new timestamp value into the BehaviorSubject for the given key.
|
|
202
|
+
*
|
|
203
|
+
* Called by StrategyConnectionService after each strategy tick to keep
|
|
204
|
+
* the cached timestamp up to date.
|
|
205
|
+
*
|
|
206
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
207
|
+
* @param timestamp - The createdAt timestamp from the tick (milliseconds)
|
|
208
|
+
* @param context - Strategy, exchange, and frame identifiers
|
|
209
|
+
* @param backtest - True if backtest mode, false if live mode
|
|
210
|
+
*/
|
|
211
|
+
next: (symbol: string, timestamp: number, context: {
|
|
212
|
+
strategyName: string;
|
|
213
|
+
exchangeName: string;
|
|
214
|
+
frameName: string;
|
|
215
|
+
}, backtest: boolean) => Promise<void>;
|
|
216
|
+
/**
|
|
217
|
+
* Disposes cached BehaviorSubject(s) to free memory and prevent stale data.
|
|
218
|
+
*
|
|
219
|
+
* When called without arguments, clears all memoized timestamp streams.
|
|
220
|
+
* When called with a payload, clears only the stream for the specified key.
|
|
221
|
+
* Should be called at strategy start (Backtest/Live/Walker) to reset state.
|
|
222
|
+
*
|
|
223
|
+
* @param payload - Optional key to clear a single stream; omit to clear all
|
|
224
|
+
*/
|
|
225
|
+
clear: (payload?: {
|
|
226
|
+
symbol: string;
|
|
227
|
+
strategyName: string;
|
|
228
|
+
exchangeName: string;
|
|
229
|
+
frameName: string;
|
|
230
|
+
backtest: boolean;
|
|
231
|
+
}) => void;
|
|
232
|
+
}
|
|
233
|
+
|
|
145
234
|
/**
|
|
146
235
|
* Risk rejection result type.
|
|
147
236
|
* Can be void, null, or an IRiskRejectionResult object.
|
|
@@ -281,8 +370,8 @@ interface IRiskParams extends IRiskSchema {
|
|
|
281
370
|
exchangeName: ExchangeName;
|
|
282
371
|
/** Logger service for debug output */
|
|
283
372
|
logger: ILogger;
|
|
284
|
-
/**
|
|
285
|
-
|
|
373
|
+
/** Time context service (when date in backtest/live to prevent look ahead bias) */
|
|
374
|
+
time: TimeMetaService;
|
|
286
375
|
/** True if backtest mode, false if live mode */
|
|
287
376
|
backtest: boolean;
|
|
288
377
|
/**
|
|
@@ -4933,6 +5022,43 @@ declare function getRiskSchema(riskName: RiskName): IRiskSchema;
|
|
|
4933
5022
|
*/
|
|
4934
5023
|
declare function getActionSchema(actionName: ActionName): IActionSchema;
|
|
4935
5024
|
|
|
5025
|
+
/**
|
|
5026
|
+
* Blocks until the schema registries needed to start trading are populated.
|
|
5027
|
+
*
|
|
5028
|
+
* Polls `exchangeValidationService`, `frameValidationService` and
|
|
5029
|
+
* `strategyValidationService` once per second for up to `MAX_WAIT_SECONDS`
|
|
5030
|
+
* seconds. The loop exits as soon as the required registries are non-empty
|
|
5031
|
+
* for the given mode:
|
|
5032
|
+
*
|
|
5033
|
+
* - Backtest mode (`isBacktest = true`): exchange, frame and strategy schemas
|
|
5034
|
+
* must all be registered (frames define the historical window).
|
|
5035
|
+
* - Live mode (`isBacktest = false`): only exchange and strategy schemas are
|
|
5036
|
+
* required — frames are unused.
|
|
5037
|
+
*
|
|
5038
|
+
* Useful at startup when schemas are registered asynchronously (lazy imports,
|
|
5039
|
+
* remote config, plugin loading) and the caller wants to delay `Backtest`/
|
|
5040
|
+
* `Live` invocation until everything is ready. If the timeout elapses without
|
|
5041
|
+
* the registries filling in, the function returns silently — the caller is
|
|
5042
|
+
* expected to surface a clearer error from the subsequent `Backtest`/`Live`
|
|
5043
|
+
* call (e.g. "no strategy registered").
|
|
5044
|
+
*
|
|
5045
|
+
* @param isBacktest - Whether to additionally require a registered frame schema. Defaults to `true`.
|
|
5046
|
+
* @returns Promise that resolves when the registries are ready or the timeout elapses.
|
|
5047
|
+
*
|
|
5048
|
+
* @example
|
|
5049
|
+
* ```typescript
|
|
5050
|
+
* import { waitForReady, Backtest } from "backtest-kit";
|
|
5051
|
+
*
|
|
5052
|
+
* import "./schemas/exchange";
|
|
5053
|
+
* import "./schemas/strategy";
|
|
5054
|
+
* import "./schemas/frame";
|
|
5055
|
+
*
|
|
5056
|
+
* await waitForReady();
|
|
5057
|
+
* Backtest.background("BTCUSDT", { strategyName, exchangeName, frameName });
|
|
5058
|
+
* ```
|
|
5059
|
+
*/
|
|
5060
|
+
declare function waitForReady(isBacktest?: boolean): Promise<void>;
|
|
5061
|
+
|
|
4936
5062
|
/**
|
|
4937
5063
|
* Tolerance zone configuration for DCA overlap detection.
|
|
4938
5064
|
* Percentages are in 0–100 format (e.g. 5 means 5%).
|
|
@@ -13161,16 +13287,18 @@ interface IPersistRiskInstance {
|
|
|
13161
13287
|
/**
|
|
13162
13288
|
* Read persisted active positions for this context.
|
|
13163
13289
|
*
|
|
13290
|
+
* @param when - Logical timestamp at which the read is happening (reserved for API consistency)
|
|
13164
13291
|
* @returns Promise resolving to position entries (empty array if none persisted)
|
|
13165
13292
|
*/
|
|
13166
|
-
readPositionData(): Promise<RiskData>;
|
|
13293
|
+
readPositionData(when: Date): Promise<RiskData>;
|
|
13167
13294
|
/**
|
|
13168
13295
|
* Write active positions for this context.
|
|
13169
13296
|
*
|
|
13170
13297
|
* @param riskRow - Position entries to persist
|
|
13298
|
+
* @param when - Logical timestamp this write belongs to (reserved for API consistency)
|
|
13171
13299
|
* @returns Promise that resolves when write is complete
|
|
13172
13300
|
*/
|
|
13173
|
-
writePositionData(riskRow: RiskData): Promise<void>;
|
|
13301
|
+
writePositionData(riskRow: RiskData, when: Date): Promise<void>;
|
|
13174
13302
|
}
|
|
13175
13303
|
/**
|
|
13176
13304
|
* Default file-based implementation of IPersistRiskInstance.
|
|
@@ -13214,14 +13342,15 @@ declare class PersistRiskInstance implements IPersistRiskInstance {
|
|
|
13214
13342
|
*
|
|
13215
13343
|
* @returns Promise resolving to positions (empty array if none persisted)
|
|
13216
13344
|
*/
|
|
13217
|
-
readPositionData(): Promise<RiskData>;
|
|
13345
|
+
readPositionData(_when: Date): Promise<RiskData>;
|
|
13218
13346
|
/**
|
|
13219
13347
|
* Writes the positions array using the fixed STORAGE_KEY.
|
|
13220
13348
|
*
|
|
13221
13349
|
* @param riskRow - Position entries to persist
|
|
13350
|
+
* @param when - Logical timestamp (reserved for API consistency; not used)
|
|
13222
13351
|
* @returns Promise that resolves when write is complete
|
|
13223
13352
|
*/
|
|
13224
|
-
writePositionData(riskRow: RiskData): Promise<void>;
|
|
13353
|
+
writePositionData(riskRow: RiskData, _when: Date): Promise<void>;
|
|
13225
13354
|
}
|
|
13226
13355
|
/**
|
|
13227
13356
|
* Constructor type for IPersistRiskInstance.
|
|
@@ -13262,9 +13391,10 @@ declare class PersistRiskUtils {
|
|
|
13262
13391
|
*
|
|
13263
13392
|
* @param riskName - Risk profile identifier
|
|
13264
13393
|
* @param exchangeName - Exchange identifier
|
|
13394
|
+
* @param when - Logical timestamp at which the read is happening (reserved for API consistency)
|
|
13265
13395
|
* @returns Promise resolving to position entries (empty array if none)
|
|
13266
13396
|
*/
|
|
13267
|
-
readPositionData: (riskName: RiskName, exchangeName: ExchangeName) => Promise<RiskData>;
|
|
13397
|
+
readPositionData: (riskName: RiskName, exchangeName: ExchangeName, when: Date) => Promise<RiskData>;
|
|
13268
13398
|
/**
|
|
13269
13399
|
* Writes active positions for the given risk context.
|
|
13270
13400
|
* Lazily initializes the instance on first access.
|
|
@@ -13272,9 +13402,10 @@ declare class PersistRiskUtils {
|
|
|
13272
13402
|
* @param riskRow - Position entries to persist
|
|
13273
13403
|
* @param riskName - Risk profile identifier
|
|
13274
13404
|
* @param exchangeName - Exchange identifier
|
|
13405
|
+
* @param when - Logical timestamp this write belongs to (reserved for API consistency)
|
|
13275
13406
|
* @returns Promise that resolves when write is complete
|
|
13276
13407
|
*/
|
|
13277
|
-
writePositionData: (riskRow: RiskData, riskName: RiskName, exchangeName: ExchangeName) => Promise<void>;
|
|
13408
|
+
writePositionData: (riskRow: RiskData, riskName: RiskName, exchangeName: ExchangeName, when: Date) => Promise<void>;
|
|
13278
13409
|
/**
|
|
13279
13410
|
* Clears the memoized instance cache.
|
|
13280
13411
|
* Call when process.cwd() changes between strategy iterations.
|
|
@@ -13503,17 +13634,19 @@ interface IPersistPartialInstance {
|
|
|
13503
13634
|
* Read persisted partial data for a specific signal.
|
|
13504
13635
|
*
|
|
13505
13636
|
* @param signalId - Signal identifier
|
|
13637
|
+
* @param when - Logical timestamp at which the read is happening (reserved for API consistency)
|
|
13506
13638
|
* @returns Promise resolving to partial data record (empty object if none persisted)
|
|
13507
13639
|
*/
|
|
13508
|
-
readPartialData(signalId: string): Promise<PartialData>;
|
|
13640
|
+
readPartialData(signalId: string, when: Date): Promise<PartialData>;
|
|
13509
13641
|
/**
|
|
13510
13642
|
* Write partial data for a specific signal.
|
|
13511
13643
|
*
|
|
13512
13644
|
* @param data - Partial data record to persist
|
|
13513
13645
|
* @param signalId - Signal identifier
|
|
13646
|
+
* @param when - Logical timestamp this write belongs to (reserved for API consistency)
|
|
13514
13647
|
* @returns Promise that resolves when write is complete
|
|
13515
13648
|
*/
|
|
13516
|
-
writePartialData(data: PartialData, signalId: string): Promise<void>;
|
|
13649
|
+
writePartialData(data: PartialData, signalId: string, when: Date): Promise<void>;
|
|
13517
13650
|
}
|
|
13518
13651
|
/**
|
|
13519
13652
|
* Default file-based implementation of IPersistPartialInstance.
|
|
@@ -13558,15 +13691,16 @@ declare class PersistPartialInstance implements IPersistPartialInstance {
|
|
|
13558
13691
|
* @param signalId - Signal identifier
|
|
13559
13692
|
* @returns Promise resolving to partial data record (empty object if not found)
|
|
13560
13693
|
*/
|
|
13561
|
-
readPartialData(signalId: string): Promise<PartialData>;
|
|
13694
|
+
readPartialData(signalId: string, _when: Date): Promise<PartialData>;
|
|
13562
13695
|
/**
|
|
13563
13696
|
* Writes the partial data for the given signal using `signalId` as the entity key.
|
|
13564
13697
|
*
|
|
13565
13698
|
* @param data - Partial data record to persist
|
|
13566
13699
|
* @param signalId - Signal identifier
|
|
13700
|
+
* @param when - Logical timestamp (reserved for API consistency; not used)
|
|
13567
13701
|
* @returns Promise that resolves when write is complete
|
|
13568
13702
|
*/
|
|
13569
|
-
writePartialData(data: PartialData, signalId: string): Promise<void>;
|
|
13703
|
+
writePartialData(data: PartialData, signalId: string, _when: Date): Promise<void>;
|
|
13570
13704
|
}
|
|
13571
13705
|
/**
|
|
13572
13706
|
* Constructor type for IPersistPartialInstance.
|
|
@@ -13610,9 +13744,10 @@ declare class PersistPartialUtils {
|
|
|
13610
13744
|
* @param strategyName - Strategy identifier
|
|
13611
13745
|
* @param signalId - Signal identifier
|
|
13612
13746
|
* @param exchangeName - Exchange identifier
|
|
13747
|
+
* @param when - Logical timestamp at which the read is happening (reserved for API consistency)
|
|
13613
13748
|
* @returns Promise resolving to partial data record (empty object if none)
|
|
13614
13749
|
*/
|
|
13615
|
-
readPartialData: (symbol: string, strategyName: StrategyName, signalId: string, exchangeName: ExchangeName) => Promise<PartialData>;
|
|
13750
|
+
readPartialData: (symbol: string, strategyName: StrategyName, signalId: string, exchangeName: ExchangeName, when: Date) => Promise<PartialData>;
|
|
13616
13751
|
/**
|
|
13617
13752
|
* Writes partial data for the given context and signalId.
|
|
13618
13753
|
* Lazily initializes the instance on first access.
|
|
@@ -13622,9 +13757,10 @@ declare class PersistPartialUtils {
|
|
|
13622
13757
|
* @param strategyName - Strategy identifier
|
|
13623
13758
|
* @param signalId - Signal identifier
|
|
13624
13759
|
* @param exchangeName - Exchange identifier
|
|
13760
|
+
* @param when - Logical timestamp this write belongs to (reserved for API consistency)
|
|
13625
13761
|
* @returns Promise that resolves when write is complete
|
|
13626
13762
|
*/
|
|
13627
|
-
writePartialData: (partialData: PartialData, symbol: string, strategyName: StrategyName, signalId: string, exchangeName: ExchangeName) => Promise<void>;
|
|
13763
|
+
writePartialData: (partialData: PartialData, symbol: string, strategyName: StrategyName, signalId: string, exchangeName: ExchangeName, when: Date) => Promise<void>;
|
|
13628
13764
|
/**
|
|
13629
13765
|
* Clears the memoized instance cache.
|
|
13630
13766
|
* Call when process.cwd() changes between strategy iterations.
|
|
@@ -13683,17 +13819,19 @@ interface IPersistBreakevenInstance {
|
|
|
13683
13819
|
* Read persisted breakeven data for a specific signal.
|
|
13684
13820
|
*
|
|
13685
13821
|
* @param signalId - Signal identifier
|
|
13822
|
+
* @param when - Logical timestamp at which the read is happening (reserved for API consistency)
|
|
13686
13823
|
* @returns Promise resolving to breakeven data record (empty object if none persisted)
|
|
13687
13824
|
*/
|
|
13688
|
-
readBreakevenData(signalId: string): Promise<BreakevenData>;
|
|
13825
|
+
readBreakevenData(signalId: string, when: Date): Promise<BreakevenData>;
|
|
13689
13826
|
/**
|
|
13690
13827
|
* Write breakeven data for a specific signal.
|
|
13691
13828
|
*
|
|
13692
13829
|
* @param data - Breakeven data record to persist
|
|
13693
13830
|
* @param signalId - Signal identifier
|
|
13831
|
+
* @param when - Logical timestamp this write belongs to (reserved for API consistency)
|
|
13694
13832
|
* @returns Promise that resolves when write is complete
|
|
13695
13833
|
*/
|
|
13696
|
-
writeBreakevenData(data: BreakevenData, signalId: string): Promise<void>;
|
|
13834
|
+
writeBreakevenData(data: BreakevenData, signalId: string, when: Date): Promise<void>;
|
|
13697
13835
|
}
|
|
13698
13836
|
/**
|
|
13699
13837
|
* Default file-based implementation of IPersistBreakevenInstance.
|
|
@@ -13738,15 +13876,16 @@ declare class PersistBreakevenInstance implements IPersistBreakevenInstance {
|
|
|
13738
13876
|
* @param signalId - Signal identifier
|
|
13739
13877
|
* @returns Promise resolving to breakeven data record (empty object if not found)
|
|
13740
13878
|
*/
|
|
13741
|
-
readBreakevenData(signalId: string): Promise<BreakevenData>;
|
|
13879
|
+
readBreakevenData(signalId: string, _when: Date): Promise<BreakevenData>;
|
|
13742
13880
|
/**
|
|
13743
13881
|
* Writes the breakeven data for the given signal using `signalId` as the entity key.
|
|
13744
13882
|
*
|
|
13745
13883
|
* @param data - Breakeven data record to persist
|
|
13746
13884
|
* @param signalId - Signal identifier
|
|
13885
|
+
* @param when - Logical timestamp (reserved for API consistency; not used)
|
|
13747
13886
|
* @returns Promise that resolves when write is complete
|
|
13748
13887
|
*/
|
|
13749
|
-
writeBreakevenData(data: BreakevenData, signalId: string): Promise<void>;
|
|
13888
|
+
writeBreakevenData(data: BreakevenData, signalId: string, _when: Date): Promise<void>;
|
|
13750
13889
|
}
|
|
13751
13890
|
/**
|
|
13752
13891
|
* Constructor type for IPersistBreakevenInstance.
|
|
@@ -13810,9 +13949,10 @@ declare class PersistBreakevenUtils {
|
|
|
13810
13949
|
* @param strategyName - Strategy identifier
|
|
13811
13950
|
* @param signalId - Signal identifier
|
|
13812
13951
|
* @param exchangeName - Exchange identifier
|
|
13952
|
+
* @param when - Logical timestamp at which the read is happening (reserved for API consistency)
|
|
13813
13953
|
* @returns Promise resolving to breakeven data record (empty object if none)
|
|
13814
13954
|
*/
|
|
13815
|
-
readBreakevenData: (symbol: string, strategyName: StrategyName, signalId: string, exchangeName: ExchangeName) => Promise<BreakevenData>;
|
|
13955
|
+
readBreakevenData: (symbol: string, strategyName: StrategyName, signalId: string, exchangeName: ExchangeName, when: Date) => Promise<BreakevenData>;
|
|
13816
13956
|
/**
|
|
13817
13957
|
* Writes breakeven data for the given context and signalId.
|
|
13818
13958
|
* Lazily initializes the instance on first access.
|
|
@@ -13822,9 +13962,10 @@ declare class PersistBreakevenUtils {
|
|
|
13822
13962
|
* @param strategyName - Strategy identifier
|
|
13823
13963
|
* @param signalId - Signal identifier
|
|
13824
13964
|
* @param exchangeName - Exchange identifier
|
|
13965
|
+
* @param when - Logical timestamp this write belongs to (reserved for API consistency)
|
|
13825
13966
|
* @returns Promise that resolves when write is complete
|
|
13826
13967
|
*/
|
|
13827
|
-
writeBreakevenData: (breakevenData: BreakevenData, symbol: string, strategyName: StrategyName, signalId: string, exchangeName: ExchangeName) => Promise<void>;
|
|
13968
|
+
writeBreakevenData: (breakevenData: BreakevenData, symbol: string, strategyName: StrategyName, signalId: string, exchangeName: ExchangeName, when: Date) => Promise<void>;
|
|
13828
13969
|
/**
|
|
13829
13970
|
* Clears the memoized instance cache.
|
|
13830
13971
|
* Call when process.cwd() changes between strategy iterations.
|
|
@@ -28907,6 +29048,7 @@ declare class ClientRisk implements IRisk {
|
|
|
28907
29048
|
strategyName: StrategyName;
|
|
28908
29049
|
riskName: RiskName;
|
|
28909
29050
|
exchangeName: ExchangeName;
|
|
29051
|
+
frameName: string;
|
|
28910
29052
|
}): Promise<void>;
|
|
28911
29053
|
/**
|
|
28912
29054
|
* Checks if a signal should be allowed based on risk limits.
|
|
@@ -29330,9 +29472,7 @@ declare class RiskConnectionService implements TRisk$1 {
|
|
|
29330
29472
|
setLogger: (logger: ILogger) => void;
|
|
29331
29473
|
};
|
|
29332
29474
|
readonly riskSchemaService: RiskSchemaService;
|
|
29333
|
-
readonly
|
|
29334
|
-
readonly context: IExecutionContext;
|
|
29335
|
-
};
|
|
29475
|
+
readonly timeMetaService: TimeMetaService;
|
|
29336
29476
|
/**
|
|
29337
29477
|
* Action core service injected from DI container.
|
|
29338
29478
|
*/
|
|
@@ -29492,6 +29632,7 @@ declare class PartialConnectionService implements IPartial {
|
|
|
29492
29632
|
* Action core service injected from DI container.
|
|
29493
29633
|
*/
|
|
29494
29634
|
readonly actionCoreService: ActionCoreService;
|
|
29635
|
+
readonly timeMetaService: TimeMetaService;
|
|
29495
29636
|
/**
|
|
29496
29637
|
* Memoized factory function for ClientPartial instances.
|
|
29497
29638
|
*
|
|
@@ -29608,6 +29749,7 @@ declare class BreakevenConnectionService implements IBreakeven {
|
|
|
29608
29749
|
* Action core service injected from DI container.
|
|
29609
29750
|
*/
|
|
29610
29751
|
readonly actionCoreService: ActionCoreService;
|
|
29752
|
+
readonly timeMetaService: TimeMetaService;
|
|
29611
29753
|
/**
|
|
29612
29754
|
* Memoized factory function for ClientBreakeven instances.
|
|
29613
29755
|
*
|
|
@@ -29653,95 +29795,6 @@ declare class BreakevenConnectionService implements IBreakeven {
|
|
|
29653
29795
|
clear: (symbol: string, data: IPublicSignalRow, priceClose: number, backtest: boolean) => Promise<void>;
|
|
29654
29796
|
}
|
|
29655
29797
|
|
|
29656
|
-
/**
|
|
29657
|
-
* Service for tracking the latest candle timestamp per symbol-strategy-exchange-frame combination.
|
|
29658
|
-
*
|
|
29659
|
-
* Maintains a memoized BehaviorSubject per unique key that is updated on every strategy tick
|
|
29660
|
-
* by StrategyConnectionService. Consumers can synchronously read the last known timestamp or
|
|
29661
|
-
* await the first value if none has arrived yet.
|
|
29662
|
-
*
|
|
29663
|
-
* Primary use case: providing the current candle time outside of a tick execution context,
|
|
29664
|
-
* e.g., when a command is triggered between ticks.
|
|
29665
|
-
*
|
|
29666
|
-
* Features:
|
|
29667
|
-
* - One BehaviorSubject per (symbol, strategyName, exchangeName, frameName, backtest) key
|
|
29668
|
-
* - Falls back to ExecutionContextService.context.when when called inside an execution context
|
|
29669
|
-
* - Waits up to LISTEN_TIMEOUT ms for the first timestamp if none is cached yet
|
|
29670
|
-
* - clear() disposes the BehaviorSubject for a single key or all keys
|
|
29671
|
-
*
|
|
29672
|
-
* Architecture:
|
|
29673
|
-
* - Registered as singleton in DI container
|
|
29674
|
-
* - Updated by StrategyConnectionService after each tick
|
|
29675
|
-
* - Cleared by Backtest/Live/Walker at strategy start to prevent stale data
|
|
29676
|
-
*
|
|
29677
|
-
* @example
|
|
29678
|
-
* ```typescript
|
|
29679
|
-
* const ts = await backtest.timeMetaService.getTimestamp("BTCUSDT", context, false);
|
|
29680
|
-
* ```
|
|
29681
|
-
*/
|
|
29682
|
-
declare class TimeMetaService {
|
|
29683
|
-
private readonly loggerService;
|
|
29684
|
-
private readonly executionContextService;
|
|
29685
|
-
/**
|
|
29686
|
-
* Memoized factory for BehaviorSubject streams keyed by (symbol, strategyName, exchangeName, frameName, backtest).
|
|
29687
|
-
*
|
|
29688
|
-
* Each subject holds the latest createdAt timestamp emitted by the strategy iterator for that key.
|
|
29689
|
-
* Instances are cached until clear() is called.
|
|
29690
|
-
*/
|
|
29691
|
-
private getSource;
|
|
29692
|
-
/**
|
|
29693
|
-
* Returns the current candle timestamp (in milliseconds) for the given symbol and context.
|
|
29694
|
-
*
|
|
29695
|
-
* When called inside an execution context (i.e., during a signal handler or action),
|
|
29696
|
-
* reads the timestamp directly from ExecutionContextService.context.when.
|
|
29697
|
-
* Otherwise, reads the last value from the cached BehaviorSubject. If no value has
|
|
29698
|
-
* been emitted yet, waits up to LISTEN_TIMEOUT ms for the first tick before throwing.
|
|
29699
|
-
*
|
|
29700
|
-
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
29701
|
-
* @param context - Strategy, exchange, and frame identifiers
|
|
29702
|
-
* @param backtest - True if backtest mode, false if live mode
|
|
29703
|
-
* @returns Unix timestamp in milliseconds of the latest processed candle
|
|
29704
|
-
* @throws When no timestamp arrives within LISTEN_TIMEOUT ms
|
|
29705
|
-
*/
|
|
29706
|
-
getTimestamp: (symbol: string, context: {
|
|
29707
|
-
strategyName: string;
|
|
29708
|
-
exchangeName: string;
|
|
29709
|
-
frameName: string;
|
|
29710
|
-
}, backtest: boolean) => Promise<number>;
|
|
29711
|
-
/**
|
|
29712
|
-
* Pushes a new timestamp value into the BehaviorSubject for the given key.
|
|
29713
|
-
*
|
|
29714
|
-
* Called by StrategyConnectionService after each strategy tick to keep
|
|
29715
|
-
* the cached timestamp up to date.
|
|
29716
|
-
*
|
|
29717
|
-
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
29718
|
-
* @param timestamp - The createdAt timestamp from the tick (milliseconds)
|
|
29719
|
-
* @param context - Strategy, exchange, and frame identifiers
|
|
29720
|
-
* @param backtest - True if backtest mode, false if live mode
|
|
29721
|
-
*/
|
|
29722
|
-
next: (symbol: string, timestamp: number, context: {
|
|
29723
|
-
strategyName: string;
|
|
29724
|
-
exchangeName: string;
|
|
29725
|
-
frameName: string;
|
|
29726
|
-
}, backtest: boolean) => Promise<void>;
|
|
29727
|
-
/**
|
|
29728
|
-
* Disposes cached BehaviorSubject(s) to free memory and prevent stale data.
|
|
29729
|
-
*
|
|
29730
|
-
* When called without arguments, clears all memoized timestamp streams.
|
|
29731
|
-
* When called with a payload, clears only the stream for the specified key.
|
|
29732
|
-
* Should be called at strategy start (Backtest/Live/Walker) to reset state.
|
|
29733
|
-
*
|
|
29734
|
-
* @param payload - Optional key to clear a single stream; omit to clear all
|
|
29735
|
-
*/
|
|
29736
|
-
clear: (payload?: {
|
|
29737
|
-
symbol: string;
|
|
29738
|
-
strategyName: string;
|
|
29739
|
-
exchangeName: string;
|
|
29740
|
-
frameName: string;
|
|
29741
|
-
backtest: boolean;
|
|
29742
|
-
}) => void;
|
|
29743
|
-
}
|
|
29744
|
-
|
|
29745
29798
|
/**
|
|
29746
29799
|
* Service for tracking the latest market price per symbol-strategy-exchange-frame combination.
|
|
29747
29800
|
*
|
|
@@ -35834,4 +35887,4 @@ declare const getTotalClosed: (signal: Signal) => {
|
|
|
35834
35887
|
remainingCostBasis: number;
|
|
35835
35888
|
};
|
|
35836
35889
|
|
|
35837
|
-
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 };
|
|
35890
|
+
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, waitForReady, warmCandles, writeMemory };
|