backtest-kit 6.5.1 → 6.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.cjs CHANGED
@@ -45555,6 +45555,111 @@ async function dumpJson(dto) {
45555
45555
  });
45556
45556
  }
45557
45557
 
45558
+ /**
45559
+ * Wraps a function so it always runs outside any active method or execution context.
45560
+ *
45561
+ * When the wrapped function is called, `beginContext` checks whether
45562
+ * `MethodContextService` or `ExecutionContextService` currently have an active
45563
+ * scope and, if so, escapes each one with `runOutOfContext` before invoking `run`.
45564
+ * This prevents accidental context leakage from a caller into a logically independent
45565
+ * operation (e.g. an internal runner that must establish its own fresh context).
45566
+ *
45567
+ * The returned wrapper preserves the original function's parameter and return types,
45568
+ * so it is a transparent drop-in replacement.
45569
+ *
45570
+ * @template T - Type of the wrapped function.
45571
+ * @param run - Function to wrap.
45572
+ * @returns A new function with the same signature as `run` that escapes any
45573
+ * active context before executing.
45574
+ *
45575
+ * @example
45576
+ * ```typescript
45577
+ * const runInContextInternal = beginContext(
45578
+ * async (run: () => Promise<void>, context: IRunContext) => {
45579
+ * return await MethodContextService.runInContext(
45580
+ * () => ExecutionContextService.runInContext(run, context),
45581
+ * context,
45582
+ * );
45583
+ * },
45584
+ * );
45585
+ * ```
45586
+ */
45587
+ const beginContext = (run) => (...args) => {
45588
+ let fn = () => run(...args);
45589
+ if (MethodContextService.hasContext()) {
45590
+ fn = MethodContextService.runOutOfContext(fn);
45591
+ }
45592
+ if (ExecutionContextService.hasContext()) {
45593
+ fn = ExecutionContextService.runOutOfContext(fn);
45594
+ }
45595
+ return fn();
45596
+ };
45597
+
45598
+ const RUN_IN_MOCK_CONTEXT_METHOD_NAME = "context.runInMockContext";
45599
+ /**
45600
+ * Internal runner that executes `run` inside nested `MethodContextService` and
45601
+ * `ExecutionContextService` scopes established from the given `context`.
45602
+ *
45603
+ * Wrapped with `beginContext` so any inherited outer context is escaped first,
45604
+ * ensuring the scopes set here are the only ones visible to `run`.
45605
+ *
45606
+ * Not exported — use `runInMockContext` for external callers.
45607
+ */
45608
+ const runInContextInternal = beginContext(async (run, context) => {
45609
+ return await MethodContextService.runInContext(async () => {
45610
+ return await ExecutionContextService.runInContext(async () => {
45611
+ return await run();
45612
+ }, {
45613
+ backtest: context.backtest,
45614
+ symbol: context.symbol,
45615
+ when: context.when,
45616
+ });
45617
+ }, {
45618
+ exchangeName: context.exchangeName,
45619
+ strategyName: context.strategyName,
45620
+ frameName: context.frameName,
45621
+ });
45622
+ });
45623
+ /**
45624
+ * Runs a function inside a mock method and execution context.
45625
+ *
45626
+ * Useful in tests and scripts that need to call context-dependent services
45627
+ * (e.g. `getBacktestTimeframe`) without a real backtest runner.
45628
+ *
45629
+ * All context fields are optional; the defaults produce a minimal live-mode
45630
+ * environment pointing at placeholder schema names:
45631
+ * - `exchangeName` → `"mock-exchange"`
45632
+ * - `strategyName` → `"mock-strategy"`
45633
+ * - `frameName` → `"mock-frame"`
45634
+ * - `symbol` → `"BTCUSDT"`
45635
+ * - `backtest` → `false` (live mode)
45636
+ * - `when` → current minute boundary (`alignToInterval(new Date(), "1m")`)
45637
+ *
45638
+ * @param run - Zero-argument function to execute within the context.
45639
+ * @param context - Partial `IRunContext`; any omitted field falls back to its default.
45640
+ * @returns Promise resolving to the return value of `run`.
45641
+ *
45642
+ * @example
45643
+ * ```typescript
45644
+ * const price = await runInMockContext(
45645
+ * () => getEffectivePrice("BTCUSDT"),
45646
+ * { exchangeName: "binance", strategyName: "my-strategy", frameName: "1d" },
45647
+ * );
45648
+ * ```
45649
+ */
45650
+ async function runInMockContext(run, { exchangeName = "mock-exchange", frameName = "mock-frame", strategyName = "mock-strategy", symbol = "BTCUSDT", backtest: isBacktest = false, when = alignToInterval(new Date(), "1m"), }) {
45651
+ bt.loggerService.info(RUN_IN_MOCK_CONTEXT_METHOD_NAME, { symbol, exchangeName, strategyName, frameName });
45652
+ const context = {
45653
+ exchangeName,
45654
+ frameName,
45655
+ strategyName,
45656
+ symbol,
45657
+ backtest: isBacktest,
45658
+ when,
45659
+ };
45660
+ return await runInContextInternal(run, context);
45661
+ }
45662
+
45558
45663
  var _a, _b;
