@backtest-kit/cli 22.5.0 → 23.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.cjs CHANGED
@@ -236,12 +236,14 @@ const getReadySubject = functoolsKit.singleshot(() => {
236
236
  return new functoolsKit.Subject();
237
237
  });
238
238
 
239
+ const CLI_SYMBOL = Symbol.for("backtest-kit-cli");
239
240
  const main$k = () => {
240
241
  const entrySubject = getEntrySubject();
241
242
  entrySubject.subscribe(async (path) => {
242
243
  console.log("Running", path);
243
244
  await getReadySubject().next();
244
245
  });
246
+ Object.assign(globalThis, { [CLI_SYMBOL]: 1 });
245
247
  };
246
248
  main$k();
247
249
 
@@ -464,6 +466,10 @@ const SETUP_ADAPTER_FN = () => {
464
466
  BacktestKit.StateLive.usePersist();
465
467
  BacktestKit.StateBacktest.useLocal();
466
468
  }
469
+ {
470
+ BacktestKit.BudgetLive.usePersist();
471
+ BacktestKit.BudgetBacktest.useLocal();
472
+ }
467
473
  {
468
474
  BacktestKit.DictionaryLive.usePersist();
469
475
  BacktestKit.DictionaryBacktest.useLocal();
@@ -492,9 +498,12 @@ class SetupUtils {
492
498
  BacktestKit.Markdown.enable();
493
499
  BacktestKit.Report.enable();
494
500
  BacktestKit.Dump.enable();
501
+ BacktestKit.Memory.enable();
502
+ }
503
+ {
495
504
  BacktestKit.State.enable();
505
+ BacktestKit.Budget.enable();
496
506
  BacktestKit.Dictionary.enable();
497
- BacktestKit.Memory.enable();
498
507
  }
499
508
  if (!cli.configConnectionService.hasConfig("setup.config")) {
500
509
  SETUP_ADAPTER_FN();
@@ -519,6 +528,7 @@ class SetupUtils {
519
528
  BacktestKit.Report.disable();
520
529
  BacktestKit.Dump.disable();
521
530
  BacktestKit.State.disable();
531
+ BacktestKit.Budget.disable();
522
532
  BacktestKit.Dictionary.disable();
523
533
  BacktestKit.Memory.disable();
524
534
  }
@@ -543,6 +553,7 @@ class SetupUtils {
543
553
  BacktestKit.PersistMemoryAdapter.clear();
544
554
  BacktestKit.PersistRecentAdapter.clear();
545
555
  BacktestKit.PersistStateAdapter.clear();
556
+ BacktestKit.PersistBudgetAdapter.clear();
546
557
  BacktestKit.PersistDictionaryAdapter.clear();
547
558
  BacktestKit.PersistSessionAdapter.clear();
548
559
  BacktestKit.PersistStrategyAdapter.clear();
@@ -564,6 +575,10 @@ class SetupUtils {
564
575
  BacktestKit.RecentLive.clear();
565
576
  BacktestKit.RecentBacktest.clear();
566
577
  }
578
+ {
579
+ BacktestKit.BudgetLive.clear();
580
+ BacktestKit.BudgetBacktest.clear();
581
+ }
567
582
  {
568
583
  BacktestKit.Broker.clear();
569
584
  }
@@ -3740,7 +3755,7 @@ const main$j = async () => {
3740
3755
  if (MODES.some((mode) => values[mode])) {
3741
3756
  return;
3742
3757
  }
3743
- process.stdout.write(`@backtest-kit/cli ${"21.4.0"}\n`);
3758
+ process.stdout.write(`@backtest-kit/cli ${"23.1.0"}\n`);
3744
3759
  process.stdout.write("\n");
3745
3760
  process.stdout.write(`Run with --help to see available commands.\n`);
3746
3761
  process.stdout.write("\n");
@@ -4766,6 +4781,7 @@ const ZERO_PNL = {
4766
4781
  priceClose: 0,
4767
4782
  pnlCost: 0,
4768
4783
  pnlEntries: 0,
4784
+ pnlDividends: 0,
4769
4785
  };
4770
4786
  const main$5 = async () => {
4771
4787
  if (!getEntry((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))) {
@@ -5670,7 +5686,7 @@ const main$1 = async () => {
5670
5686
  if (!values.help) {
5671
5687
  return;
5672
5688
  }
5673
- process.stdout.write(`@backtest-kit/cli ${"21.4.0"}\n\n`);
5689
+ process.stdout.write(`@backtest-kit/cli ${"23.1.0"}\n\n`);
5674
5690
  process.stdout.write(HELP_TEXT);
5675
5691
  process.exit(0);
5676
5692
  };
@@ -5684,7 +5700,7 @@ const main = async () => {
5684
5700
  if (!values.version) {
5685
5701
  return;
5686
5702
  }
5687
- process.stdout.write(`@backtest-kit/cli ${"21.4.0"}\n`);
5703
+ process.stdout.write(`@backtest-kit/cli ${"23.1.0"}\n`);
5688
5704
  process.exit(0);
5689
5705
  };
5690
5706
  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, OrderDeletedError, OrderRejectedError, OrderTransientError, GeneralExpectedError, Notification, Cron, Recent, Storage, Markdown, Report, Dump, State, Dictionary, Memory, MarkdownWriter, ReportWriter, PersistSignalAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistPartialAdapter, PersistBreakevenAdapter, PersistCandleAdapter, PersistStorageAdapter, PersistNotificationAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistIntervalAdapter, PersistMemoryAdapter, PersistRecentAdapter, PersistStateAdapter, PersistDictionaryAdapter, PersistSessionAdapter, PersistStrategyAdapter, Log, StorageLive, StorageBacktest, NotificationLive, NotificationBacktest, RecentLive, RecentBacktest, Broker, SessionLive, SessionBacktest, MemoryLive, MemoryBacktest, StateLive, StateBacktest, DictionaryLive, DictionaryBacktest, 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, Memory, State, Budget, Dictionary, MarkdownWriter, ReportWriter, PersistSignalAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistPartialAdapter, PersistBreakevenAdapter, PersistCandleAdapter, PersistStorageAdapter, PersistNotificationAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistIntervalAdapter, PersistMemoryAdapter, PersistRecentAdapter, PersistStateAdapter, PersistBudgetAdapter, PersistDictionaryAdapter, PersistSessionAdapter, PersistStrategyAdapter, Log, StorageLive, StorageBacktest, NotificationLive, NotificationBacktest, RecentLive, RecentBacktest, BudgetLive, BudgetBacktest, Broker, SessionLive, SessionBacktest, MemoryLive, MemoryBacktest, StateLive, StateBacktest, DictionaryLive, DictionaryBacktest, 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';
@@ -211,12 +211,14 @@ const getReadySubject = singleshot(() => {
211
211
  return new Subject();
212
212
  });
213
213
 
214
+ const CLI_SYMBOL = Symbol.for("backtest-kit-cli");
214
215
  const main$k = () => {
215
216
  const entrySubject = getEntrySubject();
216
217
  entrySubject.subscribe(async (path) => {
217
218
  console.log("Running", path);
218
219
  await getReadySubject().next();
219
220
  });
221
+ Object.assign(globalThis, { [CLI_SYMBOL]: 1 });
220
222
  };
221
223
  main$k();
222
224
 
@@ -439,6 +441,10 @@ const SETUP_ADAPTER_FN = () => {
439
441
  StateLive.usePersist();
440
442
  StateBacktest.useLocal();
441
443
  }
444
+ {
445
+ BudgetLive.usePersist();
446
+ BudgetBacktest.useLocal();
447
+ }
442
448
  {
443
449
  DictionaryLive.usePersist();
444
450
  DictionaryBacktest.useLocal();
@@ -467,9 +473,12 @@ class SetupUtils {
467
473
  Markdown.enable();
468
474
  Report.enable();
469
475
  Dump.enable();
476
+ Memory.enable();
477
+ }
478
+ {
470
479
  State.enable();
480
+ Budget.enable();
471
481
  Dictionary.enable();
472
- Memory.enable();
473
482
  }
474
483
  if (!cli.configConnectionService.hasConfig("setup.config")) {
475
484
  SETUP_ADAPTER_FN();
@@ -494,6 +503,7 @@ class SetupUtils {
494
503
  Report.disable();
495
504
  Dump.disable();
496
505
  State.disable();
506
+ Budget.disable();
497
507
  Dictionary.disable();
498
508
  Memory.disable();
499
509
  }
@@ -518,6 +528,7 @@ class SetupUtils {
518
528
  PersistMemoryAdapter.clear();
519
529
  PersistRecentAdapter.clear();
520
530
  PersistStateAdapter.clear();
531
+ PersistBudgetAdapter.clear();
521
532
  PersistDictionaryAdapter.clear();
522
533
  PersistSessionAdapter.clear();
523
534
  PersistStrategyAdapter.clear();
@@ -539,6 +550,10 @@ class SetupUtils {
539
550
  RecentLive.clear();
540
551
  RecentBacktest.clear();
541
552
  }
553
+ {
554
+ BudgetLive.clear();
555
+ BudgetBacktest.clear();
556
+ }
542
557
  {
543
558
  Broker.clear();
544
559
  }
@@ -3708,7 +3723,7 @@ const main$j = async () => {
3708
3723
  if (MODES.some((mode) => values[mode])) {
3709
3724
  return;
3710
3725
  }
3711
- process.stdout.write(`@backtest-kit/cli ${"21.4.0"}\n`);
3726
+ process.stdout.write(`@backtest-kit/cli ${"23.1.0"}\n`);
3712
3727
  process.stdout.write("\n");
3713
3728
  process.stdout.write(`Run with --help to see available commands.\n`);
3714
3729
  process.stdout.write("\n");
@@ -4734,6 +4749,7 @@ const ZERO_PNL = {
4734
4749
  priceClose: 0,
4735
4750
  pnlCost: 0,
4736
4751
  pnlEntries: 0,
4752
+ pnlDividends: 0,
4737
4753
  };
4738
4754
  const main$5 = async () => {
4739
4755
  if (!getEntry(import.meta.url)) {
@@ -5638,7 +5654,7 @@ const main$1 = async () => {
5638
5654
  if (!values.help) {
5639
5655
  return;
5640
5656
  }
5641
- process.stdout.write(`@backtest-kit/cli ${"21.4.0"}\n\n`);
5657
+ process.stdout.write(`@backtest-kit/cli ${"23.1.0"}\n\n`);
5642
5658
  process.stdout.write(HELP_TEXT);
5643
5659
  process.exit(0);
5644
5660
  };
@@ -5652,7 +5668,7 @@ const main = async () => {
5652
5668
  if (!values.version) {
5653
5669
  return;
5654
5670
  }
5655
- process.stdout.write(`@backtest-kit/cli ${"21.4.0"}\n`);
5671
+ process.stdout.write(`@backtest-kit/cli ${"23.1.0"}\n`);
5656
5672
  process.exit(0);
5657
5673
  };
5658
5674
  main();
@@ -15,17 +15,17 @@
15
15
  "@types/node": "25.6.0"
16
16
  },
17
17
  "dependencies": {
18
- "@backtest-kit/cli": "22.5.0",
19
- "@backtest-kit/graph": "22.5.0",
20
- "@backtest-kit/pinets": "22.5.0",
21
- "@backtest-kit/signals": "22.5.0",
22
- "@backtest-kit/ui": "22.5.0",
18
+ "@backtest-kit/cli": "23.1.0",
19
+ "@backtest-kit/graph": "23.1.0",
20
+ "@backtest-kit/pinets": "23.1.0",
21
+ "@backtest-kit/signals": "23.1.0",
22
+ "@backtest-kit/ui": "23.1.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": "22.5.0",
28
+ "backtest-kit": "23.1.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": "22.5.0",
3
+ "version": "23.1.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": "22.5.0",
67
- "@backtest-kit/ollama": "22.5.0",
68
- "@backtest-kit/pinets": "22.5.0",
69
- "@backtest-kit/signals": "22.5.0",
70
- "@backtest-kit/ui": "22.5.0",
66
+ "@backtest-kit/graph": "23.1.0",
67
+ "@backtest-kit/ollama": "23.1.0",
68
+ "@backtest-kit/pinets": "23.1.0",
69
+ "@backtest-kit/signals": "23.1.0",
70
+ "@backtest-kit/ui": "23.1.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": "22.5.0",
78
+ "backtest-kit": "23.1.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": "^22.5.0",
96
- "@backtest-kit/ollama": "^22.5.0",
97
- "@backtest-kit/pinets": "^22.5.0",
98
- "@backtest-kit/signals": "^22.5.0",
99
- "@backtest-kit/ui": "^22.5.0",
95
+ "@backtest-kit/graph": "^23.1.0",
96
+ "@backtest-kit/ollama": "^23.1.0",
97
+ "@backtest-kit/pinets": "^23.1.0",
98
+ "@backtest-kit/signals": "^23.1.0",
99
+ "@backtest-kit/ui": "^23.1.0",
100
100
  "pinets": "^0.9.34",
101
101
  "ccxt": "^4.5.39",
102
- "backtest-kit": "^22.5.0",
102
+ "backtest-kit": "^23.1.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": "^22.5.0",
17
- "@backtest-kit/graph": "^22.5.0",
18
- "@backtest-kit/pinets": "^22.5.0",
19
- "@backtest-kit/ui": "^22.5.0",
16
+ "@backtest-kit/cli": "^23.1.0",
17
+ "@backtest-kit/graph": "^23.1.0",
18
+ "@backtest-kit/pinets": "^23.1.0",
19
+ "@backtest-kit/ui": "^23.1.0",
20
20
  "agent-swarm-kit": "^6.0.0",
21
- "backtest-kit": "^22.5.0",
21
+ "backtest-kit": "^23.1.0",
22
22
  "functools-kit": "^5.0.0",
23
23
  "garch": "^2.0.0",
24
24
  "get-moment-stamp": "^3.0.0",