@backtest-kit/cli 5.2.0 โ†’ 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.cjs CHANGED
@@ -1540,6 +1540,26 @@ class TelegramLogicService {
1540
1540
  markdown,
1541
1541
  });
1542
1542
  });
1543
+ this.notifyCancelScheduled = async (event) => {
1544
+ this.loggerService.log("telegramLogicService notifyCancelScheduled", {
1545
+ event,
1546
+ });
1547
+ const markdown = await this.telegramTemplateService.getCancelScheduledMarkdown(event);
1548
+ await this.telegramWebService.publishNotify({
1549
+ symbol: event.symbol,
1550
+ markdown,
1551
+ });
1552
+ };
1553
+ this.notifyClosePending = async (event) => {
1554
+ this.loggerService.log("telegramLogicService notifyClosePending", {
1555
+ event,
1556
+ });
1557
+ const markdown = await this.telegramTemplateService.getClosePendingMarkdown(event);
1558
+ await this.telegramWebService.publishNotify({
1559
+ symbol: event.symbol,
1560
+ markdown,
1561
+ });
1562
+ };
1543
1563
  this.connect = functoolsKit.singleshot(() => {
1544
1564
  this.loggerService.log("telegramLogicService connect");
1545
1565
  const unRisk = BacktestKit.listenRisk(async (event) => {
@@ -1588,6 +1608,14 @@ class TelegramLogicService {
1588
1608
  await this.notifyAverageBuy(event);
1589
1609
  return;
1590
1610
  }
1611
+ if (event.action === "cancel-scheduled") {
1612
+ await this.notifyCancelScheduled(event);
1613
+ return;
1614
+ }
1615
+ if (event.action === "close-pending") {
1616
+ await this.notifyClosePending(event);
1617
+ return;
1618
+ }
1591
1619
  });
1592
1620
  const unSync = BacktestKit.listenSync(async (event) => {
1593
1621
  if (event.action === "signal-open") {
@@ -1707,6 +1735,18 @@ class TelegramTemplateService {
1707
1735
  });
1708
1736
  return await RENDER_TEMPLATE_FN("signal-close.mustache", event, this);
1709
1737
  };
1738
+ this.getCancelScheduledMarkdown = async (event) => {
1739
+ this.loggerService.log("telegramTemplateService getCancelScheduledMarkdown", {
1740
+ event,
1741
+ });
1742
+ return await RENDER_TEMPLATE_FN("cancel-scheduled.mustache", event, this);
1743
+ };
1744
+ this.getClosePendingMarkdown = async (event) => {
1745
+ this.loggerService.log("telegramTemplateService getClosePendingMarkdown", {
1746
+ event,
1747
+ });
1748
+ return await RENDER_TEMPLATE_FN("close-pending.mustache", event, this);
1749
+ };
1710
1750
  }
1711
1751
  }
1712
1752
 
package/build/index.mjs CHANGED
@@ -1514,6 +1514,26 @@ class TelegramLogicService {
1514
1514
  markdown,
1515
1515
  });
1516
1516
  });