45559
45664
  const LOG_PERSIST_METHOD_NAME_WAIT_FOR_INIT = "LogPersistUtils.waitForInit";
45560
45665
  const LOG_PERSIST_METHOD_NAME_LOG = "LogPersistUtils.log";
@@ -52707,6 +52812,7 @@ exports.percentValue = percentValue;
52707
52812
  exports.readMemory = readMemory;
52708
52813
  exports.removeMemory = removeMemory;
52709
52814
  exports.roundTicks = roundTicks;
52815
+ exports.runInMockContext = runInMockContext;
52710
52816
  exports.searchMemory = searchMemory;
52711
52817
  exports.set = set;
52712
52818
  exports.setColumns = setColumns;
package/build/index.mjs CHANGED
@@ -45535,6 +45535,111 @@ async function dumpJson(dto) {
45535
45535
  });
45536
45536
  }
45537
45537
 
45538
+ /**
45539
+ * Wraps a function so it always runs outside any active method or execution context.
45540
+ *
45541
+ * When the wrapped function is called, `beginContext` checks whether
45542
+ * `MethodContextService` or `ExecutionContextService` currently have an active
45543
+ * scope and, if so, escapes each one with `runOutOfContext` before invoking `run`.
45544
+ * This prevents accidental context leakage from a caller into a logically independent
45545
+ * operation (e.g. an internal runner that must establish its own fresh context).
45546
+ *
45547
+ * The returned wrapper preserves the original function's parameter and return types,
45548
+ * so it is a transparent drop-in replacement.
45549
+ *
45550
+ * @template T - Type of the wrapped function.
45551
+ * @param run - Function to wrap.
45552
+ * @returns A new function with the same signature as `run` that escapes any
45553
+ * active context before executing.
45554
+ *
45555
+ * @example
45556
+ * ```typescript
45557
+ * const runInContextInternal = beginContext(
45558
+ * async (run: () => Promise<void>, context: IRunContext) => {
45559
+ * return await MethodContextService.runInContext(
45560
+ * () => ExecutionContextService.runInContext(run, context),
45561
+ * context,
45562
+ * );
45563
+ * },
45564
+ * );
45565
+ * ```
45566
+ */
45567
+ const beginContext = (run) => (...args) => {
45568
+ let fn = () => run(...args);
45569
+ if (MethodContextService.hasContext()) {
45570
+ fn = MethodContextService.runOutOfContext(fn);
45571
+ }
45572
+ if (ExecutionContextService.hasContext()) {
45573
+ fn = ExecutionContextService.runOutOfContext(fn);
45574
+ }
45575
+ return fn();
45576
+ };
45577
+
45578
+ const RUN_IN_MOCK_CONTEXT_METHOD_NAME = "context.runInMockContext";
45579
+ /**
45580
+ * Internal runner that executes `run` inside nested `MethodContextService` and
45581
+ * `ExecutionContextService` scopes established from the given `context`.
45582
+ *
45583
+ * Wrapped with `beginContext` so any inherited outer context is escaped first,
45584
+ * ensuring the scopes set here are the only ones visible to `run`.
45585
+ *
45586
+ * Not exported — use `runInMockContext` for external callers.
45587
+ */
45588
+ const runInContextInternal = beginContext(async (run, context) => {
45589
+ return await MethodContextService.runInContext(async () => {
45590
+ return await ExecutionContextService.runInContext(async () => {
45591
+ return await run();
45592
+ }, {
45593
+ backtest: context.backtest,
45594
+ symbol: context.symbol,
45595
+ when: context.when,
45596
+ });
45597
+ }, {
45598
+ exchangeName: context.exchangeName,
45599
+ strategyName: context.strategyName,
45600
+ frameName: context.frameName,
45601
+ });
45602
+ });
45603
+ /**
45604
+ * Runs a function inside a mock method and execution context.
45605
+ *
45606
+ * Useful in tests and scripts that need to call context-dependent services
45607
+ * (e.g. `getBacktestTimeframe`) without a real backtest runner.
45608
+ *
45609
+ * All context fields are optional; the defaults produce a minimal live-mode
45610
+ * environment pointing at placeholder schema names:
45611
+ * - `exchangeName` → `"mock-exchange"`
45612
+ * - `strategyName` → `"mock-strategy"`
45613
+ * - `frameName` → `"mock-frame"`
45614
+ * - `symbol` → `"BTCUSDT"`
45615
+ * - `backtest` → `false` (live mode)
45616
+ * - `when` → current minute boundary (`alignToInterval(new Date(), "1m")`)
45617
+ *
45618
+ * @param run - Zero-argument function to execute within the context.
45619
+ * @param context - Partial `IRunContext`; any omitted field falls back to its default.
45620
+ * @returns Promise resolving to the return value of `run`.
45621
+ *
45622
+ * @example
45623
+ * ```typescript
45624
+ * const price = await runInMockContext(
45625
+ * () => getEffectivePrice("BTCUSDT"),
45626
+ * { exchangeName: "binance", strategyName: "my-strategy", frameName: "1d" },
45627
+ * );
45628
+ * ```
45629
+ */
45630
+ async function runInMockContext(run, { exchangeName = "mock-exchange", frameName = "mock-frame", strategyName = "mock-strategy", symbol = "BTCUSDT", backtest: isBacktest = false, when = alignToInterval(new Date(), "1m"), }) {
45631
+ bt.loggerService.info(RUN_IN_MOCK_CONTEXT_METHOD_NAME, { symbol, exchangeName, strategyName, frameName });
45632
+ const context = {
45633
+ exchangeName,
45634
+ frameName,
45635
+ strategyName,
45636
+ symbol,
45637
+ backtest: isBacktest,
45638
+ when,
45639
+ };
45640
+ return await runInContextInternal(run, context);
45641
+ }
45642
+
45538
45643
  var _a, _b;
