@backtest-kit/cli 19.4.0 → 19.6.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
@@ -276,6 +276,18 @@ const timeNow = () => {
276
276
  class ErrorService {
277
277
  constructor() {
278
278
  this.handleGlobalError = async (error) => {
279
+ if (BacktestKit.OrderDeletedError.isOrderDeletedError(error)) {
280
+ return;
281
+ }
282
+ if (BacktestKit.OrderRejectedError.isOrderRejectedError(error)) {
283
+ return;
284
+ }
285
+ if (BacktestKit.OrderTransientError.isOrderTransientError(error)) {
286
+ return;
287
+ }
288
+ if (BacktestKit.GeneralExpectedError.isGeneralExpectedError(error)) {
289
+ return;
290
+ }
279
291
  const today = new Date();
280
292
  const dd = String(today.getDate()).padStart(2, "0");
281
293
  const mm = String(today.getMonth() + 1).padStart(2, "0");
@@ -290,10 +302,34 @@ class ErrorService {
290
302
  };
291
303
  this._listenForError = () => {
292
304
  process.on("uncaughtException", (err) => {
305
+ if (BacktestKit.OrderDeletedError.isOrderDeletedError(err)) {
306
+ return;
307
+ }
308
+ if (BacktestKit.OrderRejectedError.isOrderRejectedError(err)) {
309
+ return;
310
+ }
311
+ if (BacktestKit.OrderTransientError.isOrderTransientError(err)) {
312
+ return;
313
+ }
314
+ if (BacktestKit.GeneralExpectedError.isGeneralExpectedError(err)) {
315
+ return;
316
+ }
293
317
  console.log(err);
294
318
  this.handleGlobalError(err);
295
319
  });
296
320
  process.on("unhandledRejection", (err) => {
321
+ if (BacktestKit.OrderDeletedError.isOrderDeletedError(err)) {
322
+ return;
323
+ }
324
+ if (BacktestKit.OrderRejectedError.isOrderRejectedError(err)) {
325
+ return;
326
+ }
327
+ if (BacktestKit.OrderTransientError.isOrderTransientError(err)) {
328
+ return;
329
+ }
330
+ if (BacktestKit.GeneralExpectedError.isGeneralExpectedError(err)) {
331
+ return;
332
+ }
297
333
  console.log(err);
298
334
  this.handleGlobalError(err);
299
335
  });
@@ -3695,7 +3731,7 @@ const main$j = async () => {
3695
3731
  if (MODES.some((mode) => values[mode])) {
3696
3732
  return;
3697
3733
  }
3698
- process.stdout.write(`@backtest-kit/cli ${"19.3.0"}\n`);
3734
+ process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n`);
3699
3735
  process.stdout.write("\n");
3700
3736
  process.stdout.write(`Run with --help to see available commands.\n`);
3701
3737
  process.stdout.write("\n");
@@ -5625,7 +5661,7 @@ const main$1 = async () => {
5625
5661
  if (!values.help) {
5626
5662
  return;
5627
5663
  }
5628
- process.stdout.write(`@backtest-kit/cli ${"19.3.0"}\n\n`);
5664
+ process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n\n`);
5629
5665
  process.stdout.write(HELP_TEXT);
5630
5666
  process.exit(0);
5631
5667
  };
@@ -5639,7 +5675,7 @@ const main = async () => {
5639
5675
  if (!values.version) {
5640
5676
  return;
5641
5677
  }
5642
- process.stdout.write(`@backtest-kit/cli ${"19.3.0"}\n`);
5678
+ process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n`);
5643
5679
  process.exit(0);
5644
5680
  };
5645
5681
  main();
package/build/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import * as BacktestKit from 'backtest-kit';
3
- import { setConfig, listenExit, emitters, Notification, Cron, Recent, Storage, Markdown, Report, Dump, State, Memory, MarkdownWriter, ReportWriter, PersistSignalAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistPartialAdapter, PersistBreakevenAdapter, PersistCandleAdapter, PersistStorageAdapter, PersistNotificationAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistIntervalAdapter, PersistMemoryAdapter, PersistRecentAdapter, PersistStateAdapter, PersistSessionAdapter, PersistStrategyAdapter, Log, StorageLive, StorageBacktest, NotificationLive, NotificationBacktest, RecentLive, RecentBacktest, Broker, SessionLive, SessionBacktest, MemoryLive, MemoryBacktest, StateLive, StateBacktest, listExchangeSchema, addExchangeSchema, roundTicks, listFrameSchema, addFrameSchema, listenDoneLive, listenDoneBacktest, shutdown, listenSignal, listStrategySchema, overrideExchangeSchema, Backtest, System, Cache, Interval, alignToInterval, addWalkerSchema, overrideWalkerSchema, Walker, listenDoneWalker, Live, getCandles, checkCandles, warmCandles, listenRisk, listenStrategyCommit, listenOrderFill, listenOrderReject, listenOrderContinue, listenOrderStop, listenSignalNotify, Exchange, runInMockContext, addSweepSchema, Sweep } from 'backtest-kit';
3
+ import { setConfig, listenExit, emitters, OrderDeletedError, OrderRejectedError, OrderTransientError, GeneralExpectedError, Notification, Cron, Recent, Storage, Markdown, Report, Dump, State, Memory, MarkdownWriter, ReportWriter, PersistSignalAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistPartialAdapter, PersistBreakevenAdapter, PersistCandleAdapter, PersistStorageAdapter, PersistNotificationAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistIntervalAdapter, PersistMemoryAdapter, PersistRecentAdapter, PersistStateAdapter, PersistSessionAdapter, PersistStrategyAdapter, Log, StorageLive, StorageBacktest, NotificationLive, NotificationBacktest, RecentLive, RecentBacktest, Broker, SessionLive, SessionBacktest, MemoryLive, MemoryBacktest, StateLive, StateBacktest, listExchangeSchema, addExchangeSchema, roundTicks, listFrameSchema, addFrameSchema, listenDoneLive, listenDoneBacktest, shutdown, listenSignal, listStrategySchema, overrideExchangeSchema, Backtest, System, Cache, Interval, alignToInterval, addWalkerSchema, overrideWalkerSchema, Walker, listenDoneWalker, Live, getCandles, checkCandles, warmCandles, listenRisk, listenStrategyCommit, listenOrderFill, listenOrderReject, listenOrderContinue, listenOrderStop, listenSignalNotify, Exchange, runInMockContext, addSweepSchema, Sweep } from 'backtest-kit';
4
4
  import { singleshot, sleep, getErrorMessage, errorData, BehaviorSubject, Subject, str, compose, createAwaiter, execpool, queued, randomString, TIMEOUT_SYMBOL, typo, retry, trycatch, ttl, Source, memoize, isObject } from 'functools-kit';
5
5
  import { exec, spawn } from 'child_process';
6
6
  import fs, { constants, realpathSync } from 'fs';
@@ -251,6 +251,18 @@ const timeNow = () => {
251
251
  class ErrorService {
252
252
  constructor() {
253
253
  this.handleGlobalError = async (error) => {
254
+ if (OrderDeletedError.isOrderDeletedError(error)) {
255
+ return;
256
+ }
257
+ if (OrderRejectedError.isOrderRejectedError(error)) {
258
+ return;
259
+ }
260
+ if (OrderTransientError.isOrderTransientError(error)) {
261
+ return;
262
+ }
263
+ if (GeneralExpectedError.isGeneralExpectedError(error)) {
264
+ return;
265
+ }
254
266
  const today = new Date();
255
267
  const dd = String(today.getDate()).padStart(2, "0");
256
268
  const mm = String(today.getMonth() + 1).padStart(2, "0");
@@ -265,10 +277,34 @@ class ErrorService {
265
277
  };
266
278
  this._listenForError = () => {
267
279
  process.on("uncaughtException", (err) => {
280
+ if (OrderDeletedError.isOrderDeletedError(err)) {
281
+ return;
282
+ }
283
+ if (OrderRejectedError.isOrderRejectedError(err)) {
284
+ return;
285
+ }
286
+ if (OrderTransientError.isOrderTransientError(err)) {
287
+ return;
288
+ }
289
+ if (GeneralExpectedError.isGeneralExpectedError(err)) {
290
+ return;
291
+ }
268
292
  console.log(err);
269
293
  this.handleGlobalError(err);
270
294
  });
271
295
  process.on("unhandledRejection", (err) => {
296
+ if (OrderDeletedError.isOrderDeletedError(err)) {
297
+ return;
298
+ }
299
+ if (OrderRejectedError.isOrderRejectedError(err)) {
300
+ return;
301
+ }
302
+ if (OrderTransientError.isOrderTransientError(err)) {
303
+ return;
304
+ }
305
+ if (GeneralExpectedError.isGeneralExpectedError(err)) {
306
+ return;
307
+ }
272
308
  console.log(err);
273
309
  this.handleGlobalError(err);
274
310
  });
@@ -3663,7 +3699,7 @@ const main$j = async () => {
3663
3699
  if (MODES.some((mode) => values[mode])) {
3664
3700
  return;
3665
3701
  }
3666
- process.stdout.write(`@backtest-kit/cli ${"19.3.0"}\n`);
3702
+ process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n`);
3667
3703
  process.stdout.write("\n");
3668
3704
  process.stdout.write(`Run with --help to see available commands.\n`);
3669
3705
  process.stdout.write("\n");
@@ -5593,7 +5629,7 @@ const main$1 = async () => {
5593
5629
  if (!values.help) {
5594
5630
  return;
5595
5631
  }
5596
- process.stdout.write(`@backtest-kit/cli ${"19.3.0"}\n\n`);
5632
+ process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n\n`);
5597
5633
  process.stdout.write(HELP_TEXT);
5598
5634
  process.exit(0);
5599
5635
  };
@@ -5607,7 +5643,7 @@ const main = async () => {
5607
5643
  if (!values.version) {
5608
5644
  return;
5609
5645
  }
5610
- process.stdout.write(`@backtest-kit/cli ${"19.3.0"}\n`);
5646
+ process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n`);
5611
5647
  process.exit(0);
5612
5648
  };
5613
5649
  main();
@@ -15,17 +15,17 @@
15
15
  "@types/node": "25.6.0"
16
16
  },
17
17
  "dependencies": {
18
- "@backtest-kit/cli": "19.4.0",
19
- "@backtest-kit/graph": "19.4.0",
20
- "@backtest-kit/pinets": "19.4.0",
21
- "@backtest-kit/signals": "19.4.0",
22
- "@backtest-kit/ui": "19.4.0",
18
+ "@backtest-kit/cli": "19.6.0",
19
+ "@backtest-kit/graph": "19.6.0",
20
+ "@backtest-kit/pinets": "19.6.0",
21
+ "@backtest-kit/signals": "19.6.0",
22
+ "@backtest-kit/ui": "19.6.0",
23
23
  "@tavily/core": "0.7.2",
24
24
  "@tensorflow/tfjs": "4.22.0",
25
25
  "@tensorflow/tfjs-backend-wasm": "4.22.0",
26
26
  "@tensorflow/tfjs-core": "4.22.0",
27
27
  "agent-swarm-kit": "6.0.0",
28
- "backtest-kit": "19.4.0",
28
+ "backtest-kit": "19.6.0",
29
29
  "dayjs": "1.11.20",
30
30
  "functools-kit": "5.0.0",
31
31
  "garch": "2.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backtest-kit/cli",
3
- "version": "19.4.0",
3
+ "version": "19.6.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",
@@ -63,11 +63,11 @@
63
63
  "devDependencies": {
64
64
  "@babel/plugin-transform-modules-umd": "7.27.1",
65
65
  "@babel/standalone": "7.29.1",
66
- "@backtest-kit/graph": "19.4.0",
67
- "@backtest-kit/ollama": "19.4.0",
68
- "@backtest-kit/pinets": "19.4.0",
69
- "@backtest-kit/signals": "19.4.0",
70
- "@backtest-kit/ui": "19.4.0",
66
+ "@backtest-kit/graph": "19.6.0",
67
+ "@backtest-kit/ollama": "19.6.0",
68
+ "@backtest-kit/pinets": "19.6.0",
69
+ "@backtest-kit/signals": "19.6.0",
70
+ "@backtest-kit/ui": "19.6.0",
71
71
  "@rollup/plugin-replace": "6.0.3",
72
72
  "@rollup/plugin-typescript": "11.1.6",
73
73
  "@types/image-size": "0.7.0",
@@ -75,7 +75,7 @@
75
75
  "@types/mustache": "4.2.6",
76
76
  "@types/node": "22.9.0",
77
77
  "@types/stack-trace": "0.0.33",
78
- "backtest-kit": "19.4.0",
78
+ "backtest-kit": "19.6.0",
79
79
  "glob": "11.0.1",
80
80
  "markdown-it": "14.1.1",
81
81
  "rimraf": "6.0.1",
@@ -92,14 +92,14 @@
92
92
  "peerDependencies": {
93
93
  "@babel/plugin-transform-modules-umd": "^7.27.1",
94
94
  "@babel/standalone": "^7.29.1",
95
- "@backtest-kit/graph": "^19.4.0",
96
- "@backtest-kit/ollama": "^19.4.0",
97
- "@backtest-kit/pinets": "^19.4.0",
98
- "@backtest-kit/signals": "^19.4.0",
99
- "@backtest-kit/ui": "^19.4.0",
95
+ "@backtest-kit/graph": "^19.6.0",
96
+ "@backtest-kit/ollama": "^19.6.0",
97
+ "@backtest-kit/pinets": "^19.6.0",
98
+ "@backtest-kit/signals": "^19.6.0",
99
+ "@backtest-kit/ui": "^19.6.0",
100
100
  "pinets": "^0.9.33",
101
101
  "ccxt": "^4.5.39",
102
- "backtest-kit": "^19.4.0",
102
+ "backtest-kit": "^19.6.0",
103
103
  "markdown-it": "^14.1.1",
104
104
  "typescript": "^5.0.0"
105
105
  },
@@ -13,12 +13,12 @@
13
13
  "license": "ISC",
14
14
  "type": "commonjs",
15
15
  "dependencies": {
16
- "@backtest-kit/cli": "^19.4.0",
17
- "@backtest-kit/graph": "^19.4.0",
18
- "@backtest-kit/pinets": "^19.4.0",
19
- "@backtest-kit/ui": "^19.4.0",
16
+ "@backtest-kit/cli": "^19.6.0",
17
+ "@backtest-kit/graph": "^19.6.0",
18
+ "@backtest-kit/pinets": "^19.6.0",
19
+ "@backtest-kit/ui": "^19.6.0",
20
20
  "agent-swarm-kit": "^6.0.0",
21
- "backtest-kit": "^19.4.0",
21
+ "backtest-kit": "^19.6.0",
22
22
  "functools-kit": "^5.0.0",
23
23
  "garch": "^2.0.0",
24
24
  "get-moment-stamp": "^3.0.0",