1517
+ this.notifyCancelScheduled = async (event) => {
1518
+ this.loggerService.log("telegramLogicService notifyCancelScheduled", {
1519
+ event,
1520
+ });
1521
+ const markdown = await this.telegramTemplateService.getCancelScheduledMarkdown(event);
1522
+ await this.telegramWebService.publishNotify({
1523
+ symbol: event.symbol,
1524
+ markdown,
1525
+ });
1526
+ };
1527
+ this.notifyClosePending = async (event) => {
1528
+ this.loggerService.log("telegramLogicService notifyClosePending", {
1529
+ event,
1530
+ });
1531
+ const markdown = await this.telegramTemplateService.getClosePendingMarkdown(event);
1532
+ await this.telegramWebService.publishNotify({
1533
+ symbol: event.symbol,
1534
+ markdown,
1535
+ });
1536
+ };
1517
1537
  this.connect = singleshot(() => {
1518
1538
  this.loggerService.log("telegramLogicService connect");
1519
1539
  const unRisk = listenRisk(async (event) => {
@@ -1562,6 +1582,14 @@ class TelegramLogicService {
1562
1582
  await this.notifyAverageBuy(event);
1563
1583
  return;
1564
1584
  }
1585
+ if (event.action === "cancel-scheduled") {
1586
+ await this.notifyCancelScheduled(event);
1587
+ return;
1588
+ }
1589
+ if (event.action === "close-pending") {
1590
+ await this.notifyClosePending(event);
1591
+ return;
1592
+ }
1565
1593
  });
1566
1594
  const unSync = listenSync(async (event) => {
1567
1595
  if (event.action === "signal-open") {
@@ -1681,6 +1709,18 @@ class TelegramTemplateService {
1681
1709
  });
1682
1710
  return await RENDER_TEMPLATE_FN("signal-close.mustache", event, this);
1683
1711
  };
1712
+ this.getCancelScheduledMarkdown = async (event) => {
1713
+ this.loggerService.log("telegramTemplateService getCancelScheduledMarkdown", {
1714
+ event,
1715
+ });
1716
+ return await RENDER_TEMPLATE_FN("cancel-scheduled.mustache", event, this);
1717
+ };
1718
+ this.getClosePendingMarkdown = async (event) => {
1719
+ this.loggerService.log("telegramTemplateService getClosePendingMarkdown", {
1720
+ event,
1721
+ });
1722
+ return await RENDER_TEMPLATE_FN("close-pending.mustache", event, this);
1723
+ };
1684
1724
  }
1685
1725
  }
1686
1726
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backtest-kit/cli",
3
- "version": "5.2.0",
3
+ "version": "5.4.0",
4
4
  "description": "Zero-boilerplate CLI runner for backtest-kit strategies. Run backtests, paper trading, and live bots with candle cache warming, web dashboard, and Telegram notifications โ€” no setup code required.",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
@@ -60,11 +60,11 @@
60
60
  "devDependencies": {
61
61
  "@babel/plugin-transform-modules-umd": "7.27.1",
62
62
  "@babel/standalone": "7.29.1",
63
- "@backtest-kit/ui": "5.2.0",
64
- "@backtest-kit/graph": "5.2.0",
65
- "@backtest-kit/ollama": "5.2.0",
66
- "@backtest-kit/pinets": "5.2.0",
67
- "@backtest-kit/signals": "5.2.0",
63
+ "@backtest-kit/ui": "5.4.0",
64
+ "@backtest-kit/graph": "5.4.0",
65
+ "@backtest-kit/ollama": "5.4.0",
66
+ "@backtest-kit/pinets": "5.4.0",
67
+ "@backtest-kit/signals": "5.4.0",
68
68
  "@rollup/plugin-replace": "6.0.3",
69
69
  "@rollup/plugin-typescript": "11.1.6",
70
70
  "@types/image-size": "0.7.0",
@@ -72,7 +72,7 @@
72
72
  "@types/mustache": "4.2.6",
73
73
  "@types/node": "22.9.0",
74
74
  "@types/stack-trace": "0.0.33",
75
- "backtest-kit": "5.2.0",
75
+ "backtest-kit": "5.4.0",
76
76
  "glob": "11.0.1",
77
77
  "markdown-it": "14.1.1",
78
78
  "rimraf": "6.0.1",
@@ -87,12 +87,12 @@
87
87
  "peerDependencies": {
88
88
  "@babel/plugin-transform-modules-umd": "^7.27.1",
89
89
  "@babel/standalone": "^7.29.1",
90
- "@backtest-kit/ui": "^5.2.0",
91
- "@backtest-kit/graph": "^5.2.0",
92
- "@backtest-kit/ollama": "^5.2.0",
93
- "@backtest-kit/pinets": "^5.2.0",
94
- "@backtest-kit/signals": "^5.2.0",
95
- "backtest-kit": "^5.2.0",
90
+ "@backtest-kit/ui": "^5.4.0",
91
+ "@backtest-kit/graph": "^5.4.0",
92
+ "@backtest-kit/ollama": "^5.4.0",
93
+ "@backtest-kit/pinets": "^5.4.0",
94
+ "@backtest-kit/signals": "^5.4.0",
95
+ "backtest-kit": "^5.4.0",
96
96
  "markdown-it": "^14.1.1",
97
97
  "typescript": "^5.0.0"
98
98
  },
@@ -0,0 +1,15 @@
1
+ **๐Ÿšซ Cancel Scheduled**
2
+
3
+ **Symbol:** `{{symbol}}`
4
+
5
+ **Orig Entry:** `{{originalPriceOpen}}`
6
+ **DCA Entries:** `{{totalEntries}}`
7
+ **Partials Done:** `{{totalPartials}}`
8
+ {{#cancelId}}**Cancel ID:** `{{cancelId}}`
9
+ {{/cancelId}}**PnL:** {{pnl.pnlPercentage}}% ({{pnl.pnlCost}} / {{pnl.pnlEntries}})
10
+ **Signal ID:** `{{signalId}}`
11
+ **Time:** `{{timestamp}}`
12
+
13
+ {{#backtest}}
14
+ _๐Ÿงช Backtest_
15
+ {{/backtest}}
@@ -0,0 +1,15 @@
1
+ **๐Ÿ”’ Close Pending**
2
+
3
+ **Symbol:** `{{symbol}}`
4
+
5
+ **Orig Entry:** `{{originalPriceOpen}}`
6
+ **DCA Entries:** `{{totalEntries}}`
7
+ **Partials Done:** `{{totalPartials}}`
8
+ {{#closeId}}**Close ID:** `{{closeId}}`
9
+ {{/closeId}}**PnL:** {{pnl.pnlPercentage}}% ({{pnl.pnlCost}} / {{pnl.pnlEntries}})
10
+ **Signal ID:** `{{signalId}}`
11
+ **Time:** `{{timestamp}}`
12
+
13
+ {{#backtest}}
14
+ _๐Ÿงช Backtest_
15
+ {{/backtest}}
package/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as functools_kit from 'functools-kit';
2
2
  import * as BacktestKit from 'backtest-kit';
3
- import { CandleInterval, TrailingTakeCommit, TrailingStopCommit, BreakevenCommit, PartialProfitCommit, PartialLossCommit, IStrategyTickResultScheduled, IStrategyTickResultCancelled, IStrategyTickResultOpened, IStrategyTickResultClosed, RiskContract, AverageBuyCommit, SignalOpenContract, SignalCloseContract } from 'backtest-kit';
3
+ import { CandleInterval, TrailingTakeCommit, TrailingStopCommit, BreakevenCommit, PartialProfitCommit, PartialLossCommit, IStrategyTickResultScheduled, IStrategyTickResultCancelled, IStrategyTickResultOpened, IStrategyTickResultClosed, RiskContract, AverageBuyCommit, SignalOpenContract, SignalCloseContract, CancelScheduledCommit, ClosePendingCommit } from 'backtest-kit';
4
4
  import * as BacktestKitUi from '@backtest-kit/ui';
5
5
  import * as BacktestKitGraph from '@backtest-kit/graph';
6
6
  import * as BacktestKitOllama from '@backtest-kit/ollama';
@@ -201,6 +201,8 @@ declare class TelegramLogicService {
201
201
  private notifyAverageBuy;
202
202
  private notifySignalOpen;
203
203
  private notifySignalClose;
204
+ private notifyCancelScheduled;
205
+ private notifyClosePending;
204
206
  connect: (() => () => void) & functools_kit.ISingleshotClearable;
205
207
  }
206
208
 
@@ -220,6 +222,8 @@ declare class TelegramTemplateService {
220
222
  getAverageBuyMarkdown: (event: AverageBuyCommit) => Promise<string>;
221
223
  getSignalOpenMarkdown: (event: SignalOpenContract) => Promise<string>;
222
224
  getSignalCloseMarkdown: (event: SignalCloseContract) => Promise<string>;
225
+ getCancelScheduledMarkdown: (event: CancelScheduledCommit) => Promise<string>;
226
+ getClosePendingMarkdown: (event: ClosePendingCommit) => Promise<string>;
223
227
  }
224
228
 
225
229
  declare class ModuleConnectionService {