45539
45644
  const LOG_PERSIST_METHOD_NAME_WAIT_FOR_INIT = "LogPersistUtils.waitForInit";
45540
45645
  const LOG_PERSIST_METHOD_NAME_LOG = "LogPersistUtils.log";
@@ -52495,4 +52600,4 @@ const validateSignal = (signal, currentPrice) => {
52495
52600
  return !errors.length;
52496
52601
  };
52497
52602
 
52498
- export { ActionBase, Backtest, Breakeven, Broker, BrokerBase, Cache, Constant, Dump, Exchange, ExecutionContextService, Heat, HighestProfit, Live, Log, Markdown, MarkdownFileBase, MarkdownFolderBase, Memory, MethodContextService, Notification, NotificationBacktest, NotificationLive, Partial, Performance, PersistBase, PersistBreakevenAdapter, PersistCandleAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistMemoryAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PersistStorageAdapter, PositionSize, Report, ReportBase, Risk, Schedule, Storage, StorageBacktest, StorageLive, Strategy, Sync, Walker, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getRawCandles, getRiskSchema, getScheduledSignal, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenSync, listenSyncOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, percentDiff, percentToCloseCost, percentValue, readMemory, removeMemory, roundTicks, searchMemory, set, setColumns, setConfig, setLogger, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };
52603
+ export { ActionBase, Backtest, Breakeven, Broker, BrokerBase, Cache, Constant, Dump, Exchange, ExecutionContextService, Heat, HighestProfit, Live, Log, Markdown, MarkdownFileBase, MarkdownFolderBase, Memory, MethodContextService, Notification, NotificationBacktest, NotificationLive, Partial, Performance, PersistBase, PersistBreakevenAdapter, PersistCandleAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistMemoryAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PersistStorageAdapter, PositionSize, Report, ReportBase, Risk, Schedule, Storage, StorageBacktest, StorageLive, Strategy, Sync, Walker, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getRawCandles, getRiskSchema, getScheduledSignal, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, 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, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "6.5.1",
3
+ "version": "6.5.2",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
@@ -12,7 +12,7 @@
12
12
  "url": "http://paypal.me/tripolskypetr"
13
13
  },
14
14
  "license": "MIT",
