backtest-kit 9.8.4 → 10.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "9.8.4",
3
+ "version": "10.1.0",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -2424,6 +2424,8 @@ type SignalInterval = "1m" | "3m" | "5m" | "15m" | "30m" | "1h";
2424
2424
  interface ISignalDto {
2425
2425
  /** Optional signal ID (auto-generated if not provided) */
2426
2426
  id?: string;
2427
+ /** Symbol of a ticker on exchange */
2428
+ symbol?: string;
2427
2429
  /** Trade direction: "long" (buy) or "short" (sell) */
2428
2430
  position: "long" | "short";
2429
2431
  /** Human-readable description of signal reason */
@@ -26141,6 +26143,410 @@ declare class IntervalUtils {
26141
26143
  */
26142
26144
  declare const Interval: IntervalUtils;
26143
26145
 
26146
+ /**
26147
+ * Callback signature for a cron entry handler.
26148
+ *
26149
+ * Invocation cardinality depends on `entry.symbols` (see {@link CronEntry}):
26150
+ * - **Global mode** (`symbols` empty/undefined): invoked once per aligned
26151
+ * boundary across all parallel backtests. The first symbol to reach the
26152
+ * boundary opens the slot and runs the handler; others await the same
26153
+ * promise.
26154
+ * - **Fan-out mode** (`symbols` non-empty): invoked once per aligned
26155
+ * boundary **per whitelisted symbol**. Each symbol has its own slot.
26156
+ *
26157
+ * @param symbol - In global mode: the symbol of the backtest that first
26158
+ * reached the boundary (the singleshot "winner"). In fan-out mode: the
26159
+ * whitelisted symbol whose tick produced this invocation.
26160
+ * @param when - The aligned virtual time at which the entry fires.
26161
+ * Already aligned to the entry's `interval` boundary (e.g. for `1h`,
26162
+ * minutes/seconds/ms are zero). In fire-once mode this is the tick time
26163
+ * aligned to the 1-minute boundary (the base alignment `_tick` applies
26164
+ * to every incoming tick), not raw wall-clock with sub-second precision.
26165
+ * @param backtest - Execution-mode flag taken from the originating lifecycle
26166
+ * event (`beforeStart` / `idlePing` / `activePing` / `schedulePing`,
26167
+ * wired by `Cron.enable()`). `true` for backtest runs, `false` for live.
26168
+ * The value reflects the **opening** tick that won the singleshot for
26169
+ * this slot — all parallel awaiters of the same slot observe the same
26170
+ * value, even if a later concurrent tick carried a different one.
26171
+ */
26172
+ type CronCallback = (symbol: string, when: Date, backtest: boolean) => void | Promise<void>;
26173
+ /**
26174
+ * Configuration for a registered cron entry.
26175
+ */
26176
+ interface CronEntry {
26177
+ /**
26178
+ * Unique name of the entry. Used as the dedup key on `register` (re-registering
26179
+ * the same name replaces the previous entry) and as part of the singleshot
26180
+ * coordination key.
26181
+ *
26182
+ * Must be non-empty and must not contain `:` — `:` is reserved as the slot-key
26183
+ * segment separator and would otherwise create ambiguity between global and
26184
+ * fan-out fire-once keys.
26185
+ */
26186
+ name: string;
26187
+ /**
26188
+ * Candle interval at whose boundaries the handler fires.
26189
+ * Same scale as {@link CandleInterval} used by `Interval` and `Cache`:
26190
+ * `"1m" | "5m" | "1h" | "1d"` etc.
26191
+ *
26192
+ * If omitted, the entry switches to **fire-once** mode: the handler is
26193
+ * invoked on the very first matching tick (no boundary check) and never
26194
+ * again. If the handler throws, the entry is **not** marked as fired and
26195
+ * will retry on the next tick.
26196
+ */
26197
+ interval?: CandleInterval;
26198
+ /**
26199
+ * Symbol whitelist that doubles as the fan-out switch.
26200
+ *
26201
+ * - **Empty/undefined → global singleshot**: across all parallel backtests
26202
+ * the handler runs **once** per boundary. The first symbol to reach the
26203
+ * boundary opens the slot; others await the same promise.
26204
+ * - **Non-empty → per-symbol fan-out**: ticks whose `symbol` is not in the
26205
+ * list are skipped, and ticks whose `symbol` *is* in the list each open
26206
+ * their own slot. The handler runs **once per whitelisted symbol** per
26207
+ * boundary.
26208
+ *
26209
+ * The same rule applies in fire-once mode: global → handler runs once
26210
+ * total; fan-out → once per whitelisted symbol.
26211
+ *
26212
+ * Each symbol must not contain `:` (same reason as {@link CronEntry.name}).
26213
+ */
26214
+ symbols?: string[];
26215
+ /** Handler invoked on the first parallel tick to reach a new boundary. */
26216
+ handler: CronCallback;
26217
+ }
26218
+ /**
26219
+ * Handle returned from `register`. Call it to unregister the entry —
26220
+ * equivalent to `Cron.unregister(name)`.
26221
+ *
26222
+ * @example
26223
+ * ```typescript
26224
+ * const dispose = Cron.register({
26225
+ * name: "x",
26226
+ * interval: "1h",
26227
+ * handler: async (symbol, when, backtest) => { ... },
26228
+ * });
26229
+ * dispose(); // unregisters
26230
+ * ```
26231
+ */
26232
+ interface CronHandle {
26233
+ (): void;
26234
+ }
26235
+ /**
26236
+ * Utility class for registering periodic tasks that fire on candle-interval
26237
+ * boundaries of the virtual time produced by parallel backtests.
26238
+ *
26239
+ * Exported as singleton instance `Cron` for convenient usage.
26240
+ *
26241
+ * Key property — **singleshot coordination across parallel backtests**:
26242
+ * when several `Backtest.background(symbol, ...)` runs hit the same aligned
26243
+ * boundary concurrently, the handler is invoked exactly once. Every parallel
26244
+ * `tick` for that boundary awaits the same in-flight promise and is released
26245
+ * together when the promise settles. After settlement the slot is cleared and
26246
+ * the next boundary produces a fresh promise.
26247
+ *
26248
+ * Typical wiring:
26249
+ *
26250
+ * @example
26251
+ * ```typescript
26252
+ * import { Cron, Backtest } from "backtest-kit";
26253
+ *
26254
+ * Cron.register({
26255
+ * name: "tg-signal-parser",
26256
+ * interval: "1h",
26257
+ * handler: async (symbol, when, backtest) => {
26258
+ * await parseTelegramSignalsToMongo(when);
26259
+ * },
26260
+ * });
26261
+ *
26262
+ * // Subscribe Cron to the engine's lifecycle subjects (beforeStart,
26263
+ * // idlePing, activePing, schedulePing) once at startup. After this every
26264
+ * // strategy tick is forwarded into Cron automatically.
26265
+ * Cron.enable();
26266
+ *
26267
+ * for (const symbol of ["BTCUSDT", "ETHUSDT", "SOLUSDT", "BNBUSDT", "TRXUSDT"]) {
26268
+ * Backtest.background(symbol, { strategyName, exchangeName, frameName });
26269
+ * }
26270
+ *
26271
+ * // On shutdown:
26272
+ * // Cron.disable();
26273
+ * ```
26274
+ */
26275
+ declare class CronUtils {
26276
+ /**
26277
+ * Registered entries by `name`.
26278
+ *
26279
+ * Each record carries a monotonically increasing `generation` counter that
26280
+ * is bumped on every `register(entry)` call for the same name. The
26281
+ * generation participates in `firedKey` so writes from a still-in-flight
26282
+ * handler of a previous incarnation cannot poison `_firedOnce` for the
26283
+ * current incarnation — their key has a different generation suffix and
26284
+ * is simply ignored on lookup.
26285
+ */
26286
+ private readonly _entries;
26287
+ /** Monotonic counter used to mint new entry generations on `register`. */
26288
+ private _generationCounter;
26289
+ /**
26290
+ * In-flight handler slots.
26291
+ *
26292
+ * Slot key shape (always includes the generation suffix `:g${generation}`;
26293
+ * the `:${symbol}` scope is present only in fan-out mode):
26294
+ * - Periodic global: `${name}:${alignedMs}:g${generation}`.
26295
+ * - Periodic fan-out: `${name}:${alignedMs}:${symbol}:g${generation}`.
26296
+ * - Fire-once global: `${name}:once:g${generation}`.
26297
+ * - Fire-once fan-out: `${name}:once:${symbol}:g${generation}`.
26298
+ *
26299
+ * Value is the shared in-flight handler promise. Every parallel `tick` for
26300
+ * the same slot key awaits this exact promise (mutex semantics) and is
26301
+ * released together when it settles. `_inFlight` is owned exclusively by
26302
+ * `_runEntry` — `clear()` does **not** touch it, so the singleshot promise
26303
+ * survives concurrent `clear` calls and continues to coordinate parallel
26304
+ * ticks until it settles.
26305
+ */
26306
+ private readonly _inFlight;
26307
+ /**
26308
+ * Keys of fire-once entries whose handler has already settled successfully.
26309
+ *
26310
+ * Key shape (always includes the entry generation suffix `:g${generation}`):
26311
+ * - Global fire-once: `${name}:g${generation}`.
26312
+ * - Fan-out fire-once: `${name}:${symbol}:g${generation}` — one entry per
26313
+ * whitelisted symbol.
26314
+ *
26315
+ * The generation suffix isolates incarnations of the same `name`: writes
26316
+ * landing from a still-in-flight handler of a previous `register()` carry
26317
+ * the old generation and are never matched by the new entry's lookup.
26318
+ * Stale entries are pruned by `_clearFiredOnceFor` on `register`/`unregister`
26319
+ * and wiped by `clear()`.
26320
+ *
26321
+ * Looked up by `_tick` to decide whether to skip; written by `_runEntry`
26322
+ * on successful settle.
26323
+ */
26324
+ private readonly _firedOnce;
26325
+ /**
26326
+ * Garbage-collect every `_firedOnce` key that belongs to the entry `name`
26327
+ * (any generation, global or fan-out).
26328
+ *
26329
+ * Called from `register`/`unregister` to free memory; **not** required
26330
+ * for correctness — the generation suffix already isolates re-registrations,
26331
+ * so leftover keys from old generations can never block a new entry.
26332
+ * They just sit unused until they are GC'd here or wiped by `clear()`.
26333
+ */
26334
+ private _clearFiredOnceFor;
26335
+ /**
26336
+ * Build the singleshot promise for a single in-flight slot.
26337
+ *
26338
+ * Invokes `entry.handler(symbol, aligned, backtest)`, swallows and logs
26339
+ * any error via `console.error`, and clears the `_inFlight` slot
26340
+ * in `.finally()` so the next boundary produces a fresh promise. For
26341
+ * fire-once entries `firedKey` is added to `_firedOnce` on success so
26342
+ * subsequent ticks skip it.
26343
+ *
26344
+ * @param firedKey - Key to add to `_firedOnce` on success, or `null` for
26345
+ * periodic entries (which never populate `_firedOnce`).
26346
+ * @param backtest - Value forwarded as the third handler argument; the
26347
+ * "winner" tick's flag is what all parallel awaiters of this slot see.
26348
+ */
26349
+ private _runEntry;
26350
+ /**
26351
+ * Register a periodic cron entry.
26352
+ *
26353
+ * Idempotent on `name`: re-registering the same name replaces the previous
26354
+ * entry (interval/symbols/handler can all change). Re-registration does
26355
+ * **not** clear in-flight promises — entries still resolving complete with
26356
+ * the previous handler.
26357
+ *
26358
+ * @param entry - Entry configuration; see {@link CronEntry}.
26359
+ * @returns Disposer function — call it to unregister the entry.
26360
+ *
26361
+ * @example
26362
+ * ```typescript
26363
+ * const dispose = Cron.register({
26364
+ * name: "fetch-funding",
26365
+ * interval: "8h",
26366
+ * symbols: ["BTCUSDT", "ETHUSDT"],
26367
+ * handler: async (symbol, when, backtest) => { ... },
26368
+ * });
26369
+ * // Later:
26370
+ * dispose();
26371
+ * ```
26372
+ */
26373
+ register: (entry: CronEntry) => CronHandle;
26374
+ /**
26375
+ * Remove a registered entry by name.
26376
+ *
26377
+ * Does not cancel handlers already in flight — those resolve on their own
26378
+ * and clear their slot via `.finally()`.
26379
+ *
26380
+ * @param name - Name passed to `register`.
26381
+ */
26382
+ unregister: (name: string) => void;
26383
+ /**
26384
+ * Clear fire-once marks so that fire-once entries can fire again.
26385
+ *
26386
+ * Does **not** touch `_inFlight` — that map holds shared in-flight handler
26387
+ * promises through which parallel `tick`s coordinate. Wiping it mid-flight
26388
+ * would let a new `tick` start a second handler for a boundary that's
26389
+ * already running, breaking the singleshot contract.
26390
+ *
26391
+ * Two modes:
26392
+ * - **Per-symbol** (`symbol` provided): clears only fan-out fire-once
26393
+ * marks for that symbol — keys of the shape `${name}:${symbol}:g${gen}`.
26394
+ * Global fire-once marks (`${name}:g${gen}`, no symbol component) are
26395
+ * left intact, since they are not attributable to a single symbol.
26396
+ * Useful for re-arming fan-out fire-once entries when a particular
26397
+ * symbol's run finishes and you want a future re-run to fire again.
26398
+ * - **All** (no argument): wipes every fire-once mark across all entries
26399
+ * and symbols. Registered entries are not removed — use `unregister`
26400
+ * (or the disposer returned by `register`) for that.
26401
+ *
26402
+ * **Race with in-flight handlers.** `_firedOnce` is written in
26403
+ * `_runEntry`'s `.finally()`, which can run *after* a concurrent
26404
+ * `clear()` call. In that case the fire-once mark reappears immediately
26405
+ * after being wiped, and the next tick will treat the entry as already
26406
+ * fired. This is consistent with the singleshot promise itself surviving
26407
+ * `clear()` — the handler is allowed to finish — and the entry's
26408
+ * generation suffix in `firedKey` guarantees the stale mark cannot
26409
+ * outlive a subsequent `register()` of the same name. If you need a hard
26410
+ * re-arm, `unregister` + `register` bumps the generation and makes any
26411
+ * late write a no-op.
26412
+ *
26413
+ * @param symbol - Optional symbol filter; if omitted, clears all fire-once
26414
+ * marks.
26415
+ */
26416
+ clear: (symbol?: string) => void;
26417
+ /**
26418
+ * Process a virtual-time tick for `symbol` and fire any due cron entries.
26419
+ *
26420
+ * **Private.** Invoked exclusively by the lifecycle bridge installed in
26421
+ * {@link enable} — `beforeStart` / `idlePing` / `activePing` / `schedulePing`
26422
+ * are funneled here through a shared `singlerun` queue, so calls to
26423
+ * `_tick` are serialised end-to-end. Do not call directly.
26424
+ *
26425
+ * Algorithm (per registered entry):
26426
+ * 0. Base-align the incoming `when` down to the 1-minute boundary (`ts`).
26427
+ * Lifecycle subjects may emit with sub-second jitter; rounding here
26428
+ * guarantees that `beforeStart` / `idlePing` / `activePing` /
26429
+ * `schedulePing` for the same virtual minute all hash to the same
26430
+ * slot key.
26431
+ * 1. If `entry.symbols` is non-empty and does not include `symbol`, skip.
26432
+ * 2. Decide scope from `entry.symbols`:
26433
+ * - Empty/undefined → **global** (slot key has no symbol component).
26434
+ * - Non-empty → **fan-out**, slot key carries `:${symbol}` so each
26435
+ * whitelisted symbol gets its own slot and handler invocation.
26436
+ * 3. Append the current entry generation suffix `:g${generation}` to both
26437
+ * slot key and fired-once key. This isolates incarnations of the same
26438
+ * `name`: a `register()` after an in-flight handler bumps the
26439
+ * generation, so the late `_firedOnce` write from the old handler can
26440
+ * never block the new entry.
26441
+ * 4. **Fire-once** (`entry.interval === undefined`):
26442
+ * - If the entry's fired-once key is already in `_firedOnce`, skip.
26443
+ * - Slot key: `${name}:once` (+ scope) (+ gen).
26444
+ * - `aligned` = the 1-minute-aligned `when` from step 0.
26445
+ * 5. **Periodic** (`entry.interval` set):
26446
+ * - Align `when` further to the entry's interval via {@link alignToInterval}.
26447
+ * - If `ts !== alignedMs`, the tick is mid-interval — skip.
26448
+ * (This is the "remainder === 0" boundary check from the spec;
26449
+ * since `ts` is already on the 1-minute boundary, the check is exact
26450
+ * for `1m` and consistent for higher intervals.)
26451
+ * - Slot key: `${name}:${alignedMs}` (+ scope) (+ gen).
26452
+ * 6. Singleshot per slot key: look up the slot in `_inFlight`. If a promise
26453
+ * already exists, `await` the same promise. Otherwise invoke
26454
+ * `entry.handler`, store the promise, and `await` it. The slot is
26455
+ * removed in `.finally()` so the next boundary creates a fresh promise;
26456
+ * for fire-once entries the fired-once key is also added to
26457
+ * `_firedOnce` on success so subsequent ticks skip it.
26458
+ *
26459
+ * Errors thrown by `handler` are caught, logged via `console.error`, and
26460
+ * **not** rethrown — a failing handler must not break the per-symbol
26461
+ * tick loop or unblock other parallel backtests with an unhandled
26462
+ * rejection. A failed fire-once handler is **not** marked as fired and
26463
+ * will retry on the next tick.
26464
+ *
26465
+ * Requires active method context and execution context.
26466
+ *
26467
+ * @param symbol - Trading symbol from the current tick.
26468
+ * @param when - Virtual time of the current tick.
26469
+ * @param backtest - `true` for backtest ticks, `false` for live ticks.
26470
+ * Forwarded as the third argument to `entry.handler`. Only the value
26471
+ * from the tick that **opens** a given slot is observed by all parallel
26472
+ * awaiters of that slot.
26473
+ * @throws Error if method or execution context is missing.
26474
+ */
26475
+ private _tick;
26476
+ /**
26477
+ * Subscribe `Cron` to the engine's strategy lifecycle subjects so registered
26478
+ * entries fire automatically — no manual wiring of `listenTickBacktest` /
26479
+ * `listenSchedulePing` etc. needed.
26480
+ *
26481
+ * Subjects funneled into {@link _tick}:
26482
+ * - `beforeStartSubject` — first event of every run.
26483
+ * - `idlePingSubject` — every tick when no signal is pending or scheduled.
26484
+ * - `activePingSubject` — every tick while a pending signal is being monitored.
26485
+ * - `schedulePingSubject` — every tick while a scheduled signal is being monitored.
26486
+ *
26487
+ * All four subjects are subscribed to a single `singlerun`-wrapped
26488
+ * handler that builds `_tick(event.symbol, new Date(event.timestamp),
26489
+ * event.backtest)`. `singlerun` merges the four streams into one serial
26490
+ * queue: at most one `_tick` runs at a time, the next waits. This matters
26491
+ * because the engine can emit `beforeStart` and an immediate `idlePing`
26492
+ * on the very same minute, and concurrent `_tick`s on the same
26493
+ * `(symbol, minute)` would otherwise race to open the same `_inFlight`
26494
+ * slot before either commit. Together these four sources cover every
26495
+ * tick the engine processes for every `(symbol, virtual-minute)` pair
26496
+ * regardless of whether the strategy is idle, active, or scheduled.
26497
+ *
26498
+ * `enable` itself is wrapped in `singleshot`, so calling it repeatedly is
26499
+ * a no-op — subsequent calls return the same disposer. The disposer
26500
+ * unsubscribes from every subject and resets the singleshot so a future
26501
+ * `enable()` can re-subscribe cleanly. Equivalent to the
26502
+ * `RecentAdapter.enable` pattern.
26503
+ *
26504
+ * The `.subscribe` callbacks are synchronous wrappers around the
26505
+ * `singlerun`-async handler; `_tick`'s returned promise is awaited inside
26506
+ * `singlerun` to enforce ordering but not bubbled back to the subject.
26507
+ * Errors are caught and logged inside `_runEntry`.
26508
+ *
26509
+ * @returns Cleanup function that unsubscribes from all four subjects and
26510
+ * resets the singleshot. Idempotent.
26511
+ *
26512
+ * @example
26513
+ * ```typescript
26514
+ * import { Cron } from "backtest-kit";
26515
+ *
26516
+ * Cron.register({ name: "tg-parser", interval: "1h", handler });
26517
+ * Cron.enable(); // wire once at startup
26518
+ * // ... run backtests / live as usual
26519
+ * Cron.disable(); // on shutdown
26520
+ * ```
26521
+ */
26522
+ enable: (() => (...args: any[]) => any) & functools_kit.ISingleshotClearable<() => (...args: any[]) => any>;
26523
+ /**
26524
+ * Tear down the lifecycle subscriptions installed by {@link enable}.
26525
+ *
26526
+ * Safe to call multiple times and safe to call before `enable()` — both
26527
+ * are no-ops. Does **not** unregister entries, does **not** touch
26528
+ * `_inFlight`, and does **not** wipe `_firedOnce` (use `unregister` or
26529
+ * `clear()` for those).
26530
+ */
26531
+ disable: () => void;
26532
+ }
26533
+ /**
26534
+ * Singleton instance of {@link CronUtils} for registering periodic tasks
26535
+ * coordinated across parallel `Backtest.background` runs.
26536
+ *
26537
+ * @example
26538
+ * ```typescript
26539
+ * import { Cron } from "backtest-kit";
26540
+ *
26541
+ * Cron.register({
26542
+ * name: "tg-parser",
26543
+ * interval: "1h",
26544
+ * handler: async (symbol, when, backtest) => { ... },
26545
+ * });
26546
+ * ```
26547
+ */
26548
+ declare const Cron: CronUtils;
26549
+
26144
26550
  /**
26145
26551
  * Type alias for column configuration used in breakeven markdown reports.
26146
26552
  *
@@ -28808,6 +29214,73 @@ interface IParseArgsResult extends IParseArgsParams {
28808
29214
  */
28809
29215
  declare const parseArgs: ({ symbol, strategyName, exchangeName, frameName, }?: Partial<IParseArgsParams>) => IParseArgsResult;
28810
29216
 
29217
+ /**
29218
+ * Wraps a function so it always runs outside any active method or execution context.
29219
+ *
29220
+ * When the wrapped function is called, `beginContext` checks whether
29221
+ * `MethodContextService` or `ExecutionContextService` currently have an active
29222
+ * scope and, if so, escapes each one with `runOutOfContext` before invoking `run`.
29223
+ * This prevents accidental context leakage from a caller into a logically independent
29224
+ * operation (e.g. an internal runner that must establish its own fresh context).
29225
+ *
29226
+ * The returned wrapper preserves the original function's parameter and return types,
29227
+ * so it is a transparent drop-in replacement.
29228
+ *
29229
+ * @template T - Type of the wrapped function.
29230
+ * @param run - Function to wrap.
29231
+ * @returns A new function with the same signature as `run` that escapes any
29232
+ * active context before executing.
29233
+ *
29234
+ * @example
29235
+ * ```typescript
29236
+ * const runInContextInternal = beginContext(
29237
+ * async (run: () => Promise<void>, context: IRunContext) => {
29238
+ * return await MethodContextService.runInContext(
29239
+ * () => ExecutionContextService.runInContext(run, context),
29240
+ * context,
29241
+ * );
29242
+ * },
29243
+ * );
29244
+ * ```
29245
+ */
29246
+ declare const beginContext: <T extends (...args: any[]) => any>(run: T) => ((...args: Parameters<T>) => ReturnType<T>);
29247
+
29248
+ /**
29249
+ * Wraps a function to execute it outside of the current execution context if one exists.
29250
+ *
29251
+ * This utility ensures that the wrapped function runs in isolation from any existing
29252
+ * ExecutionContext, preventing context leakage and unintended context sharing between
29253
+ * async operations.
29254
+ *
29255
+ * @template T - Function type with any parameters and return type
29256
+ * @param {T} run - The function to be wrapped and executed outside of context
29257
+ * @returns {Function} A curried function that accepts the original function's parameters
29258
+ * and executes it outside of the current context if one exists
29259
+ *
29260
+ * @example
29261
+ * ```ts
29262
+ * const myFunction = async (param: string) => {
29263
+ * // This code will run outside of any ExecutionContext
29264
+ * return param.toUpperCase();
29265
+ * };
29266
+ *
29267
+ * const wrappedFunction = beginTime(myFunction);
29268
+ * const result = wrappedFunction('hello'); // Returns 'HELLO'
29269
+ * ```
29270
+ *
29271
+ * @example
29272
+ * ```ts
29273
+ * // Usage with trycatch wrapper
29274
+ * const safeFunction = trycatch(
29275
+ * beginTime(async (id: number) => {
29276
+ * // Function body runs isolated from parent context
29277
+ * return await fetchData(id);
29278
+ * })
29279
+ * );
29280
+ * ```
29281
+ */
29282
+ declare const beginTime: <T extends (...args: any[]) => any>(run: T) => ((...args: Parameters<T>) => ReturnType<T>);
29283
+
28811
29284
  /**
28812
29285
  * Retrieves a value from an object using a given path.
28813
29286
  *
@@ -36308,6 +36781,13 @@ interface Signal$2 extends ISignalDto {
36308
36781
  */
36309
36782
  declare const toProfitLossDto: (signal: Signal$2, priceClose: number) => IStrategyPnL;
36310
36783
 
36784
+ /**
36785
+ * Converts markdown content to plain text with minimal formatting
36786
+ * @param content - Markdown string to convert
36787
+ * @returns Plain text representation
36788
+ */
36789
+ declare const toPlainString: (content: string) => string;
36790
+
36311
36791
  interface Signal$1 extends ISignalDto {
36312
36792
  priceOpen: number;
36313
36793
  _entry?: ISignalRow['_entry'];
@@ -36359,4 +36839,4 @@ declare const getTotalClosed: (signal: Signal) => {
36359
36839
  remainingCostBasis: number;
36360
36840
  };
36361
36841
 
36362
- 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, 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, 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, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, waitForReady, warmCandles, writeMemory };
36842
+ 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 };