@backtest-kit/cli 5.1.0 → 5.2.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
@@ -106,6 +106,10 @@ BacktestKit.setConfig({
106
106
  CC_MAX_NOTIFICATIONS: 5000,
107
107
  CC_MAX_SIGNALS: 750,
108
108
  });
109
+ BacktestKit.setConfig({
110
+ CC_ENABLE_DCA_EVERYWHERE: true,
111
+ CC_ENABLE_PPPL_EVERYWHERE: true,
112
+ });
109
113
  BacktestKit.Log.useJsonl();
110
114
 
111
115
  const ERROR_HANDLER_INSTALLED = Symbol.for("error-handler-installed");
@@ -249,10 +253,10 @@ const entrySubject = new functoolsKit.BehaviorSubject();
249
253
 
250
254
  const __filename$2 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
251
255
  const __dirname$2 = path.dirname(__filename$2);
252
- const require$3 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
256
+ const require$2 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
253
257
  const REQUIRE_ENTRY_FACTORY = (filePath) => {
254
258
  try {
255
- require$3(filePath);
259
+ require$2(filePath);
256
260
  return true;
257
261
  }
258
262
  catch {
@@ -660,7 +664,7 @@ class BacktestMainService {
660
664
  });
661
665
  notifyVerbose();
662
666
  }
663
- await this.moduleConnectionService.loadModule("./backtest.module");
667
+ await this.moduleConnectionService.loadModule("./backtest");
664
668
  BacktestKit.Backtest.background(symbol, {
665
669
  strategyName,
666
670
  frameName,
@@ -740,7 +744,7 @@ class LiveMainService {
740
744
  });
741
745
  notifyVerbose();
742
746
  }
743
- await this.moduleConnectionService.loadModule("./live.module");
747
+ await this.moduleConnectionService.loadModule("./live");
744
748
  BacktestKit.Live.background(symbol, {
745
749
  strategyName,
746
750
  exchangeName,
@@ -813,7 +817,7 @@ class PaperMainService {
813
817
  });
814
818
  notifyVerbose();
815
819
  }