15
- "homepage": "https://backtest-kit.github.io/documents/example_02_first_backtest.html",
15
+ "homepage": "https://backtest-kit.github.io/documents/article_05_ai_strategy_workflow.html",
16
16
  "keywords": [
17
17
  "backtesting",
18
18
  "backtest",
package/types.d.ts CHANGED
@@ -8743,6 +8743,52 @@ declare function dumpJson(dto: {
8743
8743
  description: string;
8744
8744
  }): Promise<void>;
8745
8745
 
8746
+ /**
8747
+ * Full context required to run a function inside both method and execution scopes.
8748
+ *
8749
+ * Combines `IMethodContext` (schema routing: exchange, strategy, frame names) with
8750
+ * `IExecutionContext` (runtime state: symbol, timestamp, backtest flag).
8751
+ *
8752
+ * Passed as a single object to `runInContextInternal`, which splits and distributes
8753
+ * the fields between `MethodContextService` and `ExecutionContextService`.
8754
+ */
8755
+ interface IRunContext extends IMethodContext, IExecutionContext {
8756
+ }
8757
+ /**
8758
+ * A zero-argument function that may be synchronous or asynchronous.
8759
+ *
8760
+ * @template T - Return type of the function.
8761
+ */
8762
+ type Function$1<T extends unknown = any> = () => T | Promise<T>;
8763
+ /**
8764
+ * Runs a function inside a mock method and execution context.
8765
+ *
8766
+ * Useful in tests and scripts that need to call context-dependent services
8767
+ * (e.g. `getBacktestTimeframe`) without a real backtest runner.
8768
+ *
8769
+ * All context fields are optional; the defaults produce a minimal live-mode
8770
+ * environment pointing at placeholder schema names:
8771
+ * - `exchangeName` → `"mock-exchange"`
8772
+ * - `strategyName` → `"mock-strategy"`
8773
+ * - `frameName` → `"mock-frame"`
8774
+ * - `symbol` → `"BTCUSDT"`
8775
+ * - `backtest` → `false` (live mode)
8776
+ * - `when` → current minute boundary (`alignToInterval(new Date(), "1m")`)
8777
+ *
8778
+ * @param run - Zero-argument function to execute within the context.
8779
+ * @param context - Partial `IRunContext`; any omitted field falls back to its default.
8780
+ * @returns Promise resolving to the return value of `run`.
8781
+ *
8782
+ * @example
8783
+ * ```typescript
8784
+ * const price = await runInMockContext(
8785
+ * () => getEffectivePrice("BTCUSDT"),
8786
+ * { exchangeName: "binance", strategyName: "my-strategy", frameName: "1d" },
8787
+ * );
8788
+ * ```
8789
+ */
8790
+ declare function runInMockContext<T extends unknown = any>(run: Function$1<T>, { exchangeName, frameName, strategyName, symbol, backtest: isBacktest, when, }: Partial<IRunContext>): Promise<T>;
8791
+
8746
8792
  /**
8747
8793
  * Portfolio heatmap statistics for a single symbol.
8748
8794
  * Aggregated metrics across all strategies for one trading pair.
@@ -28579,4 +28625,4 @@ declare const getTotalClosed: (signal: Signal) => {
28579
28625
  remainingCostBasis: number;
28580
28626
  };
28581
28627
 
28582
- export { ActionBase, type ActivateScheduledCommit, type ActivateScheduledCommitNotification, type ActivePingContract, type AverageBuyCommit, type AverageBuyCommitNotification, Backtest, type BacktestStatisticsModel, Breakeven, type BreakevenAvailableNotification, type BreakevenCommit, type BreakevenCommitNotification, type BreakevenContract, type BreakevenData, type BreakevenEvent, type BreakevenStatisticsModel, Broker, type BrokerAverageBuyPayload, BrokerBase, type BrokerBreakevenPayload, type BrokerPartialLossPayload, type BrokerPartialProfitPayload, type BrokerSignalClosePayload, type BrokerSignalOpenPayload, type BrokerTrailingStopPayload, type BrokerTrailingTakePayload, Cache, type CancelScheduledCommit, type CancelScheduledCommitNotification, type CandleData, type CandleInterval, type ClosePendingCommit, type ClosePendingCommitNotification, type ColumnConfig, type ColumnModel, 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 IPositionSizeATRParams, type IPositionSizeFixedPercentageParams, type IPositionSizeKellyParams, type IPublicAction, type IPublicCandleData, type IPublicSignalRow, type IReportDumpOptions, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskSignalRow, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISignalDto, 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 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 InfoErrorNotification, Live, type LiveStatisticsModel, Log, type LogData, Markdown, MarkdownFileBase, MarkdownFolderBase, type MarkdownName, type MeasureData, Memory, type MemoryData, 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, PersistCandleAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistMemoryAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PersistStorageAdapter, PositionSize, type ProgressBacktestContract, type ProgressWalkerContract, Report, ReportBase, type ReportName, Risk, type RiskContract, type RiskData, type RiskEvent, type RiskRejectionNotification, type RiskStatisticsModel, Schedule, type ScheduleData, type SchedulePingContract, type ScheduleStatisticsModel, type ScheduledEvent, type SignalCancelledNotification, type SignalCloseContract, type SignalClosedNotification, type SignalData, type SignalInterval, type SignalOpenContract, type SignalOpenedNotification, type SignalScheduledNotification, type SignalSyncCloseNotification, type SignalSyncContract, type SignalSyncOpenNotification, Storage, StorageBacktest, type StorageData, StorageLive, Strategy, type StrategyActionType, type StrategyCancelReason, type StrategyCloseReason, type StrategyCommitContract, type StrategyEvent, type StrategyStatisticsModel, Sync, type SyncEvent, type SyncStatisticsModel, type TBrokerCtor, type TDumpInstanceCtor, type TLogCtor, type TMarkdownBase, type TMemoryInstanceCtor, type TNotificationUtilsCtor, type TPersistBase, type TPersistBaseCtor, type TReportBase, type TStorageUtilsCtor, type TickEvent, type TrailingStopCommit, type TrailingStopCommitNotification, type TrailingTakeCommit, type TrailingTakeCommitNotification, type ValidationErrorNotification, Walker, type WalkerCompleteContract, type WalkerContract, type WalkerMetric, type SignalData$1 as WalkerSignalData, type WalkerStatisticsModel, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getRawCandles, getRiskSchema, getScheduledSignal, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenSync, listenSyncOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, percentDiff, percentToCloseCost, percentValue, readMemory, removeMemory, roundTicks, searchMemory, set, setColumns, setConfig, setLogger, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };
28628
+ export { ActionBase, type ActivateScheduledCommit, type ActivateScheduledCommitNotification, type ActivePingContract, type AverageBuyCommit, type AverageBuyCommitNotification, Backtest, type BacktestStatisticsModel, Breakeven, type BreakevenAvailableNotification, type BreakevenCommit, type BreakevenCommitNotification, type BreakevenContract, type BreakevenData, type BreakevenEvent, type BreakevenStatisticsModel, Broker, type BrokerAverageBuyPayload, BrokerBase, type BrokerBreakevenPayload, type BrokerPartialLossPayload, type BrokerPartialProfitPayload, type BrokerSignalClosePayload, type BrokerSignalOpenPayload, type BrokerTrailingStopPayload, type BrokerTrailingTakePayload, Cache, type CancelScheduledCommit, type CancelScheduledCommitNotification, type CandleData, type CandleInterval, type ClosePendingCommit, type ClosePendingCommitNotification, type ColumnConfig, type ColumnModel, 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 IPositionSizeATRParams, type IPositionSizeFixedPercentageParams, type IPositionSizeKellyParams, type IPublicAction, type IPublicCandleData, type IPublicSignalRow, type IReportDumpOptions, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskSignalRow, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISignalDto, 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 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 InfoErrorNotification, Live, type LiveStatisticsModel, Log, type LogData, Markdown, MarkdownFileBase, MarkdownFolderBase, type MarkdownName, type MeasureData, Memory, type MemoryData, 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, PersistCandleAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistMemoryAdapter, PersistNotificationAdapter, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PersistStorageAdapter, PositionSize, type ProgressBacktestContract, type ProgressWalkerContract, Report, ReportBase, type ReportName, Risk, type RiskContract, type RiskData, type RiskEvent, type RiskRejectionNotification, type RiskStatisticsModel, Schedule, type ScheduleData, type SchedulePingContract, type ScheduleStatisticsModel, type ScheduledEvent, type SignalCancelledNotification, type SignalCloseContract, type SignalClosedNotification, type SignalData, type SignalInterval, type SignalOpenContract, type SignalOpenedNotification, type SignalScheduledNotification, type SignalSyncCloseNotification, type SignalSyncContract, type SignalSyncOpenNotification, Storage, StorageBacktest, type StorageData, StorageLive, Strategy, type StrategyActionType, type StrategyCancelReason, type StrategyCloseReason, type StrategyCommitContract, type StrategyEvent, type StrategyStatisticsModel, Sync, type SyncEvent, type SyncStatisticsModel, type TBrokerCtor, type TDumpInstanceCtor, type TLogCtor, type TMarkdownBase, type TMemoryInstanceCtor, type TNotificationUtilsCtor, type TPersistBase, type TPersistBaseCtor, type TReportBase, type TStorageUtilsCtor, type TickEvent, type TrailingStopCommit, type TrailingStopCommitNotification, type TrailingTakeCommit, type TrailingTakeCommitNotification, type ValidationErrorNotification, Walker, type WalkerCompleteContract, type WalkerContract, type WalkerMetric, type SignalData$1 as WalkerSignalData, type WalkerStatisticsModel, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getRawCandles, getRiskSchema, getScheduledSignal, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, 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, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, warmCandles, writeMemory };