@backtest-kit/cli 0.0.1 → 0.0.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backtest-kit/cli",
3
- "version": "0.0.1",
4
- "description": "The CLI for launching backtests without a boilerplate",
3
+ "version": "0.0.3",
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",
7
7
  "email": "tripolskypetr@gmail.com",
@@ -13,7 +13,23 @@
13
13
  },
14
14
  "license": "MIT",
15
15
  "homepage": "https://backtest-kit.github.io/documents/example_02_first_backtest.html",
16
- "keywords": [],
16
+ "keywords": [
17
+ "backtest",
18
+ "backtesting",
19
+ "trading",
20
+ "cli",
21
+ "cryptocurrency",
22
+ "crypto",
23
+ "live-trading",
24
+ "paper-trading",
25
+ "telegram",
26
+ "binance",
27
+ "ccxt",
28
+ "candle-cache",
29
+ "strategy",
30
+ "typescript",
31
+ "monorepo"
32
+ ],
17
33
  "files": [
18
34
  "build",
19
35
  "types.d.ts",
File without changes
package/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as functools_kit from 'functools-kit';
2
+ import { CandleInterval, TrailingTakeCommit, TrailingStopCommit, BreakevenCommit, PartialProfitCommit, PartialLossCommit, IStrategyTickResultScheduled, IStrategyTickResultCancelled, IStrategyTickResultOpened, IStrategyTickResultClosed, RiskContract } from 'backtest-kit';
2
3
  import { Input } from 'telegraf';
3
- import { TrailingTakeCommit, TrailingStopCommit, BreakevenCommit, PartialProfitCommit, PartialLossCommit, IStrategyTickResultScheduled, IStrategyTickResultCancelled, IStrategyTickResultOpened, IStrategyTickResultClosed, RiskContract } from 'backtest-kit';
4
4
 
5
5
  interface ILogger {
6
6
  log(topic: string, ...args: any[]): void;
@@ -20,41 +20,68 @@ declare class LoggerService implements ILogger {
20
20
 
21
21
  declare class PaperMainService {
22
22
  private loggerService;
23
- private exchangeSchemaService;
24
23
  private resolveService;
24
+ private exchangeSchemaService;
25
+ private symbolSchemaService;
25
26
  private frontendProviderService;
26
27
  private telegramProviderService;
27
- protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
28
+ run: ((payload: {
29
+ entryPoint: string;
30
+ symbol: string;
31
+ strategy: string;
32
+ exchange: string;
33
+ verbose: boolean;
34
+ }) => Promise<void>) & functools_kit.ISingleshotClearable;
35
+ connect: (() => Promise<void>) & functools_kit.ISingleshotClearable;
28
36
  }
29
37
 
30
38
  declare class LiveMainService {
31
39
  private loggerService;
32
- private exchangeSchemaService;
33
40
  private resolveService;
41
+ private exchangeSchemaService;
42
+ private symbolSchemaService;
34
43
  private frontendProviderService;
35
44
  private telegramProviderService;
36
- protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
45
+ private liveProviderService;
46
+ run: ((payload: {
47
+ entryPoint: string;
48
+ symbol: string;
49
+ strategy: string;
50
+ exchange: string;
51
+ verbose: boolean;
52
+ }) => Promise<void>) & functools_kit.ISingleshotClearable;
53
+ connect: (() => Promise<void>) & functools_kit.ISingleshotClearable;
37
54
  }
38
55
 
39
56
  declare class BacktestMainService {
40
57
  private loggerService;
58
+ private resolveService;
41
59
  private exchangeSchemaService;
42
60
  private frameSchemaService;
61
+ private symbolSchemaService;
43
62
  private cacheLogicService;
44
- private resolveService;
45
63
  private frontendProviderService;
46
64
  private telegramProviderService;
47
- protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
65
+ run: ((payload: {
66
+ entryPoint: string;
67
+ symbol: string;
68
+ strategy: string;
69
+ exchange: string;
70
+ frame: string;
71
+ cacheList: string[];
72
+ verbose: boolean;
73
+ }) => Promise<void>) & functools_kit.ISingleshotClearable;
74
+ connect: (() => Promise<void>) & functools_kit.ISingleshotClearable;
48
75
  }
49
76
 
50
77
  declare class ExchangeSchemaService {
51
78
  readonly loggerService: LoggerService;
52
- init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
79
+ addSchema: (() => Promise<void>) & functools_kit.ISingleshotClearable;
53
80
  }
54
81
 
55
82
  declare class FrameSchemaService {
56
83
  readonly loggerService: LoggerService;
57
- init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
84
+ addSchema: (() => Promise<void>) & functools_kit.ISingleshotClearable;
58
85
  }
59
86
 
60
87
  declare class ResolveService {
@@ -68,19 +95,19 @@ declare class ResolveService {
68
95
  declare class ErrorService {
69
96
  handleGlobalError: (error: Error) => Promise<void>;
70
97
  private _listenForError;
71
- protected init: () => void;
98
+ protected init: (() => void) & functools_kit.ISingleshotClearable;
72
99
  }
73
100
 
74
101
  declare class SymbolSchemaService {
75
102
  readonly loggerService: LoggerService;
76
- init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
103
+ addSchema: (() => Promise<void>) & functools_kit.ISingleshotClearable;
77
104
  }
78
105
 
79
106
  declare class FrontendProviderService {
80
107
  private readonly loggerService;
81
108
  enable: (() => () => void) & functools_kit.ISingleshotClearable;
82
109
  disable: () => void;
83
- init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
110
+ connect: (() => Promise<() => void>) & functools_kit.ISingleshotClearable;
84
111
  }
85
112
 
86
113
  declare class TelegramProviderService {
@@ -88,12 +115,12 @@ declare class TelegramProviderService {
88
115
  private readonly telegramLogicService;
89
116
  enable: (() => () => void) & functools_kit.ISingleshotClearable;
90
117
  disable: () => void;
91
- init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
118
+ connect: (() => Promise<() => void>) & functools_kit.ISingleshotClearable;
92
119
  }
93
120
 
94
121
  declare class CacheLogicService {
95
122
  private readonly loggerService;
96
- execute: (dto: {
123
+ execute: (intervalList: CandleInterval[], dto: {
97
124
  symbol: string;
98
125
  frameName: string;
99
126
  exchangeName: string;
@@ -190,7 +217,7 @@ declare class LiveProviderService {
190
217
  private handleRisk;
191
218
  enable: (() => (...args: any[]) => any) & functools_kit.ISingleshotClearable;
192
219
  disable: () => void;
193
- init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
220
+ connect: (() => Promise<() => void>) & functools_kit.ISingleshotClearable;
194
221
  }
195
222
 
196
223
  declare const cli: {
@@ -225,4 +252,11 @@ declare enum FrameName {
225
252
 
226
253
  declare function setLogger(logger: ILogger): void;
227
254
 
228
- export { type BaseModule, ExchangeName, FrameName, type ILiveModule, type ILogger, type LiveModule, type TBaseModuleCtor, cli, setLogger };
255
+ type PayloadBacktest = Parameters<typeof cli.backtestMainService.run>[0];
256
+ type PayloadPaper = Parameters<typeof cli.paperMainService.run>[0];
257
+ type PayloadLive = Parameters<typeof cli.liveMainService.run>[0];
258
+ type Mode = "backtest" | "live" | "paper";
259
+ type Args = Partial<PayloadBacktest> | Partial<PayloadPaper> | Partial<PayloadLive>;
260
+ declare function run(mode: Mode, args: Args): Promise<void>;
261
+
262
+ export { type BaseModule, ExchangeName, FrameName, type ILiveModule, type ILogger, type LiveModule, type TBaseModuleCtor, cli, run, setLogger };