backtest-kit 11.7.0 → 11.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/build/index.cjs +624 -173
- package/build/index.mjs +624 -174
- package/package.json +1 -1
- package/types.d.ts +304 -51
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ type FrameInterval = "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "
|
|
|
73
73
|
interface IFrameParams extends IFrameSchema {
|
|
74
74
|
/** Logger service for debug output */
|
|
75
75
|
logger: ILogger;
|
|
76
|
+
/** Frame name for identification */
|
|
77
|
+
interval: FrameInterval;
|
|
76
78
|
}
|
|
77
79
|
/**
|
|
78
80
|
* Callbacks for frame lifecycle events.
|
|
@@ -113,8 +115,8 @@ interface IFrameSchema {
|
|
|
113
115
|
frameName: FrameName;
|
|
114
116
|
/** Optional developer note for documentation */
|
|
115
117
|
note?: string;
|
|
116
|
-
/** Interval for
|
|
117
|
-
interval
|
|
118
|
+
/** Interval for time range generation. Defaults to "1m" if not specified */
|
|
119
|
+
interval?: FrameInterval;
|
|
118
120
|
/** Start of backtest period (inclusive) */
|
|
119
121
|
startDate: Date;
|
|
120
122
|
/** End of backtest period (inclusive) */
|
|
@@ -1080,6 +1082,12 @@ interface SchedulePingContract {
|
|
|
1080
1082
|
* Identifies which exchange this ping event belongs to.
|
|
1081
1083
|
*/
|
|
1082
1084
|
exchangeName: ExchangeName;
|
|
1085
|
+
/**
|
|
1086
|
+
* Frame name (timeframe / date range) for the run. Empty string in live
|
|
1087
|
+
* mode, where frames are not used. Same value as the monitored signal's
|
|
1088
|
+
* `frameName` (`data.frameName`).
|
|
1089
|
+
*/
|
|
1090
|
+
frameName: FrameName;
|
|
1083
1091
|
/**
|
|
1084
1092
|
* Complete scheduled signal row data.
|
|
1085
1093
|
* Contains all signal information: id, position, priceOpen, priceTakeProfit, priceStopLoss, etc.
|
|
@@ -1161,6 +1169,12 @@ interface ActivePingContract {
|
|
|
1161
1169
|
* Identifies which exchange this ping event belongs to.
|
|
1162
1170
|
*/
|
|
1163
1171
|
exchangeName: ExchangeName;
|
|
1172
|
+
/**
|
|
1173
|
+
* Frame name (timeframe / date range) for the run. Empty string in live
|
|
1174
|
+
* mode, where frames are not used. Same value as the monitored signal's
|
|
1175
|
+
* `frameName` (`data.frameName`).
|
|
1176
|
+
*/
|
|
1177
|
+
frameName: FrameName;
|
|
1164
1178
|
/**
|
|
1165
1179
|
* Complete pending signal row data.
|
|
1166
1180
|
* Contains all signal information: id, position, priceOpen, priceTakeProfit, priceStopLoss, etc.
|
|
@@ -2402,6 +2416,13 @@ interface ActivateScheduledCommit extends SignalCommitBase {
|
|
|
2402
2416
|
*/
|
|
2403
2417
|
type StrategyCommitContract = CancelScheduledCommit | ClosePendingCommit | PartialProfitCommit | PartialLossCommit | TrailingStopCommit | TrailingTakeCommit | BreakevenCommit | AverageBuyCommit | ActivateScheduledCommit;
|
|
2404
2418
|
|
|
2419
|
+
/**
|
|
2420
|
+
* Generic key-value type for strategy runtime data.
|
|
2421
|
+
* Allows strategies to store arbitrary data for custom monitoring, reporting, or external logic.
|
|
2422
|
+
* This is a flexible structure that can hold any additional information a strategy wants to track at runtime.
|
|
2423
|
+
* The content of this object is not defined by the system and can be used freely by strategy implementations.
|
|
2424
|
+
*/
|
|
2425
|
+
type RuntimeData = Record<string, unknown>;
|
|
2405
2426
|
/**
|
|
2406
2427
|
* Commit payload for strategy commits.
|
|
2407
2428
|
* Used in activateScheduled, closePending, cancelScheduled
|
|
@@ -2877,6 +2898,8 @@ interface IStrategySchema {
|
|
|
2877
2898
|
riskList?: RiskName[];
|
|
2878
2899
|
/** Optional list of action identifiers to attach to this strategy */
|
|
2879
2900
|
actions?: ActionName[];
|
|
2901
|
+
/** Optional runtime for custom monitoring, reporting or external logic */
|
|
2902
|
+
info?: RuntimeData;
|
|
2880
2903
|
}
|
|
2881
2904
|
/**
|
|
2882
2905
|
* Reason why signal was closed.
|
|
@@ -9697,6 +9720,42 @@ declare function getNextCandles(symbol: string, interval: CandleInterval, limit:
|
|
|
9697
9720
|
*/
|
|
9698
9721
|
declare function getAggregatedTrades(symbol: string, limit?: number): Promise<IAggregatedTradeData[]>;
|
|
9699
9722
|
|
|
9723
|
+
/**
|
|
9724
|
+
* Interface for runtime information and range used in backtesting and strategy execution.
|
|
9725
|
+
* The interface defines the time range for the backtest while executing a strategy in backtest mode
|
|
9726
|
+
*/
|
|
9727
|
+
interface IRuntimeRange {
|
|
9728
|
+
/** Start date of the runtime range */
|
|
9729
|
+
from: Date;
|
|
9730
|
+
/** End date of the runtime range */
|
|
9731
|
+
to: Date;
|
|
9732
|
+
}
|
|
9733
|
+
/**
|
|
9734
|
+
* Interface for runtime information returned by the RuntimeMetaService.
|
|
9735
|
+
* This includes the symbol being traded, the time range of the backtest, any additional info defined by the strategy,
|
|
9736
|
+
* and contextual information about the exchange, strategy, and frame being used.
|
|
9737
|
+
*/
|
|
9738
|
+
interface IRuntimeInfo<Data extends RuntimeData = RuntimeData> {
|
|
9739
|
+
/** Trading pair symbol (e.g., "BTCUSDT") */
|
|
9740
|
+
symbol: string;
|
|
9741
|
+
/** Time range for the backtest, null if running in live mode */
|
|
9742
|
+
range: IRuntimeRange | null;
|
|
9743
|
+
/** Additional runtime information defined by the strategy, can be used for custom monitoring or reporting */
|
|
9744
|
+
info: Data | null;
|
|
9745
|
+
/** Contextual information about the current execution environment */
|
|
9746
|
+
context: {
|
|
9747
|
+
exchangeName: ExchangeName;
|
|
9748
|
+
strategyName: StrategyName;
|
|
9749
|
+
frameName: FrameName;
|
|
9750
|
+
};
|
|
9751
|
+
/** Timestamp of the current candle or tick */
|
|
9752
|
+
when: Date;
|
|
9753
|
+
/** Current market price for the symbol at the time of execution */
|
|
9754
|
+
currentPrice: number;
|
|
9755
|
+
/** Whether the strategy is running in backtest mode */
|
|
9756
|
+
backtest: boolean;
|
|
9757
|
+
}
|
|
9758
|
+
|
|
9700
9759
|
/**
|
|
9701
9760
|
* Gets the current date from execution context.
|
|
9702
9761
|
*
|
|
@@ -9771,6 +9830,30 @@ declare function getSymbol(): Promise<string>;
|
|
|
9771
9830
|
* ```
|
|
9772
9831
|
*/
|
|
9773
9832
|
declare function getContext(): Promise<IMethodContext>;
|
|
9833
|
+
/**
|
|
9834
|
+
* Gets runtime information about the current execution environment.
|
|
9835
|
+
*
|
|
9836
|
+
* This includes details such as the current symbol, exchange, timeframe, strategy, and whether it's a backtest or live run.
|
|
9837
|
+
*
|
|
9838
|
+
* @returns Promise resolving to an object containing runtime information
|
|
9839
|
+
* @throws Error if method context or execution context is not active
|
|
9840
|
+
*
|
|
9841
|
+
* @example
|
|
9842
|
+
* ```typescript
|
|
9843
|
+
* const runtimeInfo = await getRuntimeInfo();
|
|
9844
|
+
* console.log(runtimeInfo);
|
|
9845
|
+
* // {
|
|
9846
|
+
* // symbol: "BTCUSDT",
|
|
9847
|
+
* // context: {,
|
|
9848
|
+
* // exchangeName: "Binance",
|
|
9849
|
+
* // frameName: "1m",
|
|
9850
|
+
* // strategyName: "MyStrategy",
|
|
9851
|
+
* // },
|
|
9852
|
+
* // backtest: false
|
|
9853
|
+
* // }
|
|
9854
|
+
* ```
|
|
9855
|
+
*/
|
|
9856
|
+
declare function getRuntimeInfo<Data extends RuntimeData = RuntimeData>(): Promise<IRuntimeInfo<Data>>;
|
|
9774
9857
|
|
|
9775
9858
|
type Dispatch$1<Value extends object = object> = (value: Value) => Value | Promise<Value>;
|
|
9776
9859
|
/**
|
|
@@ -26232,6 +26315,12 @@ declare const Interval: IntervalUtils;
|
|
|
26232
26315
|
/**
|
|
26233
26316
|
* Callback signature for a cron entry handler.
|
|
26234
26317
|
*
|
|
26318
|
+
* Receives a single {@link IRuntimeInfo} snapshot assembled by
|
|
26319
|
+
* `RuntimeMetaService.getRuntimeInfo` at the moment the entry fires. It bundles
|
|
26320
|
+
* everything a handler typically needs — symbol, execution context, current
|
|
26321
|
+
* price, backtest range and the strategy-defined `info` payload — so the
|
|
26322
|
+
* handler does not have to re-query the meta-services itself.
|
|
26323
|
+
*
|
|
26235
26324
|
* Invocation cardinality depends on `entry.symbols` (see {@link CronEntry}):
|
|
26236
26325
|
* - **Global mode** (`symbols` empty/undefined): invoked once per aligned
|
|
26237
26326
|
* boundary across all parallel backtests. The first symbol to reach the
|
|
@@ -26240,22 +26329,29 @@ declare const Interval: IntervalUtils;
|
|
|
26240
26329
|
* - **Fan-out mode** (`symbols` non-empty): invoked once per aligned
|
|
26241
26330
|
* boundary **per whitelisted symbol**. Each symbol has its own slot.
|
|
26242
26331
|
*
|
|
26243
|
-
*
|
|
26332
|
+
* Key fields of the {@link IRuntimeInfo} argument:
|
|
26333
|
+
* - `info.symbol` — In global mode: the symbol of the backtest that first
|
|
26244
26334
|
* reached the boundary (the singleshot "winner"). In fan-out mode: the
|
|
26245
26335
|
* whitelisted symbol whose tick produced this invocation.
|
|
26246
|
-
*
|
|
26247
|
-
*
|
|
26248
|
-
*
|
|
26249
|
-
*
|
|
26250
|
-
*
|
|
26251
|
-
*
|
|
26252
|
-
*
|
|
26253
|
-
*
|
|
26254
|
-
*
|
|
26255
|
-
*
|
|
26256
|
-
*
|
|
26257
|
-
|
|
26258
|
-
|
|
26336
|
+
* - `info.context` — `{ strategyName, exchangeName, frameName }` taken from
|
|
26337
|
+
* the originating lifecycle event (`beforeStart` / `idlePing` / `activePing`
|
|
26338
|
+
* / `schedulePing`, wired by {@link CronUtils.enable}).
|
|
26339
|
+
* - `info.backtest` — Execution-mode flag from the same event. `true` for
|
|
26340
|
+
* backtest runs, `false` for live. The value reflects the **opening** tick
|
|
26341
|
+
* that won the singleshot for this slot — all parallel awaiters of the same
|
|
26342
|
+
* slot observe the same value, even if a later concurrent tick carried a
|
|
26343
|
+
* different one.
|
|
26344
|
+
* - `info.range` — Backtest frame range (`from`/`to`), or `null` in live mode.
|
|
26345
|
+
* - `info.currentPrice` — Current market price at snapshot time.
|
|
26346
|
+
* - `info.info` — Strategy-defined runtime payload (`IStrategySchema.info`),
|
|
26347
|
+
* or `null` when the strategy declares none.
|
|
26348
|
+
* - `info.when` — Snapshot time. **Note:** this is the execution-context tick
|
|
26349
|
+
* time captured by `getRuntimeInfo`, not the cron-aligned boundary. The
|
|
26350
|
+
* aligned boundary still governs *when* the entry fires (and is used for the
|
|
26351
|
+
* slot/dedup keys); `info.when` is the wall/virtual time of the underlying
|
|
26352
|
+
* tick that opened the slot.
|
|
26353
|
+
*/
|
|
26354
|
+
type CronCallback = (info: IRuntimeInfo) => void | Promise<void>;
|
|
26259
26355
|
/**
|
|
26260
26356
|
* Configuration for a registered cron entry.
|
|
26261
26357
|
*/
|
|
@@ -26310,7 +26406,7 @@ interface CronEntry {
|
|
|
26310
26406
|
* const dispose = Cron.register({
|
|
26311
26407
|
* name: "x",
|
|
26312
26408
|
* interval: "1h",
|
|
26313
|
-
* handler: async (
|
|
26409
|
+
* handler: async (info) => { ... },
|
|
26314
26410
|
* });
|
|
26315
26411
|
* dispose(); // unregisters
|
|
26316
26412
|
* ```
|
|
@@ -26340,8 +26436,8 @@ interface CronHandle {
|
|
|
26340
26436
|
* Cron.register({
|
|
26341
26437
|
* name: "tg-signal-parser",
|
|
26342
26438
|
* interval: "1h",
|
|
26343
|
-
* handler: async (
|
|
26344
|
-
* await parseTelegramSignalsToMongo(when);
|
|
26439
|
+
* handler: async (info) => {
|
|
26440
|
+
* await parseTelegramSignalsToMongo(info.when);
|
|
26345
26441
|
* },
|
|
26346
26442
|
* });
|
|
26347
26443
|
*
|
|
@@ -26382,12 +26478,15 @@ declare class CronUtils {
|
|
|
26382
26478
|
* - Fire-once global: `${name}:once:g${generation}`.
|
|
26383
26479
|
* - Fire-once fan-out: `${name}:once:${symbol}:g${generation}`.
|
|
26384
26480
|
*
|
|
26385
|
-
* Value is the shared in-flight handler promise.
|
|
26386
|
-
*
|
|
26387
|
-
*
|
|
26388
|
-
*
|
|
26389
|
-
*
|
|
26390
|
-
*
|
|
26481
|
+
* Value is the shared in-flight handler promise. It resolves to a `boolean`
|
|
26482
|
+
* "failed" flag (`true` when the handler — or the runtime-info assembly —
|
|
26483
|
+
* threw), which `_tick` uses to roll back the periodic watermark of the slot
|
|
26484
|
+
* it opened so a failed boundary is retried. Every parallel `tick` for the
|
|
26485
|
+
* same slot key awaits this exact promise (mutex semantics) and is released
|
|
26486
|
+
* together when it settles. `_inFlight` is owned exclusively by `_runEntry` —
|
|
26487
|
+
* `clear()` does **not** touch it, so the singleshot promise survives
|
|
26488
|
+
* concurrent `clear` calls and continues to coordinate parallel ticks until
|
|
26489
|
+
* it settles.
|
|
26391
26490
|
*/
|
|
26392
26491
|
private readonly _inFlight;
|
|
26393
26492
|
/**
|
|
@@ -26431,9 +26530,12 @@ declare class CronUtils {
|
|
|
26431
26530
|
*
|
|
26432
26531
|
* Written synchronously in `_tick` at slot-open time (before the `await`),
|
|
26433
26532
|
* so a still-in-flight handler does not let a later tick re-open the same
|
|
26434
|
-
* (or an already-passed) boundary.
|
|
26435
|
-
*
|
|
26436
|
-
*
|
|
26533
|
+
* (or an already-passed) boundary. If that handler then **fails**, the
|
|
26534
|
+
* advance is rolled back after the slot settles — the prior value is restored
|
|
26535
|
+
* (or the key deleted if there was none) — so the failed boundary is retried
|
|
26536
|
+
* on the next tick, mirroring catch-up of a skipped boundary. Fire-once
|
|
26537
|
+
* entries never touch this map — they use `_firedOnce`. Pruned by
|
|
26538
|
+
* `_clearBoundaryFor` on `register`/`unregister` and wiped by `dispose`.
|
|
26437
26539
|
*/
|
|
26438
26540
|
private readonly _lastBoundary;
|
|
26439
26541
|
/**
|
|
@@ -26459,16 +26561,32 @@ declare class CronUtils {
|
|
|
26459
26561
|
/**
|
|
26460
26562
|
* Build the singleshot promise for a single in-flight slot.
|
|
26461
26563
|
*
|
|
26462
|
-
*
|
|
26463
|
-
*
|
|
26464
|
-
*
|
|
26465
|
-
*
|
|
26466
|
-
*
|
|
26467
|
-
*
|
|
26564
|
+
* Assembles the {@link IRuntimeInfo} snapshot via
|
|
26565
|
+
* `RuntimeMetaService.getRuntimeInfo(symbol, context, backtest)` and invokes
|
|
26566
|
+
* `entry.handler(info)`. Logs any error via `console.error` and **returns** a
|
|
26567
|
+
* `failed` boolean (`true` when the handler — or the runtime-info assembly —
|
|
26568
|
+
* threw) so the caller (`_tick`) can roll back the periodic watermark of the
|
|
26569
|
+
* slot it opened and retry that boundary. The error is **not** rethrown, so a
|
|
26570
|
+
* failing handler never produces an unhandled rejection. Clears the
|
|
26571
|
+
* `_inFlight` slot in `.finally()` so the next boundary produces a fresh
|
|
26572
|
+
* promise. For fire-once entries `firedKey` is added to `_firedOnce` on
|
|
26573
|
+
* success so subsequent ticks skip it.
|
|
26574
|
+
*
|
|
26575
|
+
* `getRuntimeInfo` is the user-facing aggregator: its sub-fetches (range,
|
|
26576
|
+
* info, price) are individually wrapped in `trycatch` with `null` fallbacks,
|
|
26577
|
+
* so it almost never throws for missing data. Whatever does throw — the
|
|
26578
|
+
* handler, or in rare cases `getRuntimeInfo` — is caught here and reported via
|
|
26579
|
+
* the returned `failed` flag; the watermark rollback treats both identically.
|
|
26580
|
+
*
|
|
26581
|
+
* @param context - Strategy/exchange/frame identifiers from the originating
|
|
26582
|
+
* lifecycle event, forwarded to `getRuntimeInfo` to resolve `range`/`info`.
|
|
26468
26583
|
* @param firedKey - Key to add to `_firedOnce` on success, or `null` for
|
|
26469
26584
|
* periodic entries (which never populate `_firedOnce`).
|
|
26470
|
-
* @param backtest -
|
|
26471
|
-
* "winner" tick's flag is what all parallel awaiters
|
|
26585
|
+
* @param backtest - Forwarded to `getRuntimeInfo` and surfaced as
|
|
26586
|
+
* `info.backtest`; the "winner" tick's flag is what all parallel awaiters
|
|
26587
|
+
* of this slot see.
|
|
26588
|
+
* @returns `true` if the handler (or `getRuntimeInfo`) threw, `false` on
|
|
26589
|
+
* success. `_tick` uses this to decide whether to roll back the watermark.
|
|
26472
26590
|
*/
|
|
26473
26591
|
private _runEntry;
|
|
26474
26592
|
/**
|
|
@@ -26488,7 +26606,7 @@ declare class CronUtils {
|
|
|
26488
26606
|
* name: "fetch-funding",
|
|
26489
26607
|
* interval: "8h",
|
|
26490
26608
|
* symbols: ["BTCUSDT", "ETHUSDT"],
|
|
26491
|
-
* handler: async (
|
|
26609
|
+
* handler: async (info) => { ... },
|
|
26492
26610
|
* });
|
|
26493
26611
|
* // Later:
|
|
26494
26612
|
* dispose();
|
|
@@ -26565,7 +26683,7 @@ declare class CronUtils {
|
|
|
26565
26683
|
* 4. **Fire-once** (`entry.interval === undefined`):
|
|
26566
26684
|
* - If the entry's fired-once key is already in `_firedOnce`, skip.
|
|
26567
26685
|
* - Slot key: `${name}:once` (+ scope) (+ gen).
|
|
26568
|
-
* - `
|
|
26686
|
+
* - `alignedMs` = the 1-minute-aligned `when` from step 0 (`ts`).
|
|
26569
26687
|
* 5. **Periodic** (`entry.interval` set):
|
|
26570
26688
|
* - Align `when` to the entry's interval via {@link alignToInterval} to
|
|
26571
26689
|
* get `alignedMs`, the boundary this tick belongs to.
|
|
@@ -26587,26 +26705,37 @@ declare class CronUtils {
|
|
|
26587
26705
|
* handler is still in flight.
|
|
26588
26706
|
* - Slot key: `${name}:${alignedMs}` (+ scope) (+ gen).
|
|
26589
26707
|
* 6. Singleshot per slot key: look up the slot in `_inFlight`. If a promise
|
|
26590
|
-
* already exists, `await` the same promise. Otherwise
|
|
26591
|
-
*
|
|
26592
|
-
*
|
|
26593
|
-
*
|
|
26594
|
-
*
|
|
26708
|
+
* already exists, `await` the same promise. Otherwise open the slot via
|
|
26709
|
+
* {@link _runEntry} — which assembles the {@link IRuntimeInfo} snapshot
|
|
26710
|
+
* (from `symbol`, `context`, `backtest`) and invokes `entry.handler(info)`
|
|
26711
|
+
* — store the promise, and `await` it. The slot is removed in `.finally()`
|
|
26712
|
+
* so the next boundary creates a fresh promise; for fire-once entries the
|
|
26713
|
+
* fired-once key is also added to `_firedOnce` on success so subsequent
|
|
26714
|
+
* ticks skip it.
|
|
26715
|
+
* 7. After `await Promise.all`, roll back the watermark for every **periodic**
|
|
26716
|
+
* slot this tick *opened* (not the ones whose in-flight promise it reused)
|
|
26717
|
+
* whose handler reported failure, so the next tick re-opens and re-runs
|
|
26718
|
+
* that boundary.
|
|
26595
26719
|
*
|
|
26596
26720
|
* Errors thrown by `handler` are caught, logged via `console.error`, and
|
|
26597
26721
|
* **not** rethrown — a failing handler must not break the per-symbol
|
|
26598
26722
|
* tick loop or unblock other parallel backtests with an unhandled
|
|
26599
26723
|
* rejection. A failed fire-once handler is **not** marked as fired and
|
|
26600
|
-
* will retry on the next tick.
|
|
26724
|
+
* will retry on the next tick. A failed **periodic** handler likewise
|
|
26725
|
+
* retries: the boundary watermark advanced at slot-open time is rolled back
|
|
26726
|
+
* after the slot settles (step 7), so the next tick re-opens that boundary.
|
|
26601
26727
|
*
|
|
26602
26728
|
* Requires active method context and execution context.
|
|
26603
26729
|
*
|
|
26604
26730
|
* @param symbol - Trading symbol from the current tick.
|
|
26605
26731
|
* @param when - Virtual time of the current tick.
|
|
26606
26732
|
* @param backtest - `true` for backtest ticks, `false` for live ticks.
|
|
26607
|
-
* Forwarded
|
|
26608
|
-
* from the tick that **opens** a given slot is observed by all
|
|
26609
|
-
* awaiters of that slot.
|
|
26733
|
+
* Forwarded to {@link _runEntry} and surfaced as `info.backtest`. Only the
|
|
26734
|
+
* value from the tick that **opens** a given slot is observed by all
|
|
26735
|
+
* parallel awaiters of that slot.
|
|
26736
|
+
* @param context - Strategy/exchange/frame identifiers from the originating
|
|
26737
|
+
* lifecycle event, forwarded to `RuntimeMetaService.getRuntimeInfo` to
|
|
26738
|
+
* build the {@link IRuntimeInfo} snapshot passed to the handler.
|
|
26610
26739
|
* @throws Error if method or execution context is missing.
|
|
26611
26740
|
*/
|
|
26612
26741
|
private _tick;
|
|
@@ -26623,7 +26752,11 @@ declare class CronUtils {
|
|
|
26623
26752
|
*
|
|
26624
26753
|
* All four subjects are subscribed to a single `singlerun`-wrapped
|
|
26625
26754
|
* handler that builds `_tick(event.symbol, new Date(event.timestamp),
|
|
26626
|
-
* event.backtest
|
|
26755
|
+
* event.backtest, { strategyName, exchangeName, frameName })`. The context
|
|
26756
|
+
* object is read uniformly from the event — every contract carries
|
|
26757
|
+
* `strategyName`, `exchangeName` and `frameName` at the top level (Active /
|
|
26758
|
+
* Schedule contracts gained `frameName` for exactly this reason), so no
|
|
26759
|
+
* per-event branching is needed. `singlerun` merges the four streams into one serial
|
|
26627
26760
|
* queue: at most one `_tick` runs at a time, the next waits. This matters
|
|
26628
26761
|
* because the engine can emit `beforeStart` and an immediate `idlePing`
|
|
26629
26762
|
* on the very same minute, and concurrent `_tick`s on the same
|
|
@@ -26708,7 +26841,7 @@ declare class CronUtils {
|
|
|
26708
26841
|
* Cron.register({
|
|
26709
26842
|
* name: "tg-parser",
|
|
26710
26843
|
* interval: "1h",
|
|
26711
|
-
* handler: async (
|
|
26844
|
+
* handler: async (info) => { ... },
|
|
26712
26845
|
* });
|
|
26713
26846
|
* ```
|
|
26714
26847
|
*/
|
|
@@ -30901,6 +31034,19 @@ declare class PriceMetaService {
|
|
|
30901
31034
|
* Instances are cached until clear() is called.
|
|
30902
31035
|
*/
|
|
30903
31036
|
private getSource;
|
|
31037
|
+
/**
|
|
31038
|
+
* Checks if a price exists for the given key and has emitted at least one value.
|
|
31039
|
+
*
|
|
31040
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
31041
|
+
* @param context - Strategy, exchange, and frame identifiers
|
|
31042
|
+
* @param backtest - True if backtest mode, false if live mode
|
|
31043
|
+
* @returns True if a price exists and has emitted a value, false otherwise
|
|
31044
|
+
*/
|
|
31045
|
+
hasPrice: (symbol: string, context: {
|
|
31046
|
+
strategyName: string;
|
|
31047
|
+
exchangeName: string;
|
|
31048
|
+
frameName: string;
|
|
31049
|
+
}, backtest: boolean) => boolean;
|
|
30904
31050
|
/**
|
|
30905
31051
|
* Returns the current market price for the given symbol and context.
|
|
30906
31052
|
*
|
|
@@ -33018,6 +33164,7 @@ declare class StrategyCoreService implements TStrategy {
|
|
|
33018
33164
|
private readonly strategyValidationService;
|
|
33019
33165
|
private readonly exchangeValidationService;
|
|
33020
33166
|
private readonly frameValidationService;
|
|
33167
|
+
private readonly actionValidationService;
|
|
33021
33168
|
/**
|
|
33022
33169
|
* Validates strategy and associated risk configuration.
|
|
33023
33170
|
*
|
|
@@ -34662,6 +34809,18 @@ declare class WalkerCommandService implements TWalkerLogicPublicService {
|
|
|
34662
34809
|
private readonly strategySchemaService;
|
|
34663
34810
|
private readonly riskValidationService;
|
|
34664
34811
|
private readonly actionValidationService;
|
|
34812
|
+
/**
|
|
34813
|
+
* Validates walker and associated strategy configurations.
|
|
34814
|
+
* Memoized to avoid redundant validations for the same walker-exchange-frame combination.
|
|
34815
|
+
*
|
|
34816
|
+
* Strategy/risk/action validation is performed explicitly here in addition to the
|
|
34817
|
+
* cascade inside WalkerValidationService — this is critical-path code and the
|
|
34818
|
+
* redundant check is intentional defense-in-depth.
|
|
34819
|
+
*
|
|
34820
|
+
* @param context - Context with walkerName, exchangeName and frameName
|
|
34821
|
+
* @param methodName - Name of the calling method for error tracking
|
|
34822
|
+
*/
|
|
34823
|
+
private validate;
|
|
34665
34824
|
/**
|
|
34666
34825
|
* Runs walker comparison for a symbol with context propagation.
|
|
34667
34826
|
*
|
|
@@ -35057,6 +35216,14 @@ declare class LiveCommandService implements TLiveLogicPublicService {
|
|
|
35057
35216
|
private readonly strategySchemaService;
|
|
35058
35217
|
private readonly riskValidationService;
|
|
35059
35218
|
private readonly actionValidationService;
|
|
35219
|
+
/**
|
|
35220
|
+
* Validates strategy and associated risk configuration.
|
|
35221
|
+
* Memoized to avoid redundant validations for the same strategy-exchange combination.
|
|
35222
|
+
*
|
|
35223
|
+
* @param context - Context with strategyName, exchangeName
|
|
35224
|
+
* @param methodName - Name of the calling method for error tracking
|
|
35225
|
+
*/
|
|
35226
|
+
private validate;
|
|
35060
35227
|
/**
|
|
35061
35228
|
* Runs live trading for a symbol with context propagation.
|
|
35062
35229
|
*
|
|
@@ -35105,6 +35272,14 @@ declare class BacktestCommandService implements TBacktestLogicPublicService {
|
|
|
35105
35272
|
private readonly strategyValidationService;
|
|
35106
35273
|
private readonly exchangeValidationService;
|
|
35107
35274
|
private readonly frameValidationService;
|
|
35275
|
+
/**
|
|
35276
|
+
* Validates strategy and associated risk configuration.
|
|
35277
|
+
* Memoized to avoid redundant validations for the same strategy-exchange-frame combination.
|
|
35278
|
+
*
|
|
35279
|
+
* @param context - Context with strategyName, exchangeName and frameName
|
|
35280
|
+
* @param methodName - Name of the calling method for error tracking
|
|
35281
|
+
*/
|
|
35282
|
+
private validate;
|
|
35108
35283
|
/**
|
|
35109
35284
|
* Runs backtest for a symbol with context propagation.
|
|
35110
35285
|
*
|
|
@@ -35341,6 +35516,36 @@ declare class WalkerValidationService {
|
|
|
35341
35516
|
* Injected logger service instance
|
|
35342
35517
|
*/
|
|
35343
35518
|
private readonly loggerService;
|
|
35519
|
+
/**
|
|
35520
|
+
* @private
|
|
35521
|
+
* @readonly
|
|
35522
|
+
* Injected walker schema service instance
|
|
35523
|
+
*/
|
|
35524
|
+
private readonly walkerSchemaService;
|
|
35525
|
+
/**
|
|
35526
|
+
* @private
|
|
35527
|
+
* @readonly
|
|
35528
|
+
* Injected strategy validation service instance
|
|
35529
|
+
*/
|
|
35530
|
+
private readonly strategyValidationService;
|
|
35531
|
+
/**
|
|
35532
|
+
* @private
|
|
35533
|
+
* @readonly
|
|
35534
|
+
* Injected strategy schema service instance
|
|
35535
|
+
*/
|
|
35536
|
+
private readonly strategySchemaService;
|
|
35537
|
+
/**
|
|
35538
|
+
* @private
|
|
35539
|
+
* @readonly
|
|
35540
|
+
* Injected risk validation service instance
|
|
35541
|
+
*/
|
|
35542
|
+
private readonly riskValidationService;
|
|
35543
|
+
/**
|
|
35544
|
+
* @private
|
|
35545
|
+
* @readonly
|
|
35546
|
+
* Injected action validation service instance
|
|
35547
|
+
*/
|
|
35548
|
+
private readonly actionValidationService;
|
|
35344
35549
|
/**
|
|
35345
35550
|
* @private
|
|
35346
35551
|
* Map storing walker schemas by walker name
|
|
@@ -35353,9 +35558,12 @@ declare class WalkerValidationService {
|
|
|
35353
35558
|
*/
|
|
35354
35559
|
addWalker: (walkerName: WalkerName, walkerSchema: IWalkerSchema) => void;
|
|
35355
35560
|
/**
|
|
35356
|
-
* Validates the existence of a walker
|
|
35561
|
+
* Validates the existence of a walker and its associated strategy configurations.
|
|
35562
|
+
* Each strategy referenced by the walker is validated via StrategyValidationService,
|
|
35563
|
+
* which in turn validates the strategy's risk profiles and actions.
|
|
35357
35564
|
* @public
|
|
35358
35565
|
* @throws {Error} If walkerName is not found
|
|
35566
|
+
* @throws {Error} If any referenced strategy (or its risk/actions) is invalid
|
|
35359
35567
|
* Memoized function to cache validation results
|
|
35360
35568
|
*/
|
|
35361
35569
|
validate: (walkerName: WalkerName, source: string) => void;
|
|
@@ -35604,6 +35812,10 @@ declare class PartialGlobalService implements TPartial {
|
|
|
35604
35812
|
* Frame validation service for validating frame existence.
|
|
35605
35813
|
*/
|
|
35606
35814
|
private readonly frameValidationService;
|
|
35815
|
+
/**
|
|
35816
|
+
* Action validation service for validating action existence.
|
|
35817
|
+
*/
|
|
35818
|
+
private readonly actionValidationService;
|
|
35607
35819
|
/**
|
|
35608
35820
|
* Validates strategy and associated risk configuration.
|
|
35609
35821
|
* Memoized to avoid redundant validations for the same strategy-exchange-frame combination.
|
|
@@ -35721,6 +35933,10 @@ declare class BreakevenGlobalService implements TBreakeven {
|
|
|
35721
35933
|
* Frame validation service for validating frame existence.
|
|
35722
35934
|
*/
|
|
35723
35935
|
private readonly frameValidationService;
|
|
35936
|
+
/**
|
|
35937
|
+
* Action validation service for validating frame existence.
|
|
35938
|
+
*/
|
|
35939
|
+
private readonly actionValidationService;
|
|
35724
35940
|
/**
|
|
35725
35941
|
* Validates strategy and associated risk configuration.
|
|
35726
35942
|
* Memoized to avoid redundant validations for the same strategy-exchange-frame combination.
|
|
@@ -36888,6 +37104,43 @@ declare const backtest: {
|
|
|
36888
37104
|
};
|
|
36889
37105
|
getContextTimestamp: () => number;
|
|
36890
37106
|
};
|
|
37107
|
+
runtimeMetaService: {
|
|
37108
|
+
readonly loggerService: {
|
|
37109
|
+
readonly methodContextService: {
|
|
37110
|
+
readonly context: IMethodContext;
|
|
37111
|
+
};
|
|
37112
|
+
readonly executionContextService: {
|
|
37113
|
+
readonly context: IExecutionContext;
|
|
37114
|
+
};
|
|
37115
|
+
_commonLogger: ILogger;
|
|
37116
|
+
readonly _methodContext: {};
|
|
37117
|
+
readonly _executionContext: {};
|
|
37118
|
+
log: (topic: string, ...args: any[]) => Promise<void>;
|
|
37119
|
+
debug: (topic: string, ...args: any[]) => Promise<void>;
|
|
37120
|
+
info: (topic: string, ...args: any[]) => Promise<void>;
|
|
37121
|
+
warn: (topic: string, ...args: any[]) => Promise<void>;
|
|
37122
|
+
setLogger: (logger: ILogger) => void;
|
|
37123
|
+
};
|
|
37124
|
+
readonly timeMetaService: TimeMetaService;
|
|
37125
|
+
readonly priceMetaService: PriceMetaService;
|
|
37126
|
+
readonly frameSchemaService: FrameSchemaService;
|
|
37127
|
+
readonly strategySchemaService: StrategySchemaService;
|
|
37128
|
+
_getRange: ((context: {
|
|
37129
|
+
strategyName: string;
|
|
37130
|
+
exchangeName: string;
|
|
37131
|
+
frameName: string;
|
|
37132
|
+
}, backtest: boolean) => any) & functools_kit.IClearableMemoize<string> & functools_kit.IControlMemoize<string, any>;
|
|
37133
|
+
_getInfo: ((context: {
|
|
37134
|
+
strategyName: string;
|
|
37135
|
+
exchangeName: string;
|
|
37136
|
+
frameName: string;
|
|
37137
|
+
}) => any) & functools_kit.IClearableMemoize<string> & functools_kit.IControlMemoize<string, any>;
|
|
37138
|
+
getRuntimeInfo: <Data extends RuntimeData = RuntimeData>(symbol: string, context: {
|
|
37139
|
+
strategyName: string;
|
|
37140
|
+
exchangeName: string;
|
|
37141
|
+
frameName: string;
|
|
37142
|
+
}, backtest: boolean) => Promise<IRuntimeInfo<Data>>;
|
|
37143
|
+
};
|
|
36891
37144
|
exchangeCoreService: ExchangeCoreService;
|
|
36892
37145
|
strategyCoreService: StrategyCoreService;
|
|
36893
37146
|
actionCoreService: ActionCoreService;
|
|
@@ -37014,4 +37267,4 @@ declare const getTotalClosed: (signal: Signal) => {
|
|
|
37014
37267
|
remainingCostBasis: number;
|
|
37015
37268
|
};
|
|
37016
37269
|
|
|
37017
|
-
export { ActionBase, type ActivateScheduledCommit, type ActivateScheduledCommitNotification, type ActivePingContract, type AfterEndContract, type AverageBuyCommit, type AverageBuyCommitNotification, Backtest, type BacktestStatisticsModel, type BeforeStartContract, 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, Cron, type CronCallback, type CronEntry, type CronHandle, 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, Lookup, 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, beginContext, beginTime, cacheCandles, 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, listenAfterEnd, listenAfterEndOnce, listenBacktestProgress, listenBeforeStart, listenBeforeStartOnce, 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, toPlainString, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, waitForReady, warmCandles, writeMemory };
|
|
37270
|
+
export { ActionBase, type ActivateScheduledCommit, type ActivateScheduledCommitNotification, type ActivePingContract, type AfterEndContract, type AverageBuyCommit, type AverageBuyCommitNotification, Backtest, type BacktestStatisticsModel, type BeforeStartContract, 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, Cron, type CronCallback, type CronEntry, type CronHandle, 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 IRuntimeInfo, type IRuntimeRange, 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, Lookup, 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, type RuntimeData, 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, beginContext, beginTime, cacheCandles, 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, getRuntimeInfo, 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, listenAfterEnd, listenAfterEndOnce, listenBacktestProgress, listenBeforeStart, listenBeforeStartOnce, 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, toPlainString, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, waitForReady, warmCandles, writeMemory };
|