backtest-kit 11.6.0 → 11.8.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/LICENSE +21 -21
- package/README.md +1996 -1996
- package/build/index.cjs +422 -113
- package/build/index.mjs +422 -113
- package/package.json +86 -86
- package/types.d.ts +205 -48
package/package.json
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "backtest-kit",
|
|
3
|
-
"version": "11.
|
|
4
|
-
"description": "A TypeScript library for trading system backtest",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Petr Tripolsky",
|
|
7
|
-
"email": "tripolskypetr@gmail.com",
|
|
8
|
-
"url": "https://github.com/tripolskypetr"
|
|
9
|
-
},
|
|
10
|
-
"funding": {
|
|
11
|
-
"type": "individual",
|
|
12
|
-
"url": "http://paypal.me/tripolskypetr"
|
|
13
|
-
},
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"homepage": "https://backtest-kit.github.io/documents/article_07_ai_news_trading_signals.html",
|
|
16
|
-
"keywords": [
|
|
17
|
-
"backtesting",
|
|
18
|
-
"backtest",
|
|
19
|
-
"finance",
|
|
20
|
-
"trading",
|
|
21
|
-
"candles",
|
|
22
|
-
"indicators",
|
|
23
|
-
"multi value",
|
|
24
|
-
"multi symbol",
|
|
25
|
-
"framework"
|
|
26
|
-
],
|
|
27
|
-
"files": [
|
|
28
|
-
"build",
|
|
29
|
-
"types.d.ts",
|
|
30
|
-
"README.md"
|
|
31
|
-
],
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "https://github.com/tripolskypetr/backtest-kit",
|
|
35
|
-
"documentation": "https://github.com/tripolskypetr/backtest-kit/tree/master/docs"
|
|
36
|
-
},
|
|
37
|
-
"bugs": {
|
|
38
|
-
"url": "https://github.com/tripolskypetr/backtest-kit/issues"
|
|
39
|
-
},
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "rollup -c",
|
|
42
|
-
"test": "npm run build && node ./test/index.mjs",
|
|
43
|
-
"build:docs": "rimraf docs && mkdir docs && node ./scripts/dts-docs.cjs ./types.d.ts ./docs",
|
|
44
|
-
"docs:gpt": "npm run build && node ./tools/gpt-docs/index.mjs",
|
|
45
|
-
"docs:uml": "npm run build && node ./scripts/uml.mjs",
|
|
46
|
-
"docs:www": "rimraf docs/wwwroot && node ./tools/typedoc-packages-docs/index.mjs && typedoc && node ./tools/typedoc-yandex-metrica/index.mjs",
|
|
47
|
-
"repl": "dotenv -e .env -- npm run build && node -e \"import('./scripts/repl.mjs')\" --interactive"
|
|
48
|
-
},
|
|
49
|
-
"main": "build/index.cjs",
|
|
50
|
-
"module": "build/index.mjs",
|
|
51
|
-
"source": "src/index.ts",
|
|
52
|
-
"types": "./types.d.ts",
|
|
53
|
-
"exports": {
|
|
54
|
-
"require": "./build/index.cjs",
|
|
55
|
-
"types": "./types.d.ts",
|
|
56
|
-
"import": "./build/index.mjs",
|
|
57
|
-
"default": "./build/index.cjs"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"@rollup/plugin-typescript": "11.1.6",
|
|
61
|
-
"@types/node": "22.9.0",
|
|
62
|
-
"glob": "11.0.1",
|
|
63
|
-
"plantuml": "0.0.2",
|
|
64
|
-
"rimraf": "6.0.1",
|
|
65
|
-
"rollup": "3.29.5",
|
|
66
|
-
"rollup-plugin-dts": "6.1.1",
|
|
67
|
-
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
68
|
-
"ts-morph": "27.0.2",
|
|
69
|
-
"tslib": "2.7.0",
|
|
70
|
-
"typedoc": "0.27.9",
|
|
71
|
-
"worker-testbed": "2.0.0"
|
|
72
|
-
},
|
|
73
|
-
"peerDependencies": {
|
|
74
|
-
"typescript": "^5.0.0"
|
|
75
|
-
},
|
|
76
|
-
"dependencies": {
|
|
77
|
-
"di-kit": "^1.1.1",
|
|
78
|
-
"di-scoped": "^1.0.21",
|
|
79
|
-
"di-singleton": "^1.0.5",
|
|
80
|
-
"functools-kit": "^2.3.0",
|
|
81
|
-
"get-moment-stamp": "^2.0.0"
|
|
82
|
-
},
|
|
83
|
-
"publishConfig": {
|
|
84
|
-
"access": "public"
|
|
85
|
-
}
|
|
86
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "backtest-kit",
|
|
3
|
+
"version": "11.8.0",
|
|
4
|
+
"description": "A TypeScript library for trading system backtest",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Petr Tripolsky",
|
|
7
|
+
"email": "tripolskypetr@gmail.com",
|
|
8
|
+
"url": "https://github.com/tripolskypetr"
|
|
9
|
+
},
|
|
10
|
+
"funding": {
|
|
11
|
+
"type": "individual",
|
|
12
|
+
"url": "http://paypal.me/tripolskypetr"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"homepage": "https://backtest-kit.github.io/documents/article_07_ai_news_trading_signals.html",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"backtesting",
|
|
18
|
+
"backtest",
|
|
19
|
+
"finance",
|
|
20
|
+
"trading",
|
|
21
|
+
"candles",
|
|
22
|
+
"indicators",
|
|
23
|
+
"multi value",
|
|
24
|
+
"multi symbol",
|
|
25
|
+
"framework"
|
|
26
|
+
],
|
|
27
|
+
"files": [
|
|
28
|
+
"build",
|
|
29
|
+
"types.d.ts",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/tripolskypetr/backtest-kit",
|
|
35
|
+
"documentation": "https://github.com/tripolskypetr/backtest-kit/tree/master/docs"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/tripolskypetr/backtest-kit/issues"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "rollup -c",
|
|
42
|
+
"test": "npm run build && node ./test/index.mjs",
|
|
43
|
+
"build:docs": "rimraf docs && mkdir docs && node ./scripts/dts-docs.cjs ./types.d.ts ./docs",
|
|
44
|
+
"docs:gpt": "npm run build && node ./tools/gpt-docs/index.mjs",
|
|
45
|
+
"docs:uml": "npm run build && node ./scripts/uml.mjs",
|
|
46
|
+
"docs:www": "rimraf docs/wwwroot && node ./tools/typedoc-packages-docs/index.mjs && typedoc && node ./tools/typedoc-yandex-metrica/index.mjs",
|
|
47
|
+
"repl": "dotenv -e .env -- npm run build && node -e \"import('./scripts/repl.mjs')\" --interactive"
|
|
48
|
+
},
|
|
49
|
+
"main": "build/index.cjs",
|
|
50
|
+
"module": "build/index.mjs",
|
|
51
|
+
"source": "src/index.ts",
|
|
52
|
+
"types": "./types.d.ts",
|
|
53
|
+
"exports": {
|
|
54
|
+
"require": "./build/index.cjs",
|
|
55
|
+
"types": "./types.d.ts",
|
|
56
|
+
"import": "./build/index.mjs",
|
|
57
|
+
"default": "./build/index.cjs"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@rollup/plugin-typescript": "11.1.6",
|
|
61
|
+
"@types/node": "22.9.0",
|
|
62
|
+
"glob": "11.0.1",
|
|
63
|
+
"plantuml": "0.0.2",
|
|
64
|
+
"rimraf": "6.0.1",
|
|
65
|
+
"rollup": "3.29.5",
|
|
66
|
+
"rollup-plugin-dts": "6.1.1",
|
|
67
|
+
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
68
|
+
"ts-morph": "27.0.2",
|
|
69
|
+
"tslib": "2.7.0",
|
|
70
|
+
"typedoc": "0.27.9",
|
|
71
|
+
"worker-testbed": "2.0.0"
|
|
72
|
+
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"typescript": "^5.0.0"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"di-kit": "^1.1.1",
|
|
78
|
+
"di-scoped": "^1.0.21",
|
|
79
|
+
"di-singleton": "^1.0.5",
|
|
80
|
+
"functools-kit": "^2.3.0",
|
|
81
|
+
"get-moment-stamp": "^2.0.0"
|
|
82
|
+
},
|
|
83
|
+
"publishConfig": {
|
|
84
|
+
"access": "public"
|
|
85
|
+
}
|
|
86
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -1080,6 +1080,12 @@ interface SchedulePingContract {
|
|
|
1080
1080
|
* Identifies which exchange this ping event belongs to.
|
|
1081
1081
|
*/
|
|
1082
1082
|
exchangeName: ExchangeName;
|
|
1083
|
+
/**
|
|
1084
|
+
* Frame name (timeframe / date range) for the run. Empty string in live
|
|
1085
|
+
* mode, where frames are not used. Same value as the monitored signal's
|
|
1086
|
+
* `frameName` (`data.frameName`).
|
|
1087
|
+
*/
|
|
1088
|
+
frameName: FrameName;
|
|
1083
1089
|
/**
|
|
1084
1090
|
* Complete scheduled signal row data.
|
|
1085
1091
|
* Contains all signal information: id, position, priceOpen, priceTakeProfit, priceStopLoss, etc.
|
|
@@ -1161,6 +1167,12 @@ interface ActivePingContract {
|
|
|
1161
1167
|
* Identifies which exchange this ping event belongs to.
|
|
1162
1168
|
*/
|
|
1163
1169
|
exchangeName: ExchangeName;
|
|
1170
|
+
/**
|
|
1171
|
+
* Frame name (timeframe / date range) for the run. Empty string in live
|
|
1172
|
+
* mode, where frames are not used. Same value as the monitored signal's
|
|
1173
|
+
* `frameName` (`data.frameName`).
|
|
1174
|
+
*/
|
|
1175
|
+
frameName: FrameName;
|
|
1164
1176
|
/**
|
|
1165
1177
|
* Complete pending signal row data.
|
|
1166
1178
|
* Contains all signal information: id, position, priceOpen, priceTakeProfit, priceStopLoss, etc.
|
|
@@ -2402,6 +2414,13 @@ interface ActivateScheduledCommit extends SignalCommitBase {
|
|
|
2402
2414
|
*/
|
|
2403
2415
|
type StrategyCommitContract = CancelScheduledCommit | ClosePendingCommit | PartialProfitCommit | PartialLossCommit | TrailingStopCommit | TrailingTakeCommit | BreakevenCommit | AverageBuyCommit | ActivateScheduledCommit;
|
|
2404
2416
|
|
|
2417
|
+
/**
|
|
2418
|
+
* Generic key-value type for strategy runtime data.
|
|
2419
|
+
* Allows strategies to store arbitrary data for custom monitoring, reporting, or external logic.
|
|
2420
|
+
* This is a flexible structure that can hold any additional information a strategy wants to track at runtime.
|
|
2421
|
+
* The content of this object is not defined by the system and can be used freely by strategy implementations.
|
|
2422
|
+
*/
|
|
2423
|
+
type RuntimeData = Record<string, unknown>;
|
|
2405
2424
|
/**
|
|
2406
2425
|
* Commit payload for strategy commits.
|
|
2407
2426
|
* Used in activateScheduled, closePending, cancelScheduled
|
|
@@ -2877,6 +2896,8 @@ interface IStrategySchema {
|
|
|
2877
2896
|
riskList?: RiskName[];
|
|
2878
2897
|
/** Optional list of action identifiers to attach to this strategy */
|
|
2879
2898
|
actions?: ActionName[];
|
|
2899
|
+
/** Optional runtime for custom monitoring, reporting or external logic */
|
|
2900
|
+
info?: RuntimeData;
|
|
2880
2901
|
}
|
|
2881
2902
|
/**
|
|
2882
2903
|
* Reason why signal was closed.
|
|
@@ -26229,9 +26250,51 @@ declare class IntervalUtils {
|
|
|
26229
26250
|
*/
|
|
26230
26251
|
declare const Interval: IntervalUtils;
|
|
26231
26252
|
|
|
26253
|
+
/**
|
|
26254
|
+
* Interface for runtime information and range used in backtesting and strategy execution.
|
|
26255
|
+
* The interface defines the time range for the backtest while executing a strategy in backtest mode
|
|
26256
|
+
*/
|
|
26257
|
+
interface IRuntimeRange {
|
|
26258
|
+
/** Start date of the runtime range */
|
|
26259
|
+
from: Date;
|
|
26260
|
+
/** End date of the runtime range */
|
|
26261
|
+
to: Date;
|
|
26262
|
+
}
|
|
26263
|
+
/**
|
|
26264
|
+
* Interface for runtime information returned by the RuntimeMetaService.
|
|
26265
|
+
* This includes the symbol being traded, the time range of the backtest, any additional info defined by the strategy,
|
|
26266
|
+
* and contextual information about the exchange, strategy, and frame being used.
|
|
26267
|
+
*/
|
|
26268
|
+
interface IRuntimeInfo<Data extends RuntimeData = RuntimeData> {
|
|
26269
|
+
/** Trading pair symbol (e.g., "BTCUSDT") */
|
|
26270
|
+
symbol: string;
|
|
26271
|
+
/** Time range for the backtest, null if running in live mode */
|
|
26272
|
+
range: IRuntimeRange | null;
|
|
26273
|
+
/** Additional runtime information defined by the strategy, can be used for custom monitoring or reporting */
|
|
26274
|
+
info: Data | null;
|
|
26275
|
+
/** Contextual information about the current execution environment */
|
|
26276
|
+
context: {
|
|
26277
|
+
exchangeName: ExchangeName;
|
|
26278
|
+
strategyName: StrategyName;
|
|
26279
|
+
frameName: FrameName;
|
|
26280
|
+
};
|
|
26281
|
+
/** Timestamp of the current candle or tick */
|
|
26282
|
+
when: Date;
|
|
26283
|
+
/** Current market price for the symbol at the time of execution */
|
|
26284
|
+
currentPrice: number;
|
|
26285
|
+
/** Whether the strategy is running in backtest mode */
|
|
26286
|
+
backtest: boolean;
|
|
26287
|
+
}
|
|
26288
|
+
|
|
26232
26289
|
/**
|
|
26233
26290
|
* Callback signature for a cron entry handler.
|
|
26234
26291
|
*
|
|
26292
|
+
* Receives a single {@link IRuntimeInfo} snapshot assembled by
|
|
26293
|
+
* `RuntimeMetaService.getRuntimeInfo` at the moment the entry fires. It bundles
|
|
26294
|
+
* everything a handler typically needs — symbol, execution context, current
|
|
26295
|
+
* price, backtest range and the strategy-defined `info` payload — so the
|
|
26296
|
+
* handler does not have to re-query the meta-services itself.
|
|
26297
|
+
*
|
|
26235
26298
|
* Invocation cardinality depends on `entry.symbols` (see {@link CronEntry}):
|
|
26236
26299
|
* - **Global mode** (`symbols` empty/undefined): invoked once per aligned
|
|
26237
26300
|
* boundary across all parallel backtests. The first symbol to reach the
|
|
@@ -26240,22 +26303,29 @@ declare const Interval: IntervalUtils;
|
|
|
26240
26303
|
* - **Fan-out mode** (`symbols` non-empty): invoked once per aligned
|
|
26241
26304
|
* boundary **per whitelisted symbol**. Each symbol has its own slot.
|
|
26242
26305
|
*
|
|
26243
|
-
*
|
|
26306
|
+
* Key fields of the {@link IRuntimeInfo} argument:
|
|
26307
|
+
* - `info.symbol` — In global mode: the symbol of the backtest that first
|
|
26244
26308
|
* reached the boundary (the singleshot "winner"). In fan-out mode: the
|
|
26245
26309
|
* whitelisted symbol whose tick produced this invocation.
|
|
26246
|
-
*
|
|
26247
|
-
*
|
|
26248
|
-
*
|
|
26249
|
-
*
|
|
26250
|
-
*
|
|
26251
|
-
*
|
|
26252
|
-
*
|
|
26253
|
-
*
|
|
26254
|
-
*
|
|
26255
|
-
*
|
|
26256
|
-
*
|
|
26257
|
-
|
|
26258
|
-
|
|
26310
|
+
* - `info.context` — `{ strategyName, exchangeName, frameName }` taken from
|
|
26311
|
+
* the originating lifecycle event (`beforeStart` / `idlePing` / `activePing`
|
|
26312
|
+
* / `schedulePing`, wired by {@link CronUtils.enable}).
|
|
26313
|
+
* - `info.backtest` — Execution-mode flag from the same event. `true` for
|
|
26314
|
+
* backtest runs, `false` for live. The value reflects the **opening** tick
|
|
26315
|
+
* that won the singleshot for this slot — all parallel awaiters of the same
|
|
26316
|
+
* slot observe the same value, even if a later concurrent tick carried a
|
|
26317
|
+
* different one.
|
|
26318
|
+
* - `info.range` — Backtest frame range (`from`/`to`), or `null` in live mode.
|
|
26319
|
+
* - `info.currentPrice` — Current market price at snapshot time.
|
|
26320
|
+
* - `info.info` — Strategy-defined runtime payload (`IStrategySchema.info`),
|
|
26321
|
+
* or `null` when the strategy declares none.
|
|
26322
|
+
* - `info.when` — Snapshot time. **Note:** this is the execution-context tick
|
|
26323
|
+
* time captured by `getRuntimeInfo`, not the cron-aligned boundary. The
|
|
26324
|
+
* aligned boundary still governs *when* the entry fires (and is used for the
|
|
26325
|
+
* slot/dedup keys); `info.when` is the wall/virtual time of the underlying
|
|
26326
|
+
* tick that opened the slot.
|
|
26327
|
+
*/
|
|
26328
|
+
type CronCallback = (info: IRuntimeInfo) => void | Promise<void>;
|
|
26259
26329
|
/**
|
|
26260
26330
|
* Configuration for a registered cron entry.
|
|
26261
26331
|
*/
|
|
@@ -26310,7 +26380,7 @@ interface CronEntry {
|
|
|
26310
26380
|
* const dispose = Cron.register({
|
|
26311
26381
|
* name: "x",
|
|
26312
26382
|
* interval: "1h",
|
|
26313
|
-
* handler: async (
|
|
26383
|
+
* handler: async (info) => { ... },
|
|
26314
26384
|
* });
|
|
26315
26385
|
* dispose(); // unregisters
|
|
26316
26386
|
* ```
|
|
@@ -26340,8 +26410,8 @@ interface CronHandle {
|
|
|
26340
26410
|
* Cron.register({
|
|
26341
26411
|
* name: "tg-signal-parser",
|
|
26342
26412
|
* interval: "1h",
|
|
26343
|
-
* handler: async (
|
|
26344
|
-
* await parseTelegramSignalsToMongo(when);
|
|
26413
|
+
* handler: async (info) => {
|
|
26414
|
+
* await parseTelegramSignalsToMongo(info.when);
|
|
26345
26415
|
* },
|
|
26346
26416
|
* });
|
|
26347
26417
|
*
|
|
@@ -26382,12 +26452,15 @@ declare class CronUtils {
|
|
|
26382
26452
|
* - Fire-once global: `${name}:once:g${generation}`.
|
|
26383
26453
|
* - Fire-once fan-out: `${name}:once:${symbol}:g${generation}`.
|
|
26384
26454
|
*
|
|
26385
|
-
* Value is the shared in-flight handler promise.
|
|
26386
|
-
*
|
|
26387
|
-
*
|
|
26388
|
-
*
|
|
26389
|
-
*
|
|
26390
|
-
*
|
|
26455
|
+
* Value is the shared in-flight handler promise. It resolves to a `boolean`
|
|
26456
|
+
* "failed" flag (`true` when the handler — or the runtime-info assembly —
|
|
26457
|
+
* threw), which `_tick` uses to roll back the periodic watermark of the slot
|
|
26458
|
+
* it opened so a failed boundary is retried. Every parallel `tick` for the
|
|
26459
|
+
* same slot key awaits this exact promise (mutex semantics) and is released
|
|
26460
|
+
* together when it settles. `_inFlight` is owned exclusively by `_runEntry` —
|
|
26461
|
+
* `clear()` does **not** touch it, so the singleshot promise survives
|
|
26462
|
+
* concurrent `clear` calls and continues to coordinate parallel ticks until
|
|
26463
|
+
* it settles.
|
|
26391
26464
|
*/
|
|
26392
26465
|
private readonly _inFlight;
|
|
26393
26466
|
/**
|
|
@@ -26431,9 +26504,12 @@ declare class CronUtils {
|
|
|
26431
26504
|
*
|
|
26432
26505
|
* Written synchronously in `_tick` at slot-open time (before the `await`),
|
|
26433
26506
|
* so a still-in-flight handler does not let a later tick re-open the same
|
|
26434
|
-
* (or an already-passed) boundary.
|
|
26435
|
-
*
|
|
26436
|
-
*
|
|
26507
|
+
* (or an already-passed) boundary. If that handler then **fails**, the
|
|
26508
|
+
* advance is rolled back after the slot settles — the prior value is restored
|
|
26509
|
+
* (or the key deleted if there was none) — so the failed boundary is retried
|
|
26510
|
+
* on the next tick, mirroring catch-up of a skipped boundary. Fire-once
|
|
26511
|
+
* entries never touch this map — they use `_firedOnce`. Pruned by
|
|
26512
|
+
* `_clearBoundaryFor` on `register`/`unregister` and wiped by `dispose`.
|
|
26437
26513
|
*/
|
|
26438
26514
|
private readonly _lastBoundary;
|
|
26439
26515
|
/**
|
|
@@ -26459,16 +26535,32 @@ declare class CronUtils {
|
|
|
26459
26535
|
/**
|
|
26460
26536
|
* Build the singleshot promise for a single in-flight slot.
|
|
26461
26537
|
*
|
|
26462
|
-
*
|
|
26463
|
-
*
|
|
26464
|
-
*
|
|
26465
|
-
*
|
|
26466
|
-
*
|
|
26467
|
-
*
|
|
26538
|
+
* Assembles the {@link IRuntimeInfo} snapshot via
|
|
26539
|
+
* `RuntimeMetaService.getRuntimeInfo(symbol, context, backtest)` and invokes
|
|
26540
|
+
* `entry.handler(info)`. Logs any error via `console.error` and **returns** a
|
|
26541
|
+
* `failed` boolean (`true` when the handler — or the runtime-info assembly —
|
|
26542
|
+
* threw) so the caller (`_tick`) can roll back the periodic watermark of the
|
|
26543
|
+
* slot it opened and retry that boundary. The error is **not** rethrown, so a
|
|
26544
|
+
* failing handler never produces an unhandled rejection. Clears the
|
|
26545
|
+
* `_inFlight` slot in `.finally()` so the next boundary produces a fresh
|
|
26546
|
+
* promise. For fire-once entries `firedKey` is added to `_firedOnce` on
|
|
26547
|
+
* success so subsequent ticks skip it.
|
|
26548
|
+
*
|
|
26549
|
+
* `getRuntimeInfo` is the user-facing aggregator: its sub-fetches (range,
|
|
26550
|
+
* info, price) are individually wrapped in `trycatch` with `null` fallbacks,
|
|
26551
|
+
* so it almost never throws for missing data. Whatever does throw — the
|
|
26552
|
+
* handler, or in rare cases `getRuntimeInfo` — is caught here and reported via
|
|
26553
|
+
* the returned `failed` flag; the watermark rollback treats both identically.
|
|
26554
|
+
*
|
|
26555
|
+
* @param context - Strategy/exchange/frame identifiers from the originating
|
|
26556
|
+
* lifecycle event, forwarded to `getRuntimeInfo` to resolve `range`/`info`.
|
|
26468
26557
|
* @param firedKey - Key to add to `_firedOnce` on success, or `null` for
|
|
26469
26558
|
* periodic entries (which never populate `_firedOnce`).
|
|
26470
|
-
* @param backtest -
|
|
26471
|
-
* "winner" tick's flag is what all parallel awaiters
|
|
26559
|
+
* @param backtest - Forwarded to `getRuntimeInfo` and surfaced as
|
|
26560
|
+
* `info.backtest`; the "winner" tick's flag is what all parallel awaiters
|
|
26561
|
+
* of this slot see.
|
|
26562
|
+
* @returns `true` if the handler (or `getRuntimeInfo`) threw, `false` on
|
|
26563
|
+
* success. `_tick` uses this to decide whether to roll back the watermark.
|
|
26472
26564
|
*/
|
|
26473
26565
|
private _runEntry;
|
|
26474
26566
|
/**
|
|
@@ -26488,7 +26580,7 @@ declare class CronUtils {
|
|
|
26488
26580
|
* name: "fetch-funding",
|
|
26489
26581
|
* interval: "8h",
|
|
26490
26582
|
* symbols: ["BTCUSDT", "ETHUSDT"],
|
|
26491
|
-
* handler: async (
|
|
26583
|
+
* handler: async (info) => { ... },
|
|
26492
26584
|
* });
|
|
26493
26585
|
* // Later:
|
|
26494
26586
|
* dispose();
|
|
@@ -26565,7 +26657,7 @@ declare class CronUtils {
|
|
|
26565
26657
|
* 4. **Fire-once** (`entry.interval === undefined`):
|
|
26566
26658
|
* - If the entry's fired-once key is already in `_firedOnce`, skip.
|
|
26567
26659
|
* - Slot key: `${name}:once` (+ scope) (+ gen).
|
|
26568
|
-
* - `
|
|
26660
|
+
* - `alignedMs` = the 1-minute-aligned `when` from step 0 (`ts`).
|
|
26569
26661
|
* 5. **Periodic** (`entry.interval` set):
|
|
26570
26662
|
* - Align `when` to the entry's interval via {@link alignToInterval} to
|
|
26571
26663
|
* get `alignedMs`, the boundary this tick belongs to.
|
|
@@ -26587,26 +26679,37 @@ declare class CronUtils {
|
|
|
26587
26679
|
* handler is still in flight.
|
|
26588
26680
|
* - Slot key: `${name}:${alignedMs}` (+ scope) (+ gen).
|
|
26589
26681
|
* 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
|
-
*
|
|
26682
|
+
* already exists, `await` the same promise. Otherwise open the slot via
|
|
26683
|
+
* {@link _runEntry} — which assembles the {@link IRuntimeInfo} snapshot
|
|
26684
|
+
* (from `symbol`, `context`, `backtest`) and invokes `entry.handler(info)`
|
|
26685
|
+
* — store the promise, and `await` it. The slot is removed in `.finally()`
|
|
26686
|
+
* so the next boundary creates a fresh promise; for fire-once entries the
|
|
26687
|
+
* fired-once key is also added to `_firedOnce` on success so subsequent
|
|
26688
|
+
* ticks skip it.
|
|
26689
|
+
* 7. After `await Promise.all`, roll back the watermark for every **periodic**
|
|
26690
|
+
* slot this tick *opened* (not the ones whose in-flight promise it reused)
|
|
26691
|
+
* whose handler reported failure, so the next tick re-opens and re-runs
|
|
26692
|
+
* that boundary.
|
|
26595
26693
|
*
|
|
26596
26694
|
* Errors thrown by `handler` are caught, logged via `console.error`, and
|
|
26597
26695
|
* **not** rethrown — a failing handler must not break the per-symbol
|
|
26598
26696
|
* tick loop or unblock other parallel backtests with an unhandled
|
|
26599
26697
|
* rejection. A failed fire-once handler is **not** marked as fired and
|
|
26600
|
-
* will retry on the next tick.
|
|
26698
|
+
* will retry on the next tick. A failed **periodic** handler likewise
|
|
26699
|
+
* retries: the boundary watermark advanced at slot-open time is rolled back
|
|
26700
|
+
* after the slot settles (step 7), so the next tick re-opens that boundary.
|
|
26601
26701
|
*
|
|
26602
26702
|
* Requires active method context and execution context.
|
|
26603
26703
|
*
|
|
26604
26704
|
* @param symbol - Trading symbol from the current tick.
|
|
26605
26705
|
* @param when - Virtual time of the current tick.
|
|
26606
26706
|
* @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.
|
|
26707
|
+
* Forwarded to {@link _runEntry} and surfaced as `info.backtest`. Only the
|
|
26708
|
+
* value from the tick that **opens** a given slot is observed by all
|
|
26709
|
+
* parallel awaiters of that slot.
|
|
26710
|
+
* @param context - Strategy/exchange/frame identifiers from the originating
|
|
26711
|
+
* lifecycle event, forwarded to `RuntimeMetaService.getRuntimeInfo` to
|
|
26712
|
+
* build the {@link IRuntimeInfo} snapshot passed to the handler.
|
|
26610
26713
|
* @throws Error if method or execution context is missing.
|
|
26611
26714
|
*/
|
|
26612
26715
|
private _tick;
|
|
@@ -26623,7 +26726,11 @@ declare class CronUtils {
|
|
|
26623
26726
|
*
|
|
26624
26727
|
* All four subjects are subscribed to a single `singlerun`-wrapped
|
|
26625
26728
|
* handler that builds `_tick(event.symbol, new Date(event.timestamp),
|
|
26626
|
-
* event.backtest
|
|
26729
|
+
* event.backtest, { strategyName, exchangeName, frameName })`. The context
|
|
26730
|
+
* object is read uniformly from the event — every contract carries
|
|
26731
|
+
* `strategyName`, `exchangeName` and `frameName` at the top level (Active /
|
|
26732
|
+
* Schedule contracts gained `frameName` for exactly this reason), so no
|
|
26733
|
+
* per-event branching is needed. `singlerun` merges the four streams into one serial
|
|
26627
26734
|
* queue: at most one `_tick` runs at a time, the next waits. This matters
|
|
26628
26735
|
* because the engine can emit `beforeStart` and an immediate `idlePing`
|
|
26629
26736
|
* on the very same minute, and concurrent `_tick`s on the same
|
|
@@ -26708,7 +26815,7 @@ declare class CronUtils {
|
|
|
26708
26815
|
* Cron.register({
|
|
26709
26816
|
* name: "tg-parser",
|
|
26710
26817
|
* interval: "1h",
|
|
26711
|
-
* handler: async (
|
|
26818
|
+
* handler: async (info) => { ... },
|
|
26712
26819
|
* });
|
|
26713
26820
|
* ```
|
|
26714
26821
|
*/
|
|
@@ -30901,6 +31008,19 @@ declare class PriceMetaService {
|
|
|
30901
31008
|
* Instances are cached until clear() is called.
|
|
30902
31009
|
*/
|
|
30903
31010
|
private getSource;
|
|
31011
|
+
/**
|
|
31012
|
+
* Checks if a price exists for the given key and has emitted at least one value.
|
|
31013
|
+
*
|
|
31014
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
31015
|
+
* @param context - Strategy, exchange, and frame identifiers
|
|
31016
|
+
* @param backtest - True if backtest mode, false if live mode
|
|
31017
|
+
* @returns True if a price exists and has emitted a value, false otherwise
|
|
31018
|
+
*/
|
|
31019
|
+
hasPrice: (symbol: string, context: {
|
|
31020
|
+
strategyName: string;
|
|
31021
|
+
exchangeName: string;
|
|
31022
|
+
frameName: string;
|
|
31023
|
+
}, backtest: boolean) => boolean;
|
|
30904
31024
|
/**
|
|
30905
31025
|
* Returns the current market price for the given symbol and context.
|
|
30906
31026
|
*
|
|
@@ -36888,6 +37008,43 @@ declare const backtest: {
|
|
|
36888
37008
|
};
|
|
36889
37009
|
getContextTimestamp: () => number;
|
|
36890
37010
|
};
|
|
37011
|
+
runtimeMetaService: {
|
|
37012
|
+
readonly loggerService: {
|
|
37013
|
+
readonly methodContextService: {
|
|
37014
|
+
readonly context: IMethodContext;
|
|
37015
|
+
};
|
|
37016
|
+
readonly executionContextService: {
|
|
37017
|
+
readonly context: IExecutionContext;
|
|
37018
|
+
};
|
|
37019
|
+
_commonLogger: ILogger;
|
|
37020
|
+
readonly _methodContext: {};
|
|
37021
|
+
readonly _executionContext: {};
|
|
37022
|
+
log: (topic: string, ...args: any[]) => Promise<void>;
|
|
37023
|
+
debug: (topic: string, ...args: any[]) => Promise<void>;
|
|
37024
|
+
info: (topic: string, ...args: any[]) => Promise<void>;
|
|
37025
|
+
warn: (topic: string, ...args: any[]) => Promise<void>;
|
|
37026
|
+
setLogger: (logger: ILogger) => void;
|
|
37027
|
+
};
|
|
37028
|
+
readonly timeMetaService: TimeMetaService;
|
|
37029
|
+
readonly priceMetaService: PriceMetaService;
|
|
37030
|
+
readonly frameSchemaService: FrameSchemaService;
|
|
37031
|
+
readonly strategySchemaService: StrategySchemaService;
|
|
37032
|
+
_getRange: ((context: {
|
|
37033
|
+
strategyName: string;
|
|
37034
|
+
exchangeName: string;
|
|
37035
|
+
frameName: string;
|
|
37036
|
+
}, backtest: boolean) => any) & functools_kit.IClearableMemoize<string> & functools_kit.IControlMemoize<string, any>;
|
|
37037
|
+
_getInfo: ((context: {
|
|
37038
|
+
strategyName: string;
|
|
37039
|
+
exchangeName: string;
|
|
37040
|
+
frameName: string;
|
|
37041
|
+
}) => any) & functools_kit.IClearableMemoize<string> & functools_kit.IControlMemoize<string, any>;
|
|
37042
|
+
getRuntimeInfo: <Data extends RuntimeData = RuntimeData>(symbol: string, context: {
|
|
37043
|
+
strategyName: string;
|
|
37044
|
+
exchangeName: string;
|
|
37045
|
+
frameName: string;
|
|
37046
|
+
}, backtest: boolean) => Promise<IRuntimeInfo<Data>>;
|
|
37047
|
+
};
|
|
36891
37048
|
exchangeCoreService: ExchangeCoreService;
|
|
36892
37049
|
strategyCoreService: StrategyCoreService;
|
|
36893
37050
|
actionCoreService: ActionCoreService;
|
|
@@ -37014,4 +37171,4 @@ declare const getTotalClosed: (signal: Signal) => {
|
|
|
37014
37171
|
remainingCostBasis: number;
|
|
37015
37172
|
};
|
|
37016
37173
|
|
|
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 };
|
|
37174
|
+
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, 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 };
|