@backtest-kit/cli 14.1.0 → 15.0.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/README.md +874 -874
- package/build/index.cjs +387 -274
- package/build/index.mjs +381 -271
- package/config/notification.config.mjs +13 -13
- package/config/symbol.config.mjs +460 -460
- package/docker/.env.example +2 -2
- package/docker/content/feb_2026/feb_2026.strategy.ts +11 -11
- package/docker/content/feb_2026/modules/backtest.module.ts +83 -83
- package/docker/docker-compose.yaml +46 -46
- package/docker/package.json +39 -39
- package/docker/tsconfig.json +36 -36
- package/package.json +129 -129
- package/template/average-buy.mustache +22 -22
- package/template/breakeven.mustache +21 -21
- package/template/cancel-scheduled.mustache +14 -14
- package/template/cancelled.mustache +21 -21
- package/template/close-pending.mustache +16 -16
- package/template/closed.mustache +23 -23
- package/template/opened.mustache +22 -22
- package/template/partial-loss.mustache +22 -22
- package/template/partial-profit.mustache +22 -22
- package/template/project/config/symbol.config.ts +460 -460
- package/template/project/package.mustache +28 -28
- package/template/risk.mustache +19 -19
- package/template/scheduled.mustache +22 -22
- package/template/signal-close.mustache +22 -22
- package/template/signal-info.mustache +20 -20
- package/template/signal-open.mustache +22 -22
- package/template/source/CLAUDE.md +160 -160
- package/template/trailing-stop.mustache +21 -21
- package/template/trailing-take.mustache +21 -21
- package/types.d.ts +7 -7
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
**🛡️ Trailing Stop**
|
|
2
|
-
|
|
3
|
-
**Symbol:** `{{symbol}}` ({{position}})
|
|
4
|
-
|
|
5
|
-
**Current:** `{{currentPrice}}`
|
|
6
|
-
**Entry:** `{{priceOpen}}`
|
|
7
|
-
**Orig Entry:** `{{originalPriceOpen}}`
|
|
8
|
-
**Take Profit:** `{{priceTakeProfit}}`
|
|
9
|
-
**Orig TP:** `{{originalPriceTakeProfit}}`
|
|
10
|
-
**Old Stop Loss:** `{{originalPriceStopLoss}}`
|
|
11
|
-
**New Stop Loss:** `{{priceStopLoss}}` ({{percentShift}}%)
|
|
12
|
-
**DCA Entries:** `{{totalEntries}}`
|
|
13
|
-
**Partials Done:** `{{totalPartials}}`
|
|
14
|
-
**PnL:** {{pnl.pnlPercentage}}% ({{pnl.pnlCost}} / {{pnl.pnlEntries}})
|
|
15
|
-
**Peak Profit:** {{peakProfit.pnlPercentage}}% ({{peakProfit.pnlCost}} / {{peakProfit.pnlEntries}})
|
|
16
|
-
**Max Drawdown:** {{maxDrawdown.pnlPercentage}}% ({{maxDrawdown.pnlCost}} / {{maxDrawdown.pnlEntries}})
|
|
17
|
-
**Signal ID:** `{{signalId}}`
|
|
18
|
-
**Time:** `{{timestamp}}`
|
|
19
|
-
|
|
20
|
-
{{#backtest}}
|
|
21
|
-
_🧪 Backtest_
|
|
1
|
+
**🛡️ Trailing Stop**
|
|
2
|
+
|
|
3
|
+
**Symbol:** `{{symbol}}` ({{position}})
|
|
4
|
+
|
|
5
|
+
**Current:** `{{currentPrice}}`
|
|
6
|
+
**Entry:** `{{priceOpen}}`
|
|
7
|
+
**Orig Entry:** `{{originalPriceOpen}}`
|
|
8
|
+
**Take Profit:** `{{priceTakeProfit}}`
|
|
9
|
+
**Orig TP:** `{{originalPriceTakeProfit}}`
|
|
10
|
+
**Old Stop Loss:** `{{originalPriceStopLoss}}`
|
|
11
|
+
**New Stop Loss:** `{{priceStopLoss}}` ({{percentShift}}%)
|
|
12
|
+
**DCA Entries:** `{{totalEntries}}`
|
|
13
|
+
**Partials Done:** `{{totalPartials}}`
|
|
14
|
+
**PnL:** {{pnl.pnlPercentage}}% ({{pnl.pnlCost}} / {{pnl.pnlEntries}})
|
|
15
|
+
**Peak Profit:** {{peakProfit.pnlPercentage}}% ({{peakProfit.pnlCost}} / {{peakProfit.pnlEntries}})
|
|
16
|
+
**Max Drawdown:** {{maxDrawdown.pnlPercentage}}% ({{maxDrawdown.pnlCost}} / {{maxDrawdown.pnlEntries}})
|
|
17
|
+
**Signal ID:** `{{signalId}}`
|
|
18
|
+
**Time:** `{{timestamp}}`
|
|
19
|
+
|
|
20
|
+
{{#backtest}}
|
|
21
|
+
_🧪 Backtest_
|
|
22
22
|
{{/backtest}}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
**🎯 Trailing Take**
|
|
2
|
-
|
|
3
|
-
**Symbol:** `{{symbol}}` ({{position}})
|
|
4
|
-
|
|
5
|
-
**Current:** `{{currentPrice}}`
|
|
6
|
-
**Entry:** `{{priceOpen}}`
|
|
7
|
-
**Orig Entry:** `{{originalPriceOpen}}`
|
|
8
|
-
**Old Take Profit:** `{{originalPriceTakeProfit}}`
|
|
9
|
-
**New Take Profit:** `{{priceTakeProfit}}` ({{percentShift}}%)
|
|
10
|
-
**Stop Loss:** `{{priceStopLoss}}`
|
|
11
|
-
**Orig SL:** `{{originalPriceStopLoss}}`
|
|
12
|
-
**DCA Entries:** `{{totalEntries}}`
|
|
13
|
-
**Partials Done:** `{{totalPartials}}`
|
|
14
|
-
**PnL:** {{pnl.pnlPercentage}}% ({{pnl.pnlCost}} / {{pnl.pnlEntries}})
|
|
15
|
-
**Peak Profit:** {{peakProfit.pnlPercentage}}% ({{peakProfit.pnlCost}} / {{peakProfit.pnlEntries}})
|
|
16
|
-
**Max Drawdown:** {{maxDrawdown.pnlPercentage}}% ({{maxDrawdown.pnlCost}} / {{maxDrawdown.pnlEntries}})
|
|
17
|
-
**Signal ID:** `{{signalId}}`
|
|
18
|
-
**Time:** `{{timestamp}}`
|
|
19
|
-
|
|
20
|
-
{{#backtest}}
|
|
21
|
-
_🧪 Backtest_
|
|
1
|
+
**🎯 Trailing Take**
|
|
2
|
+
|
|
3
|
+
**Symbol:** `{{symbol}}` ({{position}})
|
|
4
|
+
|
|
5
|
+
**Current:** `{{currentPrice}}`
|
|
6
|
+
**Entry:** `{{priceOpen}}`
|
|
7
|
+
**Orig Entry:** `{{originalPriceOpen}}`
|
|
8
|
+
**Old Take Profit:** `{{originalPriceTakeProfit}}`
|
|
9
|
+
**New Take Profit:** `{{priceTakeProfit}}` ({{percentShift}}%)
|
|
10
|
+
**Stop Loss:** `{{priceStopLoss}}`
|
|
11
|
+
**Orig SL:** `{{originalPriceStopLoss}}`
|
|
12
|
+
**DCA Entries:** `{{totalEntries}}`
|
|
13
|
+
**Partials Done:** `{{totalPartials}}`
|
|
14
|
+
**PnL:** {{pnl.pnlPercentage}}% ({{pnl.pnlCost}} / {{pnl.pnlEntries}})
|
|
15
|
+
**Peak Profit:** {{peakProfit.pnlPercentage}}% ({{peakProfit.pnlCost}} / {{peakProfit.pnlEntries}})
|
|
16
|
+
**Max Drawdown:** {{maxDrawdown.pnlPercentage}}% ({{maxDrawdown.pnlCost}} / {{maxDrawdown.pnlEntries}})
|
|
17
|
+
**Signal ID:** `{{signalId}}`
|
|
18
|
+
**Time:** `{{timestamp}}`
|
|
19
|
+
|
|
20
|
+
{{#backtest}}
|
|
21
|
+
_🧪 Backtest_
|
|
22
22
|
{{/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,
|
|
3
|
+
import { CandleInterval, TrailingTakeCommit, TrailingStopCommit, BreakevenCommit, PartialProfitCommit, PartialLossCommit, IStrategyTickResultScheduled, IStrategyTickResultCancelled, IStrategyTickResultOpened, IStrategyTickResultClosed, RiskContract, AverageBuyCommit, OrderOpenContract, OrderCloseContract, CancelScheduledCommit, ClosePendingCommit, SignalInfoContract } 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';
|
|
@@ -152,12 +152,12 @@ declare class FrameSchemaService {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
interface IBabel {
|
|
155
|
-
transpile(code: string): string;
|
|
155
|
+
transpile(code: string, filename: string): string;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
declare class BabelService implements IBabel {
|
|
159
159
|
readonly loggerService: LoggerService;
|
|
160
|
-
transpile: (code: string) => any;
|
|
160
|
+
transpile: (code: string, filename: string) => any;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
interface IResolve {
|
|
@@ -342,8 +342,8 @@ interface TelegramConfig {
|
|
|
342
342
|
getClosedMarkdown(event: IStrategyTickResultClosed): Promise<string>;
|
|
343
343
|
getRiskMarkdown(event: RiskContract): Promise<string>;
|
|
344
344
|
getAverageBuyMarkdown(event: AverageBuyCommit): Promise<string>;
|
|
345
|
-
getSignalOpenMarkdown(event:
|
|
346
|
-
getSignalCloseMarkdown(event:
|
|
345
|
+
getSignalOpenMarkdown(event: OrderOpenContract): Promise<string>;
|
|
346
|
+
getSignalCloseMarkdown(event: OrderCloseContract): Promise<string>;
|
|
347
347
|
getCancelScheduledMarkdown(event: CancelScheduledCommit): Promise<string>;
|
|
348
348
|
getClosePendingMarkdown(event: ClosePendingCommit): Promise<string>;
|
|
349
349
|
getSignalInfoMarkdown(event: SignalInfoContract): Promise<string>;
|
|
@@ -365,8 +365,8 @@ declare class TelegramTemplateService implements TelegramConfig {
|
|
|
365
365
|
getClosedMarkdown: (event: IStrategyTickResultClosed) => Promise<string>;
|
|
366
366
|
getRiskMarkdown: (event: RiskContract) => Promise<string>;
|
|
367
367
|
getAverageBuyMarkdown: (event: AverageBuyCommit) => Promise<string>;
|
|
368
|
-
getSignalOpenMarkdown: (event:
|
|
369
|
-
getSignalCloseMarkdown: (event:
|
|
368
|
+
getSignalOpenMarkdown: (event: OrderOpenContract) => Promise<string>;
|
|
369
|
+
getSignalCloseMarkdown: (event: OrderCloseContract) => Promise<string>;
|
|
370
370
|
getCancelScheduledMarkdown: (event: CancelScheduledCommit) => Promise<string>;
|
|
371
371
|
getClosePendingMarkdown: (event: ClosePendingCommit) => Promise<string>;
|
|
372
372
|
getSignalInfoMarkdown: (event: SignalInfoContract) => Promise<string>;
|