backtest-kit 5.6.0 → 5.6.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
@@ -443,6 +443,91 @@ const GLOBAL_CONFIG = {
443
443
  * Binance requirement
444
444
  */
445
445
  CC_AGGREGATED_TRADES_MAX_MINUTES: 60,
446
+ /**
447
+ * Maximum number of events to keep in backtest markdown report storage.
448
+ * Older events are removed (FIFO) when this limit is exceeded.
449
+ *
450
+ * Default: 250 events
451
+ */
452
+ CC_MAX_BACKTEST_MARKDOWN_ROWS: 250,
453
+ /**
454
+ * Maximum number of events to keep in breakeven markdown report storage.
455
+ * Older events are removed (FIFO) when this limit is exceeded.
456
+ *
457
+ * Default: 250 events
458
+ */
459
+ CC_MAX_BREAKEVEN_MARKDOWN_ROWS: 250,
460
+ /**
461
+ * Maximum number of events to keep in heatmap markdown report storage.
462
+ * Older events are removed (FIFO) when this limit is exceeded.
463
+ *
464
+ * Default: 250 events
465
+ */
466
+ CC_MAX_HEATMAP_MARKDOWN_ROWS: 250,
467
+ /**
468
+ * Maximum number of events to keep in highest profit markdown report storage.
469
+ * Older events are removed (FIFO) when this limit is exceeded.
470
+ *
471
+ * Default: 250 events
472
+ */
473
+ CC_MAX_HIGHEST_PROFIT_MARKDOWN_ROWS: 250,
474
+ /**
475
+ * Maximum number of events to keep in live markdown report storage.
476
+ * Older events are removed (FIFO) when this limit is exceeded.
477
+ *
478
+ * Default: 250 events
479
+ */
480
+ CC_MAX_LIVE_MARKDOWN_ROWS: 250,
481
+ /**
482
+ * Maximum number of events to keep in partial markdown report storage.
483
+ * Older events are removed (FIFO) when this limit is exceeded.
484
+ *
485
+ * Default: 250 events
486
+ */
487
+ CC_MAX_PARTIAL_MARKDOWN_ROWS: 250,
488
+ /**
489
+ * Maximum number of events to keep in risk markdown report storage.
490
+ * Older events are removed (FIFO) when this limit is exceeded.
491
+ *
492
+ * Default: 250 events
493
+ */
494
+ CC_MAX_RISK_MARKDOWN_ROWS: 250,
495
+ /**
496
+ * Maximum number of events to keep in schedule markdown report storage.
497
+ * Older events are removed (FIFO) when this limit is exceeded.
498
+ *
499
+ * Default: 250 events
500
+ */
501
+ CC_MAX_SCHEDULE_MARKDOWN_ROWS: 250,
502
+ /**
503
+ * Maximum number of events to keep in strategy markdown report storage.
504
+ * Older events are removed (FIFO) when this limit is exceeded.
505
+ *
506
+ * Default: 250 events
507
+ */
508
+ CC_MAX_STRATEGY_MARKDOWN_ROWS: 250,
509
+ /**
510
+ * Maximum number of events to keep in sync markdown report storage.
511
+ * Older events are removed (FIFO) when this limit is exceeded.
512
+ *
513
+ * Default: 250 events
514
+ */
515
+ CC_MAX_SYNC_MARKDOWN_ROWS: 250,
516
+ /**
517
+ * Number of top strategies to include in the walker comparison table.
518
+ *
519
+ * Default: 10 strategies
520
+ */
521
+ CC_WALKER_MARKDOWN_TOP_N: 10,
522
+ /**
523
+ * Maximum number of performance metric events to keep in storage.
524
+ * Older events are removed when this limit is exceeded.
525
+ * Higher than other report event limits because performance metrics are lightweight
526
+ * and benefit from larger sample sizes for accurate statistical analysis.
527
+ *
528
+ * Default: 10000 events
529
+ */
530
+ CC_MAX_PERFORMANCE_MARKDOWN_ROWS: 10000,
446
531
  /**
447
532
  * Maximum number of notifications to keep in storage.
448
533
  * Older notifications are removed when this limit is exceeded.
@@ -18502,9 +18587,24 @@ const highest_profit_columns = [
18502
18587
  format: (data) => data.position.toUpperCase(),
18503
18588
  isVisible: () => true,
18504
18589
  },
18590
+ {
18591
+ key: "pnl",
18592
+ label: "PNL (net)",
18593
+ format: (data) => {
18594
+ const pnlPercentage = data.pnl.pnlPercentage;
18595
+ return `${pnlPercentage > 0 ? "+" : ""}${pnlPercentage.toFixed(2)}%`;
18596
+ },
18597
+ isVisible: () => true,
18598
+ },
18599
+ {
18600
+ key: "pnlCost",
18601
+ label: "PNL (USD)",
18602
+ format: (data) => `${data.pnl.pnlCost > 0 ? "+" : ""}${data.pnl.pnlCost.toFixed(2)} USD`,
18603
+ isVisible: () => true,
18604
+ },
18505
18605
  {
18506
18606
  key: "currentPrice",
18507
- label: "Record Price",
18607
+ label: "Peak Price",
18508
18608
  format: (data) => `${data.currentPrice.toFixed(8)} USD`,
18509
18609
  isVisible: () => true,
18510
18610
  },
@@ -19320,8 +19420,6 @@ function isUnsafe$3(value) {
19320
19420
  }
19321
19421
  return false;
19322
19422
  }
19323
- /** Maximum number of signals to store in backtest reports */
19324
- const MAX_EVENTS$a = 250;
19325
19423
  /**
19326
19424
  * Storage class for accumulating closed signals per strategy.
19327
19425
  * Maintains a list of all closed signals and provides methods to generate reports.
@@ -19342,8 +19440,8 @@ let ReportStorage$9 = class ReportStorage {
19342
19440
  */
19343
19441
  addSignal(data) {
19344
19442
  this._signalList.unshift(data);
19345
- // Trim queue if exceeded MAX_EVENTS
19346
- if (this._signalList.length > MAX_EVENTS$a) {
19443
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_BACKTEST_MARKDOWN_ROWS
19444
+ if (this._signalList.length > GLOBAL_CONFIG.CC_MAX_BACKTEST_MARKDOWN_ROWS) {
19347
19445
  this._signalList.pop();
19348
19446
  }
19349
19447
  }
@@ -19778,8 +19876,6 @@ function isUnsafe$2(value) {
19778
19876
  }
19779
19877
  return false;
19780
19878
  }
19781
- /** Maximum number of events to store in live trading reports */
19782
- const MAX_EVENTS$9 = 250;
19783
19879
  /**
19784
19880
  * Storage class for accumulating all tick events per strategy.
19785
19881
  * Maintains a chronological list of all events (idle, opened, active, closed).
@@ -19816,7 +19912,7 @@ let ReportStorage$8 = class ReportStorage {
19816
19912
  }
19817
19913
  {
19818
19914
  this._eventList.unshift(newEvent);
19819
- if (this._eventList.length > MAX_EVENTS$9) {
19915
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19820
19916
  this._eventList.pop();
19821
19917
  }
19822
19918
  }
@@ -19845,8 +19941,8 @@ let ReportStorage$8 = class ReportStorage {
19845
19941
  pendingAt: data.signal.pendingAt,
19846
19942
  scheduledAt: data.signal.scheduledAt,
19847
19943
  });
19848
- // Trim queue if exceeded MAX_EVENTS
19849
- if (this._eventList.length > MAX_EVENTS$9) {
19944
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
19945
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19850
19946
  this._eventList.pop();
19851
19947
  }
19852
19948
  }
@@ -19889,8 +19985,8 @@ let ReportStorage$8 = class ReportStorage {
19889
19985
  }
19890
19986
  // If no previous active event found, add new event
19891
19987
  this._eventList.unshift(newEvent);
19892
- // Trim queue if exceeded MAX_EVENTS
19893
- if (this._eventList.length > MAX_EVENTS$9) {
19988
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
19989
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19894
19990
  this._eventList.pop();
19895
19991
  }
19896
19992
  }
@@ -19926,8 +20022,8 @@ let ReportStorage$8 = class ReportStorage {
19926
20022
  scheduledAt: data.signal.scheduledAt,
19927
20023
  };
19928
20024
  this._eventList.unshift(newEvent);
19929
- // Trim queue if exceeded MAX_EVENTS
19930
- if (this._eventList.length > MAX_EVENTS$9) {
20025
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
20026
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19931
20027
  this._eventList.pop();
19932
20028
  }
19933
20029
  }
@@ -19954,8 +20050,8 @@ let ReportStorage$8 = class ReportStorage {
19954
20050
  totalPartials: data.signal.totalPartials,
19955
20051
  scheduledAt: data.signal.scheduledAt,
19956
20052
  });
19957
- // Trim queue if exceeded MAX_EVENTS
19958
- if (this._eventList.length > MAX_EVENTS$9) {
20053
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
20054
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19959
20055
  this._eventList.pop();
19960
20056
  }
19961
20057
  }
@@ -19997,8 +20093,8 @@ let ReportStorage$8 = class ReportStorage {
19997
20093
  }
19998
20094
  // If no previous waiting event found, add new event
19999
20095
  this._eventList.unshift(newEvent);
20000
- // Trim queue if exceeded MAX_EVENTS
20001
- if (this._eventList.length > MAX_EVENTS$9) {
20096
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
20097
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
20002
20098
  this._eventList.pop();
20003
20099
  }
20004
20100
  }
@@ -20026,8 +20122,8 @@ let ReportStorage$8 = class ReportStorage {
20026
20122
  cancelReason: data.reason,
20027
20123
  scheduledAt: data.signal.scheduledAt,
20028
20124
  });
20029
- // Trim queue if exceeded MAX_EVENTS
20030
- if (this._eventList.length > MAX_EVENTS$9) {
20125
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
20126
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
20031
20127
  this._eventList.pop();
20032
20128
  }
20033
20129
  }
@@ -20481,8 +20577,6 @@ const CREATE_FILE_NAME_FN$9 = (symbol, strategyName, exchangeName, frameName, ti
20481
20577
  parts.push("live");
20482
20578
  return `${parts.join("_")}-${timestamp}.md`;
20483
20579
  };
20484
- /** Maximum number of events to store in schedule reports */
20485
- const MAX_EVENTS$8 = 250;
20486
20580
  /**
20487
20581
  * Storage class for accumulating scheduled signal events per strategy.
20488
20582
  * Maintains a chronological list of scheduled and cancelled events.
@@ -20522,8 +20616,8 @@ let ReportStorage$7 = class ReportStorage {
20522
20616
  pnl: data.signal.pnl,
20523
20617
  scheduledAt: data.signal.scheduledAt,
20524
20618
  });
20525
- // Trim queue if exceeded MAX_EVENTS
20526
- if (this._eventList.length > MAX_EVENTS$8) {
20619
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS
20620
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS) {
20527
20621
  this._eventList.pop();
20528
20622
  }
20529
20623
  }
@@ -20558,8 +20652,8 @@ let ReportStorage$7 = class ReportStorage {
20558
20652
  scheduledAt: data.signal.scheduledAt,
20559
20653
  };
20560
20654
  this._eventList.unshift(newEvent);
20561
- // Trim queue if exceeded MAX_EVENTS
20562
- if (this._eventList.length > MAX_EVENTS$8) {
20655
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS
20656
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS) {
20563
20657
  this._eventList.pop();
20564
20658
  }
20565
20659
  }
@@ -20596,8 +20690,8 @@ let ReportStorage$7 = class ReportStorage {
20596
20690
  scheduledAt: data.signal.scheduledAt,
20597
20691
  };
20598
20692
  this._eventList.unshift(newEvent);
20599
- // Trim queue if exceeded MAX_EVENTS
20600
- if (this._eventList.length > MAX_EVENTS$8) {
20693
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS
20694
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS) {
20601
20695
  this._eventList.pop();
20602
20696
  }
20603
20697
  }
@@ -21004,8 +21098,6 @@ function percentile(sortedArray, p) {
21004
21098
  const index = Math.ceil((sortedArray.length * p) / 100) - 1;
21005
21099
  return sortedArray[Math.max(0, index)];
21006
21100
  }
21007
- /** Maximum number of performance events to store per strategy */
21008
- const MAX_EVENTS$7 = 10000;
21009
21101
  /**
21010
21102
  * Storage class for accumulating performance metrics per strategy.
21011
21103
  * Maintains a list of all performance events and provides aggregated statistics.
@@ -21026,8 +21118,8 @@ class PerformanceStorage {
21026
21118
  */
21027
21119
  addEvent(event) {
21028
21120
  this._events.unshift(event);
21029
- // Trim queue if exceeded MAX_EVENTS (keep most recent)
21030
- if (this._events.length > MAX_EVENTS$7) {
21121
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_PERFORMANCE_MARKDOWN_ROWS (keep most recent)
21122
+ if (this._events.length > GLOBAL_CONFIG.CC_MAX_PERFORMANCE_MARKDOWN_ROWS) {
21031
21123
  this._events.pop();
21032
21124
  }
21033
21125
  }
@@ -21144,6 +21236,10 @@ class PerformanceStorage {
21144
21236
  return [
21145
21237
  `# Performance Report: ${strategyName}`,
21146
21238
  "",
21239
+ summaryTable,
21240
+ "",
21241
+ "**Note:** All durations are in milliseconds. P95/P99 represent 95th and 99th percentile response times. Wait times show the interval between consecutive events of the same type.",
21242
+ "",
21147
21243
  `**Total events:** ${stats.totalEvents}`,
21148
21244
  `**Total execution time:** ${stats.totalDuration.toFixed(2)}ms`,
21149
21245
  `**Number of metric types:** ${Object.keys(stats.metricStats).length}`,
@@ -21152,11 +21248,6 @@ class PerformanceStorage {
21152
21248
  "",
21153
21249
  percentages.join("\n"),
21154
21250
  "",
21155
- "## Detailed Metrics",
21156
- "",
21157
- summaryTable,
21158
- "",
21159
- "**Note:** All durations are in milliseconds. P95/P99 represent 95th and 99th percentile response times. Wait times show the interval between consecutive events of the same type."
21160
21251
  ].join("\n");
21161
21252
  }
21162
21253
  /**
@@ -21496,7 +21587,7 @@ let ReportStorage$6 = class ReportStorage {
21496
21587
  * @param columns - Column configuration for formatting the strategy comparison table
21497
21588
  * @returns Markdown formatted comparison table
21498
21589
  */
21499
- async getComparisonTable(topN = 10, columns = COLUMN_CONFIG.walker_strategy_columns) {
21590
+ async getComparisonTable(topN = GLOBAL_CONFIG.CC_WALKER_MARKDOWN_TOP_N, columns = COLUMN_CONFIG.walker_strategy_columns) {
21500
21591
  if (this._strategyResults.length === 0) {
21501
21592
  return "No strategy results available.";
21502
21593
  }
@@ -21598,7 +21689,7 @@ let ReportStorage$6 = class ReportStorage {
21598
21689
  "",
21599
21690
  "## Top Strategies Comparison",
21600
21691
  "",
21601
- await this.getComparisonTable(10, strategyColumns),
21692
+ await this.getComparisonTable(GLOBAL_CONFIG.CC_WALKER_MARKDOWN_TOP_N, strategyColumns),
21602
21693
  "",
21603
21694
  "## All Signals (PNL Table)",
21604
21695
  "",
@@ -21896,8 +21987,6 @@ function isUnsafe(value) {
21896
21987
  }
21897
21988
  return false;
21898
21989
  }
21899
- /** Maximum number of signals to store per symbol in heatmap reports */
21900
- const MAX_EVENTS$6 = 250;
21901
21990
  /**
21902
21991
  * Storage class for accumulating closed signals per strategy and generating heatmap.
21903
21992
  * Maintains symbol-level statistics and provides portfolio-wide metrics.
@@ -21922,8 +22011,8 @@ class HeatmapStorage {
21922
22011
  }
21923
22012
  const signals = this.symbolData.get(symbol);
21924
22013
  signals.unshift(data);
21925
- // Trim queue if exceeded MAX_EVENTS per symbol
21926
- if (signals.length > MAX_EVENTS$6) {
22014
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_HEATMAP_MARKDOWN_ROWS per symbol
22015
+ if (signals.length > GLOBAL_CONFIG.CC_MAX_HEATMAP_MARKDOWN_ROWS) {
21927
22016
  signals.pop();
21928
22017
  }
21929
22018
  }
@@ -23695,8 +23784,6 @@ const CREATE_FILE_NAME_FN$5 = (symbol, strategyName, exchangeName, frameName, ti
23695
23784
  parts.push("live");
23696
23785
  return `${parts.join("_")}-${timestamp}.md`;
23697
23786
  };
23698
- /** Maximum number of events to store in partial reports */
23699
- const MAX_EVENTS$5 = 250;
23700
23787
  /**
23701
23788
  * Storage class for accumulating partial profit/loss events per symbol-strategy pair.
23702
23789
  * Maintains a chronological list of profit and loss level events.
@@ -23743,8 +23830,8 @@ let ReportStorage$5 = class ReportStorage {
23743
23830
  scheduledAt: data.scheduledAt,
23744
23831
  backtest,
23745
23832
  });
23746
- // Trim queue if exceeded MAX_EVENTS
23747
- if (this._eventList.length > MAX_EVENTS$5) {
23833
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_PARTIAL_MARKDOWN_ROWS
23834
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_PARTIAL_MARKDOWN_ROWS) {
23748
23835
  this._eventList.pop();
23749
23836
  }
23750
23837
  }
@@ -23781,8 +23868,8 @@ let ReportStorage$5 = class ReportStorage {
23781
23868
  scheduledAt: data.scheduledAt,
23782
23869
  backtest,
23783
23870
  });
23784
- // Trim queue if exceeded MAX_EVENTS
23785
- if (this._eventList.length > MAX_EVENTS$5) {
23871
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_PARTIAL_MARKDOWN_ROWS
23872
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_PARTIAL_MARKDOWN_ROWS) {
23786
23873
  this._eventList.pop();
23787
23874
  }
23788
23875
  }
@@ -24838,8 +24925,6 @@ const CREATE_FILE_NAME_FN$4 = (symbol, strategyName, exchangeName, frameName, ti
24838
24925
  parts.push("live");
24839
24926
  return `${parts.join("_")}-${timestamp}.md`;
24840
24927
  };
24841
- /** Maximum number of events to store in breakeven reports */
24842
- const MAX_EVENTS$4 = 250;
24843
24928
  /**
24844
24929
  * Storage class for accumulating breakeven events per symbol-strategy pair.
24845
24930
  * Maintains a chronological list of breakeven events.
@@ -24884,8 +24969,8 @@ let ReportStorage$4 = class ReportStorage {
24884
24969
  scheduledAt: data.scheduledAt,
24885
24970
  backtest,
24886
24971
  });
24887
- // Trim queue if exceeded MAX_EVENTS
24888
- if (this._eventList.length > MAX_EVENTS$4) {
24972
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_BREAKEVEN_MARKDOWN_ROWS
24973
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_BREAKEVEN_MARKDOWN_ROWS) {
24889
24974
  this._eventList.pop();
24890
24975
  }
24891
24976
  }
@@ -25514,8 +25599,6 @@ const CREATE_FILE_NAME_FN$3 = (symbol, strategyName, exchangeName, frameName, ti
25514
25599
  parts.push("live");
25515
25600
  return `${parts.join("_")}-${timestamp}.md`;
25516
25601
  };
25517
- /** Maximum number of events to store in risk reports */
25518
- const MAX_EVENTS$3 = 250;
25519
25602
  /**
25520
25603
  * Storage class for accumulating risk rejection events per symbol-strategy pair.
25521
25604
  * Maintains a chronological list of rejected signals due to risk limits.
@@ -25536,8 +25619,8 @@ let ReportStorage$3 = class ReportStorage {
25536
25619
  */
25537
25620
  addRejectionEvent(event) {
25538
25621
  this._eventList.unshift(event);
25539
- // Trim queue if exceeded MAX_EVENTS
25540
- if (this._eventList.length > MAX_EVENTS$3) {
25622
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_RISK_MARKDOWN_ROWS
25623
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_RISK_MARKDOWN_ROWS) {
25541
25624
  this._eventList.pop();
25542
25625
  }
25543
25626
  }
@@ -28630,16 +28713,10 @@ const CREATE_FILE_NAME_FN$2 = (symbol, strategyName, exchangeName, frameName, ti
28630
28713
  parts.push("live");
28631
28714
  return `${parts.join("_")}-${timestamp}.md`;
28632
28715
  };
28633
- /**
28634
- * Maximum number of events to store per symbol-strategy pair.
28635
- * Older events are discarded when this limit is exceeded.
28636
- * @internal
28637
- */
28638
- const MAX_EVENTS$2 = 250;
28639
28716
  /**
28640
28717
  * In-memory storage for accumulating strategy events per symbol-strategy pair.
28641
28718
  *
28642
- * Maintains a rolling window of the most recent events (up to MAX_EVENTS),
28719
+ * Maintains a rolling window of the most recent events (up to GLOBAL_CONFIG.CC_MAX_STRATEGY_MARKDOWN_ROWS),
28643
28720
  * with newer events added to the front of the list. Provides methods to:
28644
28721
  * - Add new events (FIFO queue with max size)
28645
28722
  * - Retrieve aggregated statistics
@@ -28668,13 +28745,13 @@ let ReportStorage$2 = class ReportStorage {
28668
28745
  * Adds a new event to the storage.
28669
28746
  *
28670
28747
  * Events are added to the front of the list (most recent first).
28671
- * If the list exceeds MAX_EVENTS, the oldest event is removed.
28748
+ * If the list exceeds GLOBAL_CONFIG.CC_MAX_STRATEGY_MARKDOWN_ROWS, the oldest event is removed.
28672
28749
  *
28673
28750
  * @param event - The strategy event to store
28674
28751
  */
28675
28752
  addEvent(event) {
28676
28753
  this._eventList.unshift(event);
28677
- if (this._eventList.length > MAX_EVENTS$2) {
28754
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_STRATEGY_MARKDOWN_ROWS) {
28678
28755
  this._eventList.pop();
28679
28756
  }
28680
28757
  }
@@ -29545,8 +29622,6 @@ const CREATE_FILE_NAME_FN$1 = (symbol, strategyName, exchangeName, frameName, ti
29545
29622
  parts.push("live");
29546
29623
  return `${parts.join("_")}-${timestamp}.md`;
29547
29624
  };
29548
- /** Maximum number of events to store in sync reports */
29549
- const MAX_EVENTS$1 = 250;
29550
29625
  /**
29551
29626
  * Storage class for accumulating signal sync events per symbol-strategy-exchange-frame-backtest combination.
29552
29627
  * Maintains a chronological list of signal-open and signal-close events.
@@ -29561,7 +29636,7 @@ let ReportStorage$1 = class ReportStorage {
29561
29636
  }
29562
29637
  addEvent(event) {
29563
29638
  this._eventList.unshift(event);
29564
- if (this._eventList.length > MAX_EVENTS$1) {
29639
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_SYNC_MARKDOWN_ROWS) {
29565
29640
  this._eventList.pop();
29566
29641
  }
29567
29642
  }
@@ -29764,8 +29839,6 @@ const CREATE_FILE_NAME_FN = (symbol, strategyName, exchangeName, frameName, time
29764
29839
  parts.push("live");
29765
29840
  return `${parts.join("_")}-${timestamp}.md`;
29766
29841
  };
29767
- /** Maximum number of events to store per combination */
29768
- const MAX_EVENTS = 250;
29769
29842
  /**
29770
29843
  * Accumulates highest profit events per symbol-strategy-exchange-frame combination.
29771
29844
  */
@@ -29787,13 +29860,14 @@ class ReportStorage {
29787
29860
  strategyName: data.strategyName,
29788
29861
  signalId: data.id,
29789
29862
  position: data.position,
29863
+ pnl: data.pnl,
29790
29864
  currentPrice,
29791
29865
  priceOpen: data.priceOpen,
29792
29866
  priceTakeProfit: data.priceTakeProfit,
29793
29867
  priceStopLoss: data.priceStopLoss,
29794
29868
  backtest,
29795
29869
  });
29796
- if (this._eventList.length > MAX_EVENTS) {
29870
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_HIGHEST_PROFIT_MARKDOWN_ROWS) {
29797
29871
  this._eventList.pop();
29798
29872
  }
29799
29873
  }
package/build/index.mjs CHANGED
@@ -423,6 +423,91 @@ const GLOBAL_CONFIG = {
423
423
  * Binance requirement
424
424
  */
425
425
  CC_AGGREGATED_TRADES_MAX_MINUTES: 60,
426
+ /**
427
+ * Maximum number of events to keep in backtest markdown report storage.
428
+ * Older events are removed (FIFO) when this limit is exceeded.
429
+ *
430
+ * Default: 250 events
431
+ */
432
+ CC_MAX_BACKTEST_MARKDOWN_ROWS: 250,
433
+ /**
434
+ * Maximum number of events to keep in breakeven markdown report storage.
435
+ * Older events are removed (FIFO) when this limit is exceeded.
436
+ *
437
+ * Default: 250 events
438
+ */
439
+ CC_MAX_BREAKEVEN_MARKDOWN_ROWS: 250,
440
+ /**
441
+ * Maximum number of events to keep in heatmap markdown report storage.
442
+ * Older events are removed (FIFO) when this limit is exceeded.
443
+ *
444
+ * Default: 250 events
445
+ */
446
+ CC_MAX_HEATMAP_MARKDOWN_ROWS: 250,
447
+ /**
448
+ * Maximum number of events to keep in highest profit markdown report storage.
449
+ * Older events are removed (FIFO) when this limit is exceeded.
450
+ *
451
+ * Default: 250 events
452
+ */
453
+ CC_MAX_HIGHEST_PROFIT_MARKDOWN_ROWS: 250,
454
+ /**
455
+ * Maximum number of events to keep in live markdown report storage.
456
+ * Older events are removed (FIFO) when this limit is exceeded.
457
+ *
458
+ * Default: 250 events
459
+ */
460
+ CC_MAX_LIVE_MARKDOWN_ROWS: 250,
461
+ /**
462
+ * Maximum number of events to keep in partial markdown report storage.
463
+ * Older events are removed (FIFO) when this limit is exceeded.
464
+ *
465
+ * Default: 250 events
466
+ */
467
+ CC_MAX_PARTIAL_MARKDOWN_ROWS: 250,
468
+ /**
469
+ * Maximum number of events to keep in risk markdown report storage.
470
+ * Older events are removed (FIFO) when this limit is exceeded.
471
+ *
472
+ * Default: 250 events
473
+ */
474
+ CC_MAX_RISK_MARKDOWN_ROWS: 250,
475
+ /**
476
+ * Maximum number of events to keep in schedule markdown report storage.
477
+ * Older events are removed (FIFO) when this limit is exceeded.
478
+ *
479
+ * Default: 250 events
480
+ */
481
+ CC_MAX_SCHEDULE_MARKDOWN_ROWS: 250,
482
+ /**
483
+ * Maximum number of events to keep in strategy markdown report storage.
484
+ * Older events are removed (FIFO) when this limit is exceeded.
485
+ *
486
+ * Default: 250 events
487
+ */
488
+ CC_MAX_STRATEGY_MARKDOWN_ROWS: 250,
489
+ /**
490
+ * Maximum number of events to keep in sync markdown report storage.
491
+ * Older events are removed (FIFO) when this limit is exceeded.
492
+ *
493
+ * Default: 250 events
494
+ */
495
+ CC_MAX_SYNC_MARKDOWN_ROWS: 250,
496
+ /**
497
+ * Number of top strategies to include in the walker comparison table.
498
+ *
499
+ * Default: 10 strategies
500
+ */
501
+ CC_WALKER_MARKDOWN_TOP_N: 10,
502
+ /**
503
+ * Maximum number of performance metric events to keep in storage.
504
+ * Older events are removed when this limit is exceeded.
505
+ * Higher than other report event limits because performance metrics are lightweight
506
+ * and benefit from larger sample sizes for accurate statistical analysis.
507
+ *
508
+ * Default: 10000 events
509
+ */
510
+ CC_MAX_PERFORMANCE_MARKDOWN_ROWS: 10000,
426
511
  /**
427
512
  * Maximum number of notifications to keep in storage.
428
513
  * Older notifications are removed when this limit is exceeded.
@@ -18482,9 +18567,24 @@ const highest_profit_columns = [
18482
18567
  format: (data) => data.position.toUpperCase(),
18483
18568
  isVisible: () => true,
18484
18569
  },
18570
+ {
18571
+ key: "pnl",
18572
+ label: "PNL (net)",
18573
+ format: (data) => {
18574
+ const pnlPercentage = data.pnl.pnlPercentage;
18575
+ return `${pnlPercentage > 0 ? "+" : ""}${pnlPercentage.toFixed(2)}%`;
18576
+ },
18577
+ isVisible: () => true,
18578
+ },
18579
+ {
18580
+ key: "pnlCost",
18581
+ label: "PNL (USD)",
18582
+ format: (data) => `${data.pnl.pnlCost > 0 ? "+" : ""}${data.pnl.pnlCost.toFixed(2)} USD`,
18583
+ isVisible: () => true,
18584
+ },
18485
18585
  {
18486
18586
  key: "currentPrice",
18487
- label: "Record Price",
18587
+ label: "Peak Price",
18488
18588
  format: (data) => `${data.currentPrice.toFixed(8)} USD`,
18489
18589
  isVisible: () => true,
18490
18590
  },
@@ -19300,8 +19400,6 @@ function isUnsafe$3(value) {
19300
19400
  }
19301
19401
  return false;
19302
19402
  }
19303
- /** Maximum number of signals to store in backtest reports */
19304
- const MAX_EVENTS$a = 250;
19305
19403
  /**
19306
19404
  * Storage class for accumulating closed signals per strategy.
19307
19405
  * Maintains a list of all closed signals and provides methods to generate reports.
@@ -19322,8 +19420,8 @@ let ReportStorage$9 = class ReportStorage {
19322
19420
  */
19323
19421
  addSignal(data) {
19324
19422
  this._signalList.unshift(data);
19325
- // Trim queue if exceeded MAX_EVENTS
19326
- if (this._signalList.length > MAX_EVENTS$a) {
19423
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_BACKTEST_MARKDOWN_ROWS
19424
+ if (this._signalList.length > GLOBAL_CONFIG.CC_MAX_BACKTEST_MARKDOWN_ROWS) {
19327
19425
  this._signalList.pop();
19328
19426
  }
19329
19427
  }
@@ -19758,8 +19856,6 @@ function isUnsafe$2(value) {
19758
19856
  }
19759
19857
  return false;
19760
19858
  }
19761
- /** Maximum number of events to store in live trading reports */
19762
- const MAX_EVENTS$9 = 250;
19763
19859
  /**
19764
19860
  * Storage class for accumulating all tick events per strategy.
19765
19861
  * Maintains a chronological list of all events (idle, opened, active, closed).
@@ -19796,7 +19892,7 @@ let ReportStorage$8 = class ReportStorage {
19796
19892
  }
19797
19893
  {
19798
19894
  this._eventList.unshift(newEvent);
19799
- if (this._eventList.length > MAX_EVENTS$9) {
19895
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19800
19896
  this._eventList.pop();
19801
19897
  }
19802
19898
  }
@@ -19825,8 +19921,8 @@ let ReportStorage$8 = class ReportStorage {
19825
19921
  pendingAt: data.signal.pendingAt,
19826
19922
  scheduledAt: data.signal.scheduledAt,
19827
19923
  });
19828
- // Trim queue if exceeded MAX_EVENTS
19829
- if (this._eventList.length > MAX_EVENTS$9) {
19924
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
19925
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19830
19926
  this._eventList.pop();
19831
19927
  }
19832
19928
  }
@@ -19869,8 +19965,8 @@ let ReportStorage$8 = class ReportStorage {
19869
19965
  }
19870
19966
  // If no previous active event found, add new event
19871
19967
  this._eventList.unshift(newEvent);
19872
- // Trim queue if exceeded MAX_EVENTS
19873
- if (this._eventList.length > MAX_EVENTS$9) {
19968
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
19969
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19874
19970
  this._eventList.pop();
19875
19971
  }
19876
19972
  }
@@ -19906,8 +20002,8 @@ let ReportStorage$8 = class ReportStorage {
19906
20002
  scheduledAt: data.signal.scheduledAt,
19907
20003
  };
19908
20004
  this._eventList.unshift(newEvent);
19909
- // Trim queue if exceeded MAX_EVENTS
19910
- if (this._eventList.length > MAX_EVENTS$9) {
20005
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
20006
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19911
20007
  this._eventList.pop();
19912
20008
  }
19913
20009
  }
@@ -19934,8 +20030,8 @@ let ReportStorage$8 = class ReportStorage {
19934
20030
  totalPartials: data.signal.totalPartials,
19935
20031
  scheduledAt: data.signal.scheduledAt,
19936
20032
  });
19937
- // Trim queue if exceeded MAX_EVENTS
19938
- if (this._eventList.length > MAX_EVENTS$9) {
20033
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
20034
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19939
20035
  this._eventList.pop();
19940
20036
  }
19941
20037
  }
@@ -19977,8 +20073,8 @@ let ReportStorage$8 = class ReportStorage {
19977
20073
  }
19978
20074
  // If no previous waiting event found, add new event
19979
20075
  this._eventList.unshift(newEvent);
19980
- // Trim queue if exceeded MAX_EVENTS
19981
- if (this._eventList.length > MAX_EVENTS$9) {
20076
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
20077
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
19982
20078
  this._eventList.pop();
19983
20079
  }
19984
20080
  }
@@ -20006,8 +20102,8 @@ let ReportStorage$8 = class ReportStorage {
20006
20102
  cancelReason: data.reason,
20007
20103
  scheduledAt: data.signal.scheduledAt,
20008
20104
  });
20009
- // Trim queue if exceeded MAX_EVENTS
20010
- if (this._eventList.length > MAX_EVENTS$9) {
20105
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS
20106
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_LIVE_MARKDOWN_ROWS) {
20011
20107
  this._eventList.pop();
20012
20108
  }
20013
20109
  }
@@ -20461,8 +20557,6 @@ const CREATE_FILE_NAME_FN$9 = (symbol, strategyName, exchangeName, frameName, ti
20461
20557
  parts.push("live");
20462
20558
  return `${parts.join("_")}-${timestamp}.md`;
20463
20559
  };
20464
- /** Maximum number of events to store in schedule reports */
20465
- const MAX_EVENTS$8 = 250;
20466
20560
  /**
20467
20561
  * Storage class for accumulating scheduled signal events per strategy.
20468
20562
  * Maintains a chronological list of scheduled and cancelled events.
@@ -20502,8 +20596,8 @@ let ReportStorage$7 = class ReportStorage {
20502
20596
  pnl: data.signal.pnl,
20503
20597
  scheduledAt: data.signal.scheduledAt,
20504
20598
  });
20505
- // Trim queue if exceeded MAX_EVENTS
20506
- if (this._eventList.length > MAX_EVENTS$8) {
20599
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS
20600
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS) {
20507
20601
  this._eventList.pop();
20508
20602
  }
20509
20603
  }
@@ -20538,8 +20632,8 @@ let ReportStorage$7 = class ReportStorage {
20538
20632
  scheduledAt: data.signal.scheduledAt,
20539
20633
  };
20540
20634
  this._eventList.unshift(newEvent);
20541
- // Trim queue if exceeded MAX_EVENTS
20542
- if (this._eventList.length > MAX_EVENTS$8) {
20635
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS
20636
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS) {
20543
20637
  this._eventList.pop();
20544
20638
  }
20545
20639
  }
@@ -20576,8 +20670,8 @@ let ReportStorage$7 = class ReportStorage {
20576
20670
  scheduledAt: data.signal.scheduledAt,
20577
20671
  };
20578
20672
  this._eventList.unshift(newEvent);
20579
- // Trim queue if exceeded MAX_EVENTS
20580
- if (this._eventList.length > MAX_EVENTS$8) {
20673
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS
20674
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_SCHEDULE_MARKDOWN_ROWS) {
20581
20675
  this._eventList.pop();
20582
20676
  }
20583
20677
  }
@@ -20984,8 +21078,6 @@ function percentile(sortedArray, p) {
20984
21078
  const index = Math.ceil((sortedArray.length * p) / 100) - 1;
20985
21079
  return sortedArray[Math.max(0, index)];
20986
21080
  }
20987
- /** Maximum number of performance events to store per strategy */
20988
- const MAX_EVENTS$7 = 10000;
20989
21081
  /**
20990
21082
  * Storage class for accumulating performance metrics per strategy.
20991
21083
  * Maintains a list of all performance events and provides aggregated statistics.
@@ -21006,8 +21098,8 @@ class PerformanceStorage {
21006
21098
  */
21007
21099
  addEvent(event) {
21008
21100
  this._events.unshift(event);
21009
- // Trim queue if exceeded MAX_EVENTS (keep most recent)
21010
- if (this._events.length > MAX_EVENTS$7) {
21101
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_PERFORMANCE_MARKDOWN_ROWS (keep most recent)
21102
+ if (this._events.length > GLOBAL_CONFIG.CC_MAX_PERFORMANCE_MARKDOWN_ROWS) {
21011
21103
  this._events.pop();
21012
21104
  }
21013
21105
  }
@@ -21124,6 +21216,10 @@ class PerformanceStorage {
21124
21216
  return [
21125
21217
  `# Performance Report: ${strategyName}`,
21126
21218
  "",
21219
+ summaryTable,
21220
+ "",
21221
+ "**Note:** All durations are in milliseconds. P95/P99 represent 95th and 99th percentile response times. Wait times show the interval between consecutive events of the same type.",
21222
+ "",
21127
21223
  `**Total events:** ${stats.totalEvents}`,
21128
21224
  `**Total execution time:** ${stats.totalDuration.toFixed(2)}ms`,
21129
21225
  `**Number of metric types:** ${Object.keys(stats.metricStats).length}`,
@@ -21132,11 +21228,6 @@ class PerformanceStorage {
21132
21228
  "",
21133
21229
  percentages.join("\n"),
21134
21230
  "",
21135
- "## Detailed Metrics",
21136
- "",
21137
- summaryTable,
21138
- "",
21139
- "**Note:** All durations are in milliseconds. P95/P99 represent 95th and 99th percentile response times. Wait times show the interval between consecutive events of the same type."
21140
21231
  ].join("\n");
21141
21232
  }
21142
21233
  /**
@@ -21476,7 +21567,7 @@ let ReportStorage$6 = class ReportStorage {
21476
21567
  * @param columns - Column configuration for formatting the strategy comparison table
21477
21568
  * @returns Markdown formatted comparison table
21478
21569
  */
21479
- async getComparisonTable(topN = 10, columns = COLUMN_CONFIG.walker_strategy_columns) {
21570
+ async getComparisonTable(topN = GLOBAL_CONFIG.CC_WALKER_MARKDOWN_TOP_N, columns = COLUMN_CONFIG.walker_strategy_columns) {
21480
21571
  if (this._strategyResults.length === 0) {
21481
21572
  return "No strategy results available.";
21482
21573
  }
@@ -21578,7 +21669,7 @@ let ReportStorage$6 = class ReportStorage {
21578
21669
  "",
21579
21670
  "## Top Strategies Comparison",
21580
21671
  "",
21581
- await this.getComparisonTable(10, strategyColumns),
21672
+ await this.getComparisonTable(GLOBAL_CONFIG.CC_WALKER_MARKDOWN_TOP_N, strategyColumns),
21582
21673
  "",
21583
21674
  "## All Signals (PNL Table)",
21584
21675
  "",
@@ -21876,8 +21967,6 @@ function isUnsafe(value) {
21876
21967
  }
21877
21968
  return false;
21878
21969
  }
21879
- /** Maximum number of signals to store per symbol in heatmap reports */
21880
- const MAX_EVENTS$6 = 250;
21881
21970
  /**
21882
21971
  * Storage class for accumulating closed signals per strategy and generating heatmap.
21883
21972
  * Maintains symbol-level statistics and provides portfolio-wide metrics.
@@ -21902,8 +21991,8 @@ class HeatmapStorage {
21902
21991
  }
21903
21992
  const signals = this.symbolData.get(symbol);
21904
21993
  signals.unshift(data);
21905
- // Trim queue if exceeded MAX_EVENTS per symbol
21906
- if (signals.length > MAX_EVENTS$6) {
21994
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_HEATMAP_MARKDOWN_ROWS per symbol
21995
+ if (signals.length > GLOBAL_CONFIG.CC_MAX_HEATMAP_MARKDOWN_ROWS) {
21907
21996
  signals.pop();
21908
21997
  }
21909
21998
  }
@@ -23675,8 +23764,6 @@ const CREATE_FILE_NAME_FN$5 = (symbol, strategyName, exchangeName, frameName, ti
23675
23764
  parts.push("live");
23676
23765
  return `${parts.join("_")}-${timestamp}.md`;
23677
23766
  };
23678
- /** Maximum number of events to store in partial reports */
23679
- const MAX_EVENTS$5 = 250;
23680
23767
  /**
23681
23768
  * Storage class for accumulating partial profit/loss events per symbol-strategy pair.
23682
23769
  * Maintains a chronological list of profit and loss level events.
@@ -23723,8 +23810,8 @@ let ReportStorage$5 = class ReportStorage {
23723
23810
  scheduledAt: data.scheduledAt,
23724
23811
  backtest,
23725
23812
  });
23726
- // Trim queue if exceeded MAX_EVENTS
23727
- if (this._eventList.length > MAX_EVENTS$5) {
23813
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_PARTIAL_MARKDOWN_ROWS
23814
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_PARTIAL_MARKDOWN_ROWS) {
23728
23815
  this._eventList.pop();
23729
23816
  }
23730
23817
  }
@@ -23761,8 +23848,8 @@ let ReportStorage$5 = class ReportStorage {
23761
23848
  scheduledAt: data.scheduledAt,
23762
23849
  backtest,
23763
23850
  });
23764
- // Trim queue if exceeded MAX_EVENTS
23765
- if (this._eventList.length > MAX_EVENTS$5) {
23851
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_PARTIAL_MARKDOWN_ROWS
23852
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_PARTIAL_MARKDOWN_ROWS) {
23766
23853
  this._eventList.pop();
23767
23854
  }
23768
23855
  }
@@ -24818,8 +24905,6 @@ const CREATE_FILE_NAME_FN$4 = (symbol, strategyName, exchangeName, frameName, ti
24818
24905
  parts.push("live");
24819
24906
  return `${parts.join("_")}-${timestamp}.md`;
24820
24907
  };
24821
- /** Maximum number of events to store in breakeven reports */
24822
- const MAX_EVENTS$4 = 250;
24823
24908
  /**
24824
24909
  * Storage class for accumulating breakeven events per symbol-strategy pair.
24825
24910
  * Maintains a chronological list of breakeven events.
@@ -24864,8 +24949,8 @@ let ReportStorage$4 = class ReportStorage {
24864
24949
  scheduledAt: data.scheduledAt,
24865
24950
  backtest,
24866
24951
  });
24867
- // Trim queue if exceeded MAX_EVENTS
24868
- if (this._eventList.length > MAX_EVENTS$4) {
24952
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_BREAKEVEN_MARKDOWN_ROWS
24953
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_BREAKEVEN_MARKDOWN_ROWS) {
24869
24954
  this._eventList.pop();
24870
24955
  }
24871
24956
  }
@@ -25494,8 +25579,6 @@ const CREATE_FILE_NAME_FN$3 = (symbol, strategyName, exchangeName, frameName, ti
25494
25579
  parts.push("live");
25495
25580
  return `${parts.join("_")}-${timestamp}.md`;
25496
25581
  };
25497
- /** Maximum number of events to store in risk reports */
25498
- const MAX_EVENTS$3 = 250;
25499
25582
  /**
25500
25583
  * Storage class for accumulating risk rejection events per symbol-strategy pair.
25501
25584
  * Maintains a chronological list of rejected signals due to risk limits.
@@ -25516,8 +25599,8 @@ let ReportStorage$3 = class ReportStorage {
25516
25599
  */
25517
25600
  addRejectionEvent(event) {
25518
25601
  this._eventList.unshift(event);
25519
- // Trim queue if exceeded MAX_EVENTS
25520
- if (this._eventList.length > MAX_EVENTS$3) {
25602
+ // Trim queue if exceeded GLOBAL_CONFIG.CC_MAX_RISK_MARKDOWN_ROWS
25603
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_RISK_MARKDOWN_ROWS) {
25521
25604
  this._eventList.pop();
25522
25605
  }
25523
25606
  }
@@ -28610,16 +28693,10 @@ const CREATE_FILE_NAME_FN$2 = (symbol, strategyName, exchangeName, frameName, ti
28610
28693
  parts.push("live");
28611
28694
  return `${parts.join("_")}-${timestamp}.md`;
28612
28695
  };
28613
- /**
28614
- * Maximum number of events to store per symbol-strategy pair.
28615
- * Older events are discarded when this limit is exceeded.
28616
- * @internal
28617
- */
28618
- const MAX_EVENTS$2 = 250;
28619
28696
  /**
28620
28697
  * In-memory storage for accumulating strategy events per symbol-strategy pair.
28621
28698
  *
28622
- * Maintains a rolling window of the most recent events (up to MAX_EVENTS),
28699
+ * Maintains a rolling window of the most recent events (up to GLOBAL_CONFIG.CC_MAX_STRATEGY_MARKDOWN_ROWS),
28623
28700
  * with newer events added to the front of the list. Provides methods to:
28624
28701
  * - Add new events (FIFO queue with max size)
28625
28702
  * - Retrieve aggregated statistics
@@ -28648,13 +28725,13 @@ let ReportStorage$2 = class ReportStorage {
28648
28725
  * Adds a new event to the storage.
28649
28726
  *
28650
28727
  * Events are added to the front of the list (most recent first).
28651
- * If the list exceeds MAX_EVENTS, the oldest event is removed.
28728
+ * If the list exceeds GLOBAL_CONFIG.CC_MAX_STRATEGY_MARKDOWN_ROWS, the oldest event is removed.
28652
28729
  *
28653
28730
  * @param event - The strategy event to store
28654
28731
  */
28655
28732
  addEvent(event) {
28656
28733
  this._eventList.unshift(event);
28657
- if (this._eventList.length > MAX_EVENTS$2) {
28734
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_STRATEGY_MARKDOWN_ROWS) {
28658
28735
  this._eventList.pop();
28659
28736
  }
28660
28737
  }
@@ -29525,8 +29602,6 @@ const CREATE_FILE_NAME_FN$1 = (symbol, strategyName, exchangeName, frameName, ti
29525
29602
  parts.push("live");
29526
29603
  return `${parts.join("_")}-${timestamp}.md`;
29527
29604
  };
29528
- /** Maximum number of events to store in sync reports */
29529
- const MAX_EVENTS$1 = 250;
29530
29605
  /**
29531
29606
  * Storage class for accumulating signal sync events per symbol-strategy-exchange-frame-backtest combination.
29532
29607
  * Maintains a chronological list of signal-open and signal-close events.
@@ -29541,7 +29616,7 @@ let ReportStorage$1 = class ReportStorage {
29541
29616
  }
29542
29617
  addEvent(event) {
29543
29618
  this._eventList.unshift(event);
29544
- if (this._eventList.length > MAX_EVENTS$1) {
29619
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_SYNC_MARKDOWN_ROWS) {
29545
29620
  this._eventList.pop();
29546
29621
  }
29547
29622
  }
@@ -29744,8 +29819,6 @@ const CREATE_FILE_NAME_FN = (symbol, strategyName, exchangeName, frameName, time
29744
29819
  parts.push("live");
29745
29820
  return `${parts.join("_")}-${timestamp}.md`;
29746
29821
  };
29747
- /** Maximum number of events to store per combination */
29748
- const MAX_EVENTS = 250;
29749
29822
  /**
29750
29823
  * Accumulates highest profit events per symbol-strategy-exchange-frame combination.
29751
29824
  */
@@ -29767,13 +29840,14 @@ class ReportStorage {
29767
29840
  strategyName: data.strategyName,
29768
29841
  signalId: data.id,
29769
29842
  position: data.position,
29843
+ pnl: data.pnl,
29770
29844
  currentPrice,
29771
29845
  priceOpen: data.priceOpen,
29772
29846
  priceTakeProfit: data.priceTakeProfit,
29773
29847
  priceStopLoss: data.priceStopLoss,
29774
29848
  backtest,
29775
29849
  });
29776
- if (this._eventList.length > MAX_EVENTS) {
29850
+ if (this._eventList.length > GLOBAL_CONFIG.CC_MAX_HIGHEST_PROFIT_MARKDOWN_ROWS) {
29777
29851
  this._eventList.pop();
29778
29852
  }
29779
29853
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "5.6.0",
3
+ "version": "5.6.2",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -5414,72 +5414,6 @@ declare function stopStrategy(symbol: string): Promise<void>;
5414
5414
  */
5415
5415
  declare function shutdown(): void;
5416
5416
 
5417
- /**
5418
- * Unified breakeven event data for report generation.
5419
- * Contains all information about when signals reached breakeven.
5420
- */
5421
- interface BreakevenEvent {
5422
- /** Event timestamp in milliseconds */
5423
- timestamp: number;
5424
- /** Trading pair symbol */
5425
- symbol: string;
5426
- /** Strategy name */
5427
- strategyName: StrategyName;
5428
- /** Signal ID */
5429
- signalId: string;
5430
- /** Position type */
5431
- position: string;
5432
- /** Current market price when breakeven was reached */
5433
- currentPrice: number;
5434
- /** Entry price (breakeven level) */
5435
- priceOpen: number;
5436
- /** Take profit target price */
5437
- priceTakeProfit?: number;
5438
- /** Stop loss exit price */
5439
- priceStopLoss?: number;
5440
- /** Original take profit price set at signal creation */
5441
- originalPriceTakeProfit?: number;
5442
- /** Original stop loss price set at signal creation */
5443
- originalPriceStopLoss?: number;
5444
- /** Total number of DCA entries (present when averageBuy was applied) */
5445
- totalEntries?: number;
5446
- /** Total number of partial closes executed (_partial.length) */
5447
- totalPartials?: number;
5448
- /** Original entry price before DCA averaging (present when averageBuy was applied) */
5449
- originalPriceOpen?: number;
5450
- /** Total executed percentage from partial closes */
5451
- partialExecuted?: number;
5452
- /** Unrealized PNL at the moment breakeven was reached */
5453
- pnl?: IStrategyPnL;
5454
- /** Human-readable description of signal reason */
5455
- note?: string;
5456
- /** Timestamp when position became active (ms) */
5457
- pendingAt?: number;
5458
- /** Timestamp when signal was created/scheduled (ms) */
5459
- scheduledAt?: number;
5460
- /** True if backtest mode, false if live mode */
5461
- backtest: boolean;
5462
- }
5463
- /**
5464
- * Statistical data calculated from breakeven events.
5465
- *
5466
- * Provides metrics for breakeven milestone tracking.
5467
- *
5468
- * @example
5469
- * ```typescript
5470
- * const stats = await Breakeven.getData("BTCUSDT", "my-strategy");
5471
- *
5472
- * console.log(`Total breakeven events: ${stats.totalEvents}`);
5473
- * console.log(`Average threshold: ${stats.averageThreshold}%`);
5474
- * ```
5475
- */
5476
- interface BreakevenStatisticsModel {
5477
- /** Array of all breakeven events with full details */
5478
- eventList: BreakevenEvent[];
5479
- /** Total number of breakeven events */
5480
- totalEvents: number;
5481
- }
5482
-
5483
5417
  declare const GLOBAL_CONFIG: {
5484
5418
  /**
5485
5419
  * Time to wait for scheduled signal to activate (in minutes)
@@ -5631,6 +5565,91 @@ declare const GLOBAL_CONFIG: {
5631
5565
  * Binance requirement
5632
5566
  */
5633
5567
  CC_AGGREGATED_TRADES_MAX_MINUTES: number;
5568
+ /**
5569
+ * Maximum number of events to keep in backtest markdown report storage.
5570
+ * Older events are removed (FIFO) when this limit is exceeded.
5571
+ *
5572
+ * Default: 250 events
5573
+ */
5574
+ CC_MAX_BACKTEST_MARKDOWN_ROWS: number;
5575
+ /**
5576
+ * Maximum number of events to keep in breakeven markdown report storage.
5577
+ * Older events are removed (FIFO) when this limit is exceeded.
5578
+ *
5579
+ * Default: 250 events
5580
+ */
5581
+ CC_MAX_BREAKEVEN_MARKDOWN_ROWS: number;
5582
+ /**
5583
+ * Maximum number of events to keep in heatmap markdown report storage.
5584
+ * Older events are removed (FIFO) when this limit is exceeded.
5585
+ *
5586
+ * Default: 250 events
5587
+ */
5588
+ CC_MAX_HEATMAP_MARKDOWN_ROWS: number;
5589
+ /**
5590
+ * Maximum number of events to keep in highest profit markdown report storage.
5591
+ * Older events are removed (FIFO) when this limit is exceeded.
5592
+ *
5593
+ * Default: 250 events
5594
+ */
5595
+ CC_MAX_HIGHEST_PROFIT_MARKDOWN_ROWS: number;
5596
+ /**
5597
+ * Maximum number of events to keep in live markdown report storage.
5598
+ * Older events are removed (FIFO) when this limit is exceeded.
5599
+ *
5600
+ * Default: 250 events
5601
+ */
5602
+ CC_MAX_LIVE_MARKDOWN_ROWS: number;
5603
+ /**
5604
+ * Maximum number of events to keep in partial markdown report storage.
5605
+ * Older events are removed (FIFO) when this limit is exceeded.
5606
+ *
5607
+ * Default: 250 events
5608
+ */
5609
+ CC_MAX_PARTIAL_MARKDOWN_ROWS: number;
5610
+ /**
5611
+ * Maximum number of events to keep in risk markdown report storage.
5612
+ * Older events are removed (FIFO) when this limit is exceeded.
5613
+ *
5614
+ * Default: 250 events
5615
+ */
5616
+ CC_MAX_RISK_MARKDOWN_ROWS: number;
5617
+ /**
5618
+ * Maximum number of events to keep in schedule markdown report storage.
5619
+ * Older events are removed (FIFO) when this limit is exceeded.
5620
+ *
5621
+ * Default: 250 events
5622
+ */
5623
+ CC_MAX_SCHEDULE_MARKDOWN_ROWS: number;
5624
+ /**
5625
+ * Maximum number of events to keep in strategy markdown report storage.
5626
+ * Older events are removed (FIFO) when this limit is exceeded.
5627
+ *
5628
+ * Default: 250 events
5629
+ */
5630
+ CC_MAX_STRATEGY_MARKDOWN_ROWS: number;
5631
+ /**
5632
+ * Maximum number of events to keep in sync markdown report storage.
5633
+ * Older events are removed (FIFO) when this limit is exceeded.
5634
+ *
5635
+ * Default: 250 events
5636
+ */
5637
+ CC_MAX_SYNC_MARKDOWN_ROWS: number;
5638
+ /**
5639
+ * Number of top strategies to include in the walker comparison table.
5640
+ *
5641
+ * Default: 10 strategies
5642
+ */
5643
+ CC_WALKER_MARKDOWN_TOP_N: number;
5644
+ /**
5645
+ * Maximum number of performance metric events to keep in storage.
5646
+ * Older events are removed when this limit is exceeded.
5647
+ * Higher than other report event limits because performance metrics are lightweight
5648
+ * and benefit from larger sample sizes for accurate statistical analysis.
5649
+ *
5650
+ * Default: 10000 events
5651
+ */
5652
+ CC_MAX_PERFORMANCE_MARKDOWN_ROWS: number;
5634
5653
  /**
5635
5654
  * Maximum number of notifications to keep in storage.
5636
5655
  * Older notifications are removed when this limit is exceeded.
@@ -5793,6 +5812,18 @@ declare function getConfig(): {
5793
5812
  CC_ORDER_BOOK_TIME_OFFSET_MINUTES: number;
5794
5813
  CC_ORDER_BOOK_MAX_DEPTH_LEVELS: number;
5795
5814
  CC_AGGREGATED_TRADES_MAX_MINUTES: number;
5815
+ CC_MAX_BACKTEST_MARKDOWN_ROWS: number;
5816
+ CC_MAX_BREAKEVEN_MARKDOWN_ROWS: number;
5817
+ CC_MAX_HEATMAP_MARKDOWN_ROWS: number;
5818
+ CC_MAX_HIGHEST_PROFIT_MARKDOWN_ROWS: number;
5819
+ CC_MAX_LIVE_MARKDOWN_ROWS: number;
5820
+ CC_MAX_PARTIAL_MARKDOWN_ROWS: number;
5821
+ CC_MAX_RISK_MARKDOWN_ROWS: number;
5822
+ CC_MAX_SCHEDULE_MARKDOWN_ROWS: number;
5823
+ CC_MAX_STRATEGY_MARKDOWN_ROWS: number;
5824
+ CC_MAX_SYNC_MARKDOWN_ROWS: number;
5825
+ CC_WALKER_MARKDOWN_TOP_N: number;
5826
+ CC_MAX_PERFORMANCE_MARKDOWN_ROWS: number;
5796
5827
  CC_MAX_NOTIFICATIONS: number;
5797
5828
  CC_MAX_SIGNALS: number;
5798
5829
  CC_MAX_LOG_LINES: number;
@@ -5835,6 +5866,18 @@ declare function getDefaultConfig(): Readonly<{
5835
5866
  CC_ORDER_BOOK_TIME_OFFSET_MINUTES: number;
5836
5867
  CC_ORDER_BOOK_MAX_DEPTH_LEVELS: number;
5837
5868
  CC_AGGREGATED_TRADES_MAX_MINUTES: number;
5869
+ CC_MAX_BACKTEST_MARKDOWN_ROWS: number;
5870
+ CC_MAX_BREAKEVEN_MARKDOWN_ROWS: number;
5871
+ CC_MAX_HEATMAP_MARKDOWN_ROWS: number;
5872
+ CC_MAX_HIGHEST_PROFIT_MARKDOWN_ROWS: number;
5873
+ CC_MAX_LIVE_MARKDOWN_ROWS: number;
5874
+ CC_MAX_PARTIAL_MARKDOWN_ROWS: number;
5875
+ CC_MAX_RISK_MARKDOWN_ROWS: number;
5876
+ CC_MAX_SCHEDULE_MARKDOWN_ROWS: number;
5877
+ CC_MAX_STRATEGY_MARKDOWN_ROWS: number;
5878
+ CC_MAX_SYNC_MARKDOWN_ROWS: number;
5879
+ CC_WALKER_MARKDOWN_TOP_N: number;
5880
+ CC_MAX_PERFORMANCE_MARKDOWN_ROWS: number;
5838
5881
  CC_MAX_NOTIFICATIONS: number;
5839
5882
  CC_MAX_SIGNALS: number;
5840
5883
  CC_MAX_LOG_LINES: number;
@@ -10006,6 +10049,8 @@ interface HighestProfitEvent {
10006
10049
  signalId: string;
10007
10050
  /** Position direction */
10008
10051
  position: IPublicSignalRow["position"];
10052
+ /** Unrealized PNL at the time the record was set */
10053
+ pnl: IStrategyPnL;
10009
10054
  /** Record price reached in the profit direction */
10010
10055
  currentPrice: number;
10011
10056
  /** Effective entry price at the time of the update */
@@ -10079,6 +10124,72 @@ interface RiskStatisticsModel {
10079
10124
  byStrategy: Record<string, number>;
10080
10125
  }
10081
10126
 
10127
+ /**
10128
+ * Unified breakeven event data for report generation.
10129
+ * Contains all information about when signals reached breakeven.
10130
+ */
10131
+ interface BreakevenEvent {
10132
+ /** Event timestamp in milliseconds */
10133
+ timestamp: number;
10134
+ /** Trading pair symbol */
10135
+ symbol: string;
10136
+ /** Strategy name */
10137
+ strategyName: StrategyName;
10138
+ /** Signal ID */
10139
+ signalId: string;
10140
+ /** Position type */
10141
+ position: string;
10142
+ /** Current market price when breakeven was reached */
10143
+ currentPrice: number;
10144
+ /** Entry price (breakeven level) */
10145
+ priceOpen: number;
10146
+ /** Take profit target price */
10147
+ priceTakeProfit?: number;
10148
+ /** Stop loss exit price */
10149
+ priceStopLoss?: number;
10150
+ /** Original take profit price set at signal creation */
10151
+ originalPriceTakeProfit?: number;
10152
+ /** Original stop loss price set at signal creation */
10153
+ originalPriceStopLoss?: number;
10154
+ /** Total number of DCA entries (present when averageBuy was applied) */
10155
+ totalEntries?: number;
10156
+ /** Total number of partial closes executed (_partial.length) */
10157
+ totalPartials?: number;
10158
+ /** Original entry price before DCA averaging (present when averageBuy was applied) */
10159
+ originalPriceOpen?: number;
10160
+ /** Total executed percentage from partial closes */
10161
+ partialExecuted?: number;
10162
+ /** Unrealized PNL at the moment breakeven was reached */
10163
+ pnl?: IStrategyPnL;
10164
+ /** Human-readable description of signal reason */
10165
+ note?: string;
10166
+ /** Timestamp when position became active (ms) */
10167
+ pendingAt?: number;
10168
+ /** Timestamp when signal was created/scheduled (ms) */
10169
+ scheduledAt?: number;
10170
+ /** True if backtest mode, false if live mode */
10171
+ backtest: boolean;
10172
+ }
10173
+ /**
10174
+ * Statistical data calculated from breakeven events.
10175
+ *
10176
+ * Provides metrics for breakeven milestone tracking.
10177
+ *
10178
+ * @example
10179
+ * ```typescript
10180
+ * const stats = await Breakeven.getData("BTCUSDT", "my-strategy");
10181
+ *
10182
+ * console.log(`Total breakeven events: ${stats.totalEvents}`);
10183
+ * console.log(`Average threshold: ${stats.averageThreshold}%`);
10184
+ * ```
10185
+ */
10186
+ interface BreakevenStatisticsModel {
10187
+ /** Array of all breakeven events with full details */
10188
+ eventList: BreakevenEvent[];
10189
+ /** Total number of breakeven events */
10190
+ totalEvents: number;
10191
+ }
10192
+
10082
10193
  /**
10083
10194
  * Action types for strategy events.
10084
10195
  * Represents all possible strategy management actions.
@@ -26828,4 +26939,4 @@ declare const getTotalClosed: (signal: Signal) => {
26828
26939
  remainingCostBasis: number;
26829
26940
  };
26830
26941
 
26831
- 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, 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, 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 IExchangeSchema, type IFrameSchema, type IHeatmapRow, type ILog, type ILogEntry, type ILogger, type IMarkdownDumpOptions, 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, 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, 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 TLogCtor, type TMarkdownBase, 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, dumpMessages, 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, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, 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, roundTicks, set, setColumns, setConfig, setLogger, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, waitForCandle, warmCandles };
26942
+ 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, 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 IExchangeSchema, type IFrameSchema, type IHeatmapRow, type ILog, type ILogEntry, type ILogger, type IMarkdownDumpOptions, 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, 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, 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 TLogCtor, type TMarkdownBase, 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, dumpMessages, 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, hasTradeContext, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, 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, roundTicks, set, setColumns, setConfig, setLogger, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, waitForCandle, warmCandles };