816
- await this.moduleConnectionService.loadModule("./paper.module");
820
+ await this.moduleConnectionService.loadModule("./paper");
817
821
  BacktestKit.Live.background(symbol, {
818
822
  strategyName,
819
823
  exchangeName,
@@ -1706,7 +1710,7 @@ class TelegramTemplateService {
1706
1710
  }
1707
1711
  }
1708
1712
 
1709
- const require$2 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
1713
+ const require$1 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
1710
1714
  const getExtVariants = (fileName) => {
1711
1715
  const ext = path.extname(fileName);
1712
1716
  const base = ext ? fileName.slice(0, -ext.length) : fileName;
@@ -1722,7 +1726,7 @@ const getExtVariants = (fileName) => {
1722
1726
  const REQUIRE_MODULE_FACTORY = (fileName) => {
1723
1727
  for (const variant of getExtVariants(fileName)) {
1724
1728
  try {
1725
- require$2(variant);
1729
+ require$1(variant);
1726
1730
  return true;
1727
1731
  }
1728
1732
  catch {
@@ -1785,26 +1789,28 @@ class ModuleConnectionService {
1785
1789
  }
1786
1790
 
1787
1791
  standalone.registerPlugin("plugin-transform-modules-umd", pluginUMD);
1788
- const baseRequire = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
1789
- const require$1 = new Proxy(baseRequire, {
1790
- apply(_target, _this, args) {
1791
- const id = args[0];
1792
- if (id === "backtest-kit")
1793
- return globalThis.BacktestKit;
1794
- if (id === "@backtest-kit/cli")
1795
- return globalThis.BacktestKitCli;
1796
- if (id === "@backtest-kit/ui")
1797
- return globalThis.BacktestKitUi;
1798
- if (id === "@backtest-kit/graph")
1799
- return globalThis.BacktestKitGraph;
1800
- if (id === "@backtest-kit/ollama")
1801
- return globalThis.BacktestKitOllama;
1802
- if (id === "@backtest-kit/pinets")
1803
- return globalThis.BacktestKitPinets;
1804
- if (id === "@backtest-kit/signals")
1805
- return globalThis.BacktestKitSignals;
1806
- return baseRequire(id);
1807
- },
1792
+ const getBaseRequire = functoolsKit.singleshot(() => {
1793
+ const baseRequire = module$1.createRequire(path.join(process.cwd(), "index.cjs"));
1794
+ return new Proxy(baseRequire, {
1795
+ apply(_target, _this, args) {
1796
+ const id = args[0];
1797
+ if (id === "backtest-kit")
1798
+ return globalThis.BacktestKit;
1799
+ if (id === "@backtest-kit/cli")
1800
+ return globalThis.BacktestKitCli;
1801
+ if (id === "@backtest-kit/ui")
1802
+ return globalThis.BacktestKitUi;
1803
+ if (id === "@backtest-kit/graph")
1804
+ return globalThis.BacktestKitGraph;
1805
+ if (id === "@backtest-kit/ollama")
1806
+ return globalThis.BacktestKitOllama;
1807
+ if (id === "@backtest-kit/pinets")
1808
+ return globalThis.BacktestKitPinets;
1809
+ if (id === "@backtest-kit/signals")
1810
+ return globalThis.BacktestKitSignals;
1811
+ return baseRequire(id);
1812
+ },
1813
+ });
1808
1814
  });
1809
1815
  const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
1810
1816
  const __dirname$1 = path.dirname(__filename$1);
@@ -1852,11 +1858,12 @@ class BabelService {
1852
1858
  this.loggerService.log("babelService transpileAndRun", {
1853
1859
  codeLen: code.length,
1854
1860
  });
1861
+ const require = getBaseRequire();
1855
1862
  const module = { exports: {} };
1856
1863
  const exports = module.exports;
1857
1864
  eval(this.transpile(code));
1858
1865
  return {
1859
- require: require$1,
1866
+ require,
1860
1867
  __filename: __filename$1,
1861
1868
  __dirname: __dirname$1,
1862
1869
  exports,
package/build/index.mjs CHANGED
@@ -80,6 +80,10 @@ setConfig({
80
80
  CC_MAX_NOTIFICATIONS: 5000,
81
81
  CC_MAX_SIGNALS: 750,
82
82
  });
83
+ setConfig({
84
+ CC_ENABLE_DCA_EVERYWHERE: true,
85
+ CC_ENABLE_PPPL_EVERYWHERE: true,
86
+ });
83
87
  Log.useJsonl();
84
88
 
85
89
  const ERROR_HANDLER_INSTALLED = Symbol.for("error-handler-installed");
@@ -634,7 +638,7 @@ class BacktestMainService {
634
638
  });
635
639
  notifyVerbose();
636
640
  }
637
- await this.moduleConnectionService.loadModule("./backtest.module");
641
+ await this.moduleConnectionService.loadModule("./backtest");
638
642
  Backtest.background(symbol, {
639
643
  strategyName,
640
644
  frameName,
@@ -714,7 +718,7 @@ class LiveMainService {
714
718
  });
715
719
  notifyVerbose();
716
720
  }
717
- await this.moduleConnectionService.loadModule("./live.module");
721
+ await this.moduleConnectionService.loadModule("./live");
718
722
  Live.background(symbol, {
719
723
  strategyName,
720
724
  exchangeName,
@@ -787,7 +791,7 @@ class PaperMainService {
787
791
  });
788
792
  notifyVerbose();
789
793
  }
790
- await this.moduleConnectionService.loadModule("./paper.module");
794
+ await this.moduleConnectionService.loadModule("./paper");
791
795
  Live.background(symbol, {
792
796
  strategyName,
793
797
  exchangeName,
@@ -1759,26 +1763,28 @@ class ModuleConnectionService {
1759
1763
  }
1760
1764
 
1761
1765
  registerPlugin("plugin-transform-modules-umd", pluginUMD);
1762
- const baseRequire = createRequire(import.meta.url);
1763
- const require = new Proxy(baseRequire, {
1764
- apply(_target, _this, args) {
1765
- const id = args[0];
1766
- if (id === "backtest-kit")
1767
- return globalThis.BacktestKit;
1768
- if (id === "@backtest-kit/cli")
1769
- return globalThis.BacktestKitCli;
1770
- if (id === "@backtest-kit/ui")
1771
- return globalThis.BacktestKitUi;
1772
- if (id === "@backtest-kit/graph")
1773
- return globalThis.BacktestKitGraph;
1774
- if (id === "@backtest-kit/ollama")
1775
- return globalThis.BacktestKitOllama;
1776
- if (id === "@backtest-kit/pinets")
1777
- return globalThis.BacktestKitPinets;
1778
- if (id === "@backtest-kit/signals")
1779
- return globalThis.BacktestKitSignals;
1780
- return baseRequire(id);
1781
- },
1766
+ const getBaseRequire = singleshot(() => {
1767
+ const baseRequire = createRequire(path.join(process.cwd(), "index.cjs"));
1768
+ return new Proxy(baseRequire, {
1769
+ apply(_target, _this, args) {
1770
+ const id = args[0];
1771
+ if (id === "backtest-kit")
1772
+ return globalThis.BacktestKit;
1773
+ if (id === "@backtest-kit/cli")
1774
+ return globalThis.BacktestKitCli;
1775
+ if (id === "@backtest-kit/ui")
1776
+ return globalThis.BacktestKitUi;
1777
+ if (id === "@backtest-kit/graph")
1778
+ return globalThis.BacktestKitGraph;
1779
+ if (id === "@backtest-kit/ollama")
1780
+ return globalThis.BacktestKitOllama;
1781
+ if (id === "@backtest-kit/pinets")
1782
+ return globalThis.BacktestKitPinets;
1783
+ if (id === "@backtest-kit/signals")
1784
+ return globalThis.BacktestKitSignals;
1785
+ return baseRequire(id);
1786
+ },
1787
+ });
1782
1788
  });
1783
1789
  const __filename = fileURLToPath(import.meta.url);
1784
1790
  const __dirname = path.dirname(__filename);
@@ -1826,6 +1832,7 @@ class BabelService {
1826
1832
  this.loggerService.log("babelService transpileAndRun", {
1827
1833
  codeLen: code.length,
1828
1834
  });
1835
+ const require = getBaseRequire();
1829
1836
  const module = { exports: {} };
1830
1837
  const exports = module.exports;
1831
1838
  eval(this.transpile(code));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backtest-kit/cli",
3
- "version": "5.1.0",
3
+ "version": "5.2.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.1.0",
64
- "@backtest-kit/graph": "5.1.0",
65
- "@backtest-kit/ollama": "5.1.0",
66
- "@backtest-kit/pinets": "5.1.0",
67
- "@backtest-kit/signals": "5.1.0",
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",
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.1.0",
75
+ "backtest-kit": "5.2.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.1.0",
91
- "@backtest-kit/graph": "^5.1.0",
92
- "@backtest-kit/ollama": "^5.1.0",
93
- "@backtest-kit/pinets": "^5.1.0",
94
- "@backtest-kit/signals": "^5.1.0",
95
- "backtest-kit": "^5.1.0",
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",
96
96
  "markdown-it": "^14.1.1",
97
97
  "typescript": "^5.0.0"
98
98
  },