backtest-kit 1.8.1 → 1.9.1
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 +1110 -401
- package/build/index.mjs +1111 -403
- package/package.json +1 -1
- package/types.d.ts +308 -42
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -205,6 +205,28 @@ declare function partialProfit(symbol: string, percentToClose: number): Promise<
|
|
|
205
205
|
* ```
|
|
206
206
|
*/
|
|
207
207
|
declare function partialLoss(symbol: string, percentToClose: number): Promise<void>;
|
|
208
|
+
/**
|
|
209
|
+
* Adjusts the trailing stop-loss distance for an active pending signal.
|
|
210
|
+
*
|
|
211
|
+
* Updates the stop-loss distance by a percentage adjustment relative to the original SL distance.
|
|
212
|
+
* Positive percentShift tightens the SL (reduces distance), negative percentShift loosens it.
|
|
213
|
+
*
|
|
214
|
+
* Automatically detects backtest/live mode from execution context.
|
|
215
|
+
*
|
|
216
|
+
* @param symbol - Trading pair symbol
|
|
217
|
+
* @param percentShift - Percentage adjustment to SL distance (-100 to 100)
|
|
218
|
+
* @returns Promise that resolves when trailing SL is updated
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* ```typescript
|
|
222
|
+
* import { trailingStop } from "backtest-kit";
|
|
223
|
+
*
|
|
224
|
+
* // LONG: entry=100, originalSL=90, distance=10
|
|
225
|
+
* // Tighten stop by 50%: newSL = 100 - 10*(1-0.5) = 95
|
|
226
|
+
* await trailingStop("BTCUSDT", -50);
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
declare function trailingStop(symbol: string, percentShift: number): Promise<void>;
|
|
208
230
|
|
|
209
231
|
declare const GLOBAL_CONFIG: {
|
|
210
232
|
/**
|
|
@@ -633,7 +655,7 @@ interface IExchangeParams extends IExchangeSchema {
|
|
|
633
655
|
*/
|
|
634
656
|
interface IExchangeCallbacks {
|
|
635
657
|
/** Called when candle data is fetched */
|
|
636
|
-
onCandleData: (symbol: string, interval: CandleInterval, since: Date, limit: number, data: ICandleData[]) => void
|
|
658
|
+
onCandleData: (symbol: string, interval: CandleInterval, since: Date, limit: number, data: ICandleData[]) => void | Promise<void>;
|
|
637
659
|
}
|
|
638
660
|
/**
|
|
639
661
|
* Exchange schema registered via addExchange().
|
|
@@ -758,7 +780,7 @@ interface IFrameCallbacks {
|
|
|
758
780
|
* @param endDate - End of the backtest period
|
|
759
781
|
* @param interval - Interval used for generation
|
|
760
782
|
*/
|
|
761
|
-
onTimeframe: (timeframe: Date[], startDate: Date, endDate: Date, interval: FrameInterval) => void
|
|
783
|
+
onTimeframe: (timeframe: Date[], startDate: Date, endDate: Date, interval: FrameInterval) => void | Promise<void>;
|
|
762
784
|
}
|
|
763
785
|
/**
|
|
764
786
|
* Frame schema registered via addFrame().
|
|
@@ -869,7 +891,7 @@ interface IRiskCheckArgs {
|
|
|
869
891
|
/** Trading pair symbol (e.g., "BTCUSDT") */
|
|
870
892
|
symbol: string;
|
|
871
893
|
/** Pending signal to apply */
|
|
872
|
-
pendingSignal: ISignalDto;
|
|
894
|
+
pendingSignal: ISignalDto | ISignalRow;
|
|
873
895
|
/** Strategy name requesting to open a position */
|
|
874
896
|
strategyName: StrategyName;
|
|
875
897
|
/** Exchange name */
|
|
@@ -897,17 +919,17 @@ interface IRiskActivePosition {
|
|
|
897
919
|
*/
|
|
898
920
|
interface IRiskCallbacks {
|
|
899
921
|
/** Called when a signal is rejected due to risk limits */
|
|
900
|
-
onRejected: (symbol: string, params: IRiskCheckArgs) => void
|
|
922
|
+
onRejected: (symbol: string, params: IRiskCheckArgs) => void | Promise<void>;
|
|
901
923
|
/** Called when a signal passes risk checks */
|
|
902
|
-
onAllowed: (symbol: string, params: IRiskCheckArgs) => void
|
|
924
|
+
onAllowed: (symbol: string, params: IRiskCheckArgs) => void | Promise<void>;
|
|
903
925
|
}
|
|
904
926
|
/**
|
|
905
927
|
* Payload passed to risk validation functions.
|
|
906
928
|
* Extends IRiskCheckArgs with portfolio state data.
|
|
907
929
|
*/
|
|
908
930
|
interface IRiskValidationPayload extends IRiskCheckArgs {
|
|
909
|
-
/** Pending signal to apply */
|
|
910
|
-
pendingSignal:
|
|
931
|
+
/** Pending signal to apply (IRiskSignalRow is calculated internally so priceOpen always exist) */
|
|
932
|
+
pendingSignal: IRiskSignalRow;
|
|
911
933
|
/** Number of currently active positions across all strategies */
|
|
912
934
|
activePositionCount: number;
|
|
913
935
|
/** List of currently active positions across all strategies */
|
|
@@ -1122,7 +1144,7 @@ interface IPartial {
|
|
|
1122
1144
|
* // Emits events for 20% level only (10% already emitted)
|
|
1123
1145
|
* ```
|
|
1124
1146
|
*/
|
|
1125
|
-
profit(symbol: string, data:
|
|
1147
|
+
profit(symbol: string, data: IPublicSignalRow, currentPrice: number, revenuePercent: number, backtest: boolean, when: Date): Promise<void>;
|
|
1126
1148
|
/**
|
|
1127
1149
|
* Processes loss state and emits events for new loss levels reached.
|
|
1128
1150
|
*
|
|
@@ -1156,7 +1178,7 @@ interface IPartial {
|
|
|
1156
1178
|
* // Emits events for 20% level only (10% already emitted)
|
|
1157
1179
|
* ```
|
|
1158
1180
|
*/
|
|
1159
|
-
loss(symbol: string, data:
|
|
1181
|
+
loss(symbol: string, data: IPublicSignalRow, currentPrice: number, lossPercent: number, backtest: boolean, when: Date): Promise<void>;
|
|
1160
1182
|
/**
|
|
1161
1183
|
* Clears partial profit/loss state when signal closes.
|
|
1162
1184
|
*
|
|
@@ -1178,7 +1200,7 @@ interface IPartial {
|
|
|
1178
1200
|
* // Memoized instance cleared from getPartial cache
|
|
1179
1201
|
* ```
|
|
1180
1202
|
*/
|
|
1181
|
-
clear(symbol: string, data:
|
|
1203
|
+
clear(symbol: string, data: IPublicSignalRow, priceClose: number, backtest: boolean): Promise<void>;
|
|
1182
1204
|
}
|
|
1183
1205
|
|
|
1184
1206
|
/**
|
|
@@ -1247,6 +1269,15 @@ interface ISignalRow extends ISignalDto {
|
|
|
1247
1269
|
/** Price at which this partial was executed */
|
|
1248
1270
|
price: number;
|
|
1249
1271
|
}>;
|
|
1272
|
+
/**
|
|
1273
|
+
* Trailing stop-loss price that overrides priceStopLoss when set.
|
|
1274
|
+
* Updated by trailing() method based on position type and percentage distance.
|
|
1275
|
+
* - For LONG: moves upward as price moves toward TP (never moves down)
|
|
1276
|
+
* - For SHORT: moves downward as price moves toward TP (never moves up)
|
|
1277
|
+
* When _trailingPriceStopLoss is set, it replaces priceStopLoss for TP/SL checks.
|
|
1278
|
+
* Original priceStopLoss is preserved in persistence but ignored during execution.
|
|
1279
|
+
*/
|
|
1280
|
+
_trailingPriceStopLoss?: number;
|
|
1250
1281
|
}
|
|
1251
1282
|
/**
|
|
1252
1283
|
* Scheduled signal row for delayed entry at specific price.
|
|
@@ -1258,6 +1289,38 @@ interface IScheduledSignalRow extends ISignalRow {
|
|
|
1258
1289
|
/** Entry price for the position */
|
|
1259
1290
|
priceOpen: number;
|
|
1260
1291
|
}
|
|
1292
|
+
/**
|
|
1293
|
+
* Public signal row with original stop-loss price.
|
|
1294
|
+
* Extends ISignalRow to include originalPriceStopLoss for external visibility.
|
|
1295
|
+
* Used in public APIs to show user the original SL even if trailing SL is active.
|
|
1296
|
+
* This allows users to see both the current effective SL and the original SL set at signal creation.
|
|
1297
|
+
* The originalPriceStopLoss remains unchanged even if _trailingPriceStopLoss modifies the effective SL.
|
|
1298
|
+
* Useful for transparency in reporting and user interfaces.
|
|
1299
|
+
* Note: originalPriceStopLoss is identical to priceStopLoss at signal creation time.
|
|
1300
|
+
*/
|
|
1301
|
+
interface IPublicSignalRow extends ISignalRow {
|
|
1302
|
+
/**
|
|
1303
|
+
* Original stop-loss price set at signal creation.
|
|
1304
|
+
* Remains unchanged even if trailing stop-loss modifies effective SL.
|
|
1305
|
+
* Used for user visibility of initial SL parameters.
|
|
1306
|
+
*/
|
|
1307
|
+
originalPriceStopLoss: number;
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* Risk signal row for internal risk management.
|
|
1311
|
+
* Extends ISignalDto to include priceOpen and originalPriceStopLoss.
|
|
1312
|
+
* Used in risk validation to access entry price and original SL.
|
|
1313
|
+
*/
|
|
1314
|
+
interface IRiskSignalRow extends ISignalDto {
|
|
1315
|
+
/**
|
|
1316
|
+
* Entry price for the position.
|
|
1317
|
+
*/
|
|
1318
|
+
priceOpen: number;
|
|
1319
|
+
/**
|
|
1320
|
+
* Original stop-loss price set at signal creation.
|
|
1321
|
+
*/
|
|
1322
|
+
originalPriceStopLoss: number;
|
|
1323
|
+
}
|
|
1261
1324
|
/**
|
|
1262
1325
|
* Scheduled signal row with cancellation ID.
|
|
1263
1326
|
* Extends IScheduledSignalRow to include optional cancelId for user-initiated cancellations.
|
|
@@ -1272,27 +1335,27 @@ interface IScheduledSignalCancelRow extends IScheduledSignalRow {
|
|
|
1272
1335
|
*/
|
|
1273
1336
|
interface IStrategyCallbacks {
|
|
1274
1337
|
/** Called on every tick with the result */
|
|
1275
|
-
onTick: (symbol: string, result: IStrategyTickResult, backtest: boolean) => void
|
|
1338
|
+
onTick: (symbol: string, result: IStrategyTickResult, backtest: boolean) => void | Promise<void>;
|
|
1276
1339
|
/** Called when new signal is opened (after validation) */
|
|
1277
|
-
onOpen: (symbol: string, data:
|
|
1340
|
+
onOpen: (symbol: string, data: IPublicSignalRow, currentPrice: number, backtest: boolean) => void | Promise<void>;
|
|
1278
1341
|
/** Called when signal is being monitored (active state) */
|
|
1279
|
-
onActive: (symbol: string, data:
|
|
1342
|
+
onActive: (symbol: string, data: IPublicSignalRow, currentPrice: number, backtest: boolean) => void | Promise<void>;
|
|
1280
1343
|
/** Called when no active signal exists (idle state) */
|
|
1281
|
-
onIdle: (symbol: string, currentPrice: number, backtest: boolean) => void
|
|
1344
|
+
onIdle: (symbol: string, currentPrice: number, backtest: boolean) => void | Promise<void>;
|
|
1282
1345
|
/** Called when signal is closed with final price */
|
|
1283
|
-
onClose: (symbol: string, data:
|
|
1346
|
+
onClose: (symbol: string, data: IPublicSignalRow, priceClose: number, backtest: boolean) => void | Promise<void>;
|
|
1284
1347
|
/** Called when scheduled signal is created (delayed entry) */
|
|
1285
|
-
onSchedule: (symbol: string, data:
|
|
1348
|
+
onSchedule: (symbol: string, data: IPublicSignalRow, currentPrice: number, backtest: boolean) => void | Promise<void>;
|
|
1286
1349
|
/** Called when scheduled signal is cancelled without opening position */
|
|
1287
|
-
onCancel: (symbol: string, data:
|
|
1350
|
+
onCancel: (symbol: string, data: IPublicSignalRow, currentPrice: number, backtest: boolean) => void | Promise<void>;
|
|
1288
1351
|
/** Called when signal is written to persist storage (for testing) */
|
|
1289
|
-
onWrite: (symbol: string, data:
|
|
1352
|
+
onWrite: (symbol: string, data: IPublicSignalRow | null, backtest: boolean) => void;
|
|
1290
1353
|
/** Called when signal is in partial profit state (price moved favorably but not reached TP yet) */
|
|
1291
|
-
onPartialProfit: (symbol: string, data:
|
|
1354
|
+
onPartialProfit: (symbol: string, data: IPublicSignalRow, currentPrice: number, revenuePercent: number, backtest: boolean) => void | Promise<void>;
|
|
1292
1355
|
/** Called when signal is in partial loss state (price moved against position but not hit SL yet) */
|
|
1293
|
-
onPartialLoss: (symbol: string, data:
|
|
1356
|
+
onPartialLoss: (symbol: string, data: IPublicSignalRow, currentPrice: number, lossPercent: number, backtest: boolean) => void | Promise<void>;
|
|
1294
1357
|
/** Called every minute regardless of strategy interval (for custom monitoring like checking if signal should be cancelled) */
|
|
1295
|
-
onPing: (symbol: string, data:
|
|
1358
|
+
onPing: (symbol: string, data: IPublicSignalRow, when: Date, backtest: boolean) => void | Promise<void>;
|
|
1296
1359
|
}
|
|
1297
1360
|
/**
|
|
1298
1361
|
* Strategy schema registered via addStrategy().
|
|
@@ -1369,7 +1432,7 @@ interface IStrategyTickResultScheduled {
|
|
|
1369
1432
|
/** Discriminator for type-safe union */
|
|
1370
1433
|
action: "scheduled";
|
|
1371
1434
|
/** Scheduled signal waiting for activation */
|
|
1372
|
-
signal:
|
|
1435
|
+
signal: IPublicSignalRow;
|
|
1373
1436
|
/** Strategy name for tracking */
|
|
1374
1437
|
strategyName: StrategyName;
|
|
1375
1438
|
/** Exchange name for tracking */
|
|
@@ -1391,7 +1454,7 @@ interface IStrategyTickResultOpened {
|
|
|
1391
1454
|
/** Discriminator for type-safe union */
|
|
1392
1455
|
action: "opened";
|
|
1393
1456
|
/** Newly created and validated signal with generated ID */
|
|
1394
|
-
signal:
|
|
1457
|
+
signal: IPublicSignalRow;
|
|
1395
1458
|
/** Strategy name for tracking */
|
|
1396
1459
|
strategyName: StrategyName;
|
|
1397
1460
|
/** Exchange name for tracking */
|
|
@@ -1413,7 +1476,7 @@ interface IStrategyTickResultActive {
|
|
|
1413
1476
|
/** Discriminator for type-safe union */
|
|
1414
1477
|
action: "active";
|
|
1415
1478
|
/** Currently monitored signal */
|
|
1416
|
-
signal:
|
|
1479
|
+
signal: IPublicSignalRow;
|
|
1417
1480
|
/** Current VWAP price for monitoring */
|
|
1418
1481
|
currentPrice: number;
|
|
1419
1482
|
/** Strategy name for tracking */
|
|
@@ -1439,7 +1502,7 @@ interface IStrategyTickResultClosed {
|
|
|
1439
1502
|
/** Discriminator for type-safe union */
|
|
1440
1503
|
action: "closed";
|
|
1441
1504
|
/** Completed signal with original parameters */
|
|
1442
|
-
signal:
|
|
1505
|
+
signal: IPublicSignalRow;
|
|
1443
1506
|
/** Final VWAP price at close */
|
|
1444
1507
|
currentPrice: number;
|
|
1445
1508
|
/** Why signal closed (time_expired | take_profit | stop_loss) */
|
|
@@ -1467,7 +1530,7 @@ interface IStrategyTickResultCancelled {
|
|
|
1467
1530
|
/** Discriminator for type-safe union */
|
|
1468
1531
|
action: "cancelled";
|
|
1469
1532
|
/** Cancelled scheduled signal */
|
|
1470
|
-
signal:
|
|
1533
|
+
signal: IPublicSignalRow;
|
|
1471
1534
|
/** Final VWAP price at cancellation */
|
|
1472
1535
|
currentPrice: number;
|
|
1473
1536
|
/** Unix timestamp in milliseconds when signal cancelled */
|
|
@@ -1518,7 +1581,7 @@ interface IStrategy {
|
|
|
1518
1581
|
* @param symbol - Trading pair symbol
|
|
1519
1582
|
* @returns Promise resolving to pending signal or null
|
|
1520
1583
|
*/
|
|
1521
|
-
getPendingSignal: (symbol: string) => Promise<
|
|
1584
|
+
getPendingSignal: (symbol: string) => Promise<IPublicSignalRow | null>;
|
|
1522
1585
|
/**
|
|
1523
1586
|
* Retrieves the currently active scheduled signal for the symbol.
|
|
1524
1587
|
* If no scheduled signal exists, returns null.
|
|
@@ -1527,7 +1590,7 @@ interface IStrategy {
|
|
|
1527
1590
|
* @param symbol - Trading pair symbol
|
|
1528
1591
|
* @returns Promise resolving to scheduled signal or null
|
|
1529
1592
|
*/
|
|
1530
|
-
getScheduledSignal: (symbol: string) => Promise<
|
|
1593
|
+
getScheduledSignal: (symbol: string) => Promise<IPublicSignalRow | null>;
|
|
1531
1594
|
/**
|
|
1532
1595
|
* Checks if the strategy has been stopped.
|
|
1533
1596
|
*
|
|
@@ -1659,6 +1722,55 @@ interface IStrategy {
|
|
|
1659
1722
|
* ```
|
|
1660
1723
|
*/
|
|
1661
1724
|
partialLoss: (symbol: string, percentToClose: number, currentPrice: number, backtest: boolean) => Promise<void>;
|
|
1725
|
+
/**
|
|
1726
|
+
* Adjusts trailing stop-loss by shifting distance between entry and original SL.
|
|
1727
|
+
*
|
|
1728
|
+
* Calculates new SL based on percentage shift of the distance (entry - originalSL):
|
|
1729
|
+
* - Negative %: tightens stop (moves SL closer to entry, reduces risk)
|
|
1730
|
+
* - Positive %: loosens stop (moves SL away from entry, allows more drawdown)
|
|
1731
|
+
*
|
|
1732
|
+
* For LONG position (entry=100, originalSL=90, distance=10):
|
|
1733
|
+
* - percentShift = -50: newSL = 100 - 10*(1-0.5) = 95 (tighter, closer to entry)
|
|
1734
|
+
* - percentShift = +20: newSL = 100 - 10*(1+0.2) = 88 (looser, away from entry)
|
|
1735
|
+
*
|
|
1736
|
+
* For SHORT position (entry=100, originalSL=110, distance=10):
|
|
1737
|
+
* - percentShift = -50: newSL = 100 + 10*(1-0.5) = 105 (tighter, closer to entry)
|
|
1738
|
+
* - percentShift = +20: newSL = 100 + 10*(1+0.2) = 112 (looser, away from entry)
|
|
1739
|
+
*
|
|
1740
|
+
* Trailing behavior:
|
|
1741
|
+
* - Only updates if new SL is BETTER (protects more profit)
|
|
1742
|
+
* - For LONG: only accepts higher SL (never moves down)
|
|
1743
|
+
* - For SHORT: only accepts lower SL (never moves up)
|
|
1744
|
+
* - Validates that SL never crosses entry price
|
|
1745
|
+
* - Stores in _trailingPriceStopLoss, original priceStopLoss preserved
|
|
1746
|
+
*
|
|
1747
|
+
* Validations:
|
|
1748
|
+
* - Throws if no pending signal exists
|
|
1749
|
+
* - Throws if percentShift< -100 or > 100
|
|
1750
|
+
* - Throws if percentShift=== 0
|
|
1751
|
+
* - Skips if new SL would cross entry price
|
|
1752
|
+
*
|
|
1753
|
+
* Use case: User-controlled trailing stop triggered from onPartialProfit callback.
|
|
1754
|
+
*
|
|
1755
|
+
* @param symbol - Trading pair symbol (e.g., "BTCUSDT")
|
|
1756
|
+
* @param percentShift- Percentage shift of SL distance [-100, 100], excluding 0
|
|
1757
|
+
* @param backtest - Whether running in backtest mode
|
|
1758
|
+
* @returns Promise that resolves when trailing SL is updated
|
|
1759
|
+
*
|
|
1760
|
+
* @example
|
|
1761
|
+
* ```typescript
|
|
1762
|
+
* callbacks: {
|
|
1763
|
+
* onPartialProfit: async (symbol, signal, currentPrice, percentTp, backtest) => {
|
|
1764
|
+
* if (percentTp >= 50) {
|
|
1765
|
+
* // LONG: entry=100, originalSL=90, distance=10
|
|
1766
|
+
* // Tighten stop by 50%: newSL = 100 - 10*(1-0.5) = 95
|
|
1767
|
+
* await strategy.trailingStop(symbol, -50, backtest);
|
|
1768
|
+
* }
|
|
1769
|
+
* }
|
|
1770
|
+
* }
|
|
1771
|
+
* ```
|
|
1772
|
+
*/
|
|
1773
|
+
trailingStop: (symbol: string, percentShift: number, backtest: boolean) => Promise<void>;
|
|
1662
1774
|
}
|
|
1663
1775
|
/**
|
|
1664
1776
|
* Unique strategy identifier.
|
|
@@ -1783,13 +1895,13 @@ interface IWalkerSchema {
|
|
|
1783
1895
|
*/
|
|
1784
1896
|
interface IWalkerCallbacks {
|
|
1785
1897
|
/** Called when starting to test a specific strategy */
|
|
1786
|
-
onStrategyStart: (strategyName: StrategyName, symbol: string) => void
|
|
1898
|
+
onStrategyStart: (strategyName: StrategyName, symbol: string) => void | Promise<void>;
|
|
1787
1899
|
/** Called when a strategy backtest completes */
|
|
1788
|
-
onStrategyComplete: (strategyName: StrategyName, symbol: string, stats: BacktestStatisticsModel, metric: number | null) => void
|
|
1900
|
+
onStrategyComplete: (strategyName: StrategyName, symbol: string, stats: BacktestStatisticsModel, metric: number | null) => void | Promise<void>;
|
|
1789
1901
|
/** Called when a strategy backtest fails with an error */
|
|
1790
|
-
onStrategyError: (strategyName: StrategyName, symbol: string, error: Error | unknown) => void
|
|
1902
|
+
onStrategyError: (strategyName: StrategyName, symbol: string, error: Error | unknown) => void | Promise<void>;
|
|
1791
1903
|
/** Called when all strategies have been tested */
|
|
1792
|
-
onComplete: (results: IWalkerResults) => void
|
|
1904
|
+
onComplete: (results: IWalkerResults) => void | Promise<void>;
|
|
1793
1905
|
}
|
|
1794
1906
|
/**
|
|
1795
1907
|
* Result for a single strategy in the comparison.
|
|
@@ -1924,7 +2036,7 @@ interface ISizingCallbacks {
|
|
|
1924
2036
|
* @param quantity - Calculated position size
|
|
1925
2037
|
* @param params - Parameters used for calculation
|
|
1926
2038
|
*/
|
|
1927
|
-
onCalculate: (quantity: number, params: ISizingCalculateParams) => void
|
|
2039
|
+
onCalculate: (quantity: number, params: ISizingCalculateParams) => void | Promise<void>;
|
|
1928
2040
|
}
|
|
1929
2041
|
/**
|
|
1930
2042
|
* Base sizing schema with common fields.
|
|
@@ -5948,6 +6060,11 @@ declare class BacktestMarkdownService {
|
|
|
5948
6060
|
* ```
|
|
5949
6061
|
*/
|
|
5950
6062
|
protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
|
|
6063
|
+
/**
|
|
6064
|
+
* Function to unsubscribe from backtest signal events.
|
|
6065
|
+
* Assigned during init().
|
|
6066
|
+
*/
|
|
6067
|
+
unsubscribe: Function;
|
|
5951
6068
|
}
|
|
5952
6069
|
|
|
5953
6070
|
/**
|
|
@@ -6172,6 +6289,33 @@ declare class BacktestUtils {
|
|
|
6172
6289
|
exchangeName: ExchangeName;
|
|
6173
6290
|
frameName: FrameName;
|
|
6174
6291
|
}) => Promise<void>;
|
|
6292
|
+
/**
|
|
6293
|
+
* Adjusts the trailing stop-loss distance for an active pending signal.
|
|
6294
|
+
*
|
|
6295
|
+
* Updates the stop-loss distance by a percentage adjustment relative to the original SL distance.
|
|
6296
|
+
* Positive percentShift tightens the SL (reduces distance), negative percentShift loosens it.
|
|
6297
|
+
*
|
|
6298
|
+
* @param symbol - Trading pair symbol
|
|
6299
|
+
* @param percentShift - Percentage adjustment to SL distance (-100 to 100)
|
|
6300
|
+
* @param context - Execution context with strategyName, exchangeName, and frameName
|
|
6301
|
+
* @returns Promise that resolves when trailing SL is updated
|
|
6302
|
+
*
|
|
6303
|
+
* @example
|
|
6304
|
+
* ```typescript
|
|
6305
|
+
* // LONG: entry=100, originalSL=90, distance=10
|
|
6306
|
+
* // Tighten stop by 50%: newSL = 100 - 10*(1-0.5) = 95
|
|
6307
|
+
* await Backtest.trailingStop("BTCUSDT", -50, {
|
|
6308
|
+
* exchangeName: "binance",
|
|
6309
|
+
* frameName: "frame1",
|
|
6310
|
+
* strategyName: "my-strategy"
|
|
6311
|
+
* });
|
|
6312
|
+
* ```
|
|
6313
|
+
*/
|
|
6314
|
+
trailingStop: (symbol: string, percentShift: number, context: {
|
|
6315
|
+
strategyName: StrategyName;
|
|
6316
|
+
exchangeName: ExchangeName;
|
|
6317
|
+
frameName: FrameName;
|
|
6318
|
+
}) => Promise<void>;
|
|
6175
6319
|
/**
|
|
6176
6320
|
* Gets statistical data from all closed signals for a symbol-strategy pair.
|
|
6177
6321
|
*
|
|
@@ -6485,6 +6629,11 @@ declare class LiveMarkdownService {
|
|
|
6485
6629
|
* ```
|
|
6486
6630
|
*/
|
|
6487
6631
|
protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
|
|
6632
|
+
/**
|
|
6633
|
+
* Function to unsubscribe from backtest signal events.
|
|
6634
|
+
* Assigned during init().
|
|
6635
|
+
*/
|
|
6636
|
+
unsubscribe: Function;
|
|
6488
6637
|
}
|
|
6489
6638
|
|
|
6490
6639
|
/**
|
|
@@ -6707,6 +6856,31 @@ declare class LiveUtils {
|
|
|
6707
6856
|
strategyName: StrategyName;
|
|
6708
6857
|
exchangeName: ExchangeName;
|
|
6709
6858
|
}) => Promise<void>;
|
|
6859
|
+
/**
|
|
6860
|
+
* Adjusts the trailing stop-loss distance for an active pending signal.
|
|
6861
|
+
*
|
|
6862
|
+
* Updates the stop-loss distance by a percentage adjustment relative to the original SL distance.
|
|
6863
|
+
* Positive percentShift tightens the SL (reduces distance), negative percentShift loosens it.
|
|
6864
|
+
*
|
|
6865
|
+
* @param symbol - Trading pair symbol
|
|
6866
|
+
* @param percentShift - Percentage adjustment to SL distance (-100 to 100)
|
|
6867
|
+
* @param context - Execution context with strategyName and exchangeName
|
|
6868
|
+
* @returns Promise that resolves when trailing SL is updated
|
|
6869
|
+
*
|
|
6870
|
+
* @example
|
|
6871
|
+
* ```typescript
|
|
6872
|
+
* // LONG: entry=100, originalSL=90, distance=10
|
|
6873
|
+
* // Tighten stop by 50%: newSL = 100 - 10*(1-0.5) = 95
|
|
6874
|
+
* await Live.trailingStop("BTCUSDT", -50, {
|
|
6875
|
+
* exchangeName: "binance",
|
|
6876
|
+
* strategyName: "my-strategy"
|
|
6877
|
+
* });
|
|
6878
|
+
* ```
|
|
6879
|
+
*/
|
|
6880
|
+
trailingStop: (symbol: string, percentShift: number, context: {
|
|
6881
|
+
strategyName: StrategyName;
|
|
6882
|
+
exchangeName: ExchangeName;
|
|
6883
|
+
}) => Promise<void>;
|
|
6710
6884
|
/**
|
|
6711
6885
|
* Gets statistical data from all live trading events for a symbol-strategy pair.
|
|
6712
6886
|
*
|
|
@@ -6997,6 +7171,11 @@ declare class ScheduleMarkdownService {
|
|
|
6997
7171
|
* ```
|
|
6998
7172
|
*/
|
|
6999
7173
|
protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
|
|
7174
|
+
/**
|
|
7175
|
+
* Function to unsubscribe from partial profit/loss events.
|
|
7176
|
+
* Assigned during init().
|
|
7177
|
+
*/
|
|
7178
|
+
unsubscribe: Function;
|
|
7000
7179
|
}
|
|
7001
7180
|
|
|
7002
7181
|
/**
|
|
@@ -7247,6 +7426,11 @@ declare class PerformanceMarkdownService {
|
|
|
7247
7426
|
* Uses singleshot to ensure initialization happens only once.
|
|
7248
7427
|
*/
|
|
7249
7428
|
protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
|
|
7429
|
+
/**
|
|
7430
|
+
* Function to unsubscribe from partial profit/loss events.
|
|
7431
|
+
* Assigned during init().
|
|
7432
|
+
*/
|
|
7433
|
+
unsubscribe: Function;
|
|
7250
7434
|
}
|
|
7251
7435
|
|
|
7252
7436
|
/**
|
|
@@ -7574,6 +7758,11 @@ declare class WalkerMarkdownService {
|
|
|
7574
7758
|
* ```
|
|
7575
7759
|
*/
|
|
7576
7760
|
protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
|
|
7761
|
+
/**
|
|
7762
|
+
* Function to unsubscribe from partial profit/loss events.
|
|
7763
|
+
* Assigned during init().
|
|
7764
|
+
*/
|
|
7765
|
+
unsubscribe: Function;
|
|
7577
7766
|
}
|
|
7578
7767
|
|
|
7579
7768
|
/**
|
|
@@ -7936,6 +8125,11 @@ declare class HeatMarkdownService {
|
|
|
7936
8125
|
* ```
|
|
7937
8126
|
*/
|
|
7938
8127
|
protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
|
|
8128
|
+
/**
|
|
8129
|
+
* Function to unsubscribe from backtest signal events.
|
|
8130
|
+
* Assigned during init().
|
|
8131
|
+
*/
|
|
8132
|
+
unsubscribe: Function;
|
|
7939
8133
|
}
|
|
7940
8134
|
|
|
7941
8135
|
/**
|
|
@@ -8463,6 +8657,11 @@ declare class PartialMarkdownService {
|
|
|
8463
8657
|
* ```
|
|
8464
8658
|
*/
|
|
8465
8659
|
protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
|
|
8660
|
+
/**
|
|
8661
|
+
* Function to unsubscribe from partial profit/loss events.
|
|
8662
|
+
* Assigned during init().
|
|
8663
|
+
*/
|
|
8664
|
+
unsubscribe: Function;
|
|
8466
8665
|
}
|
|
8467
8666
|
|
|
8468
8667
|
/**
|
|
@@ -8882,6 +9081,11 @@ declare class RiskMarkdownService {
|
|
|
8882
9081
|
* ```
|
|
8883
9082
|
*/
|
|
8884
9083
|
protected init: (() => Promise<void>) & functools_kit.ISingleshotClearable;
|
|
9084
|
+
/**
|
|
9085
|
+
* Function to unsubscribe from partial profit/loss events.
|
|
9086
|
+
* Assigned during init().
|
|
9087
|
+
*/
|
|
9088
|
+
unsubscribe: Function;
|
|
8885
9089
|
}
|
|
8886
9090
|
|
|
8887
9091
|
/**
|
|
@@ -9157,7 +9361,7 @@ declare const Exchange: ExchangeUtils;
|
|
|
9157
9361
|
* Generic function type that accepts any arguments and returns any value.
|
|
9158
9362
|
* Used as a constraint for cached functions.
|
|
9159
9363
|
*/
|
|
9160
|
-
type Function = (...args: any[]) => any;
|
|
9364
|
+
type Function$1 = (...args: any[]) => any;
|
|
9161
9365
|
/**
|
|
9162
9366
|
* Utility class for function caching with timeframe-based invalidation.
|
|
9163
9367
|
*
|
|
@@ -9202,7 +9406,7 @@ declare class CacheUtils {
|
|
|
9202
9406
|
* const result2 = cachedCalculate("BTCUSDT", 14); // Cached (same 15m interval)
|
|
9203
9407
|
* ```
|
|
9204
9408
|
*/
|
|
9205
|
-
fn: <T extends Function>(run: T, context: {
|
|
9409
|
+
fn: <T extends Function$1>(run: T, context: {
|
|
9206
9410
|
interval: CandleInterval;
|
|
9207
9411
|
}) => T;
|
|
9208
9412
|
/**
|
|
@@ -9234,7 +9438,7 @@ declare class CacheUtils {
|
|
|
9234
9438
|
* Cache.flush();
|
|
9235
9439
|
* ```
|
|
9236
9440
|
*/
|
|
9237
|
-
flush: <T extends Function>(run?: T) => void;
|
|
9441
|
+
flush: <T extends Function$1>(run?: T) => void;
|
|
9238
9442
|
/**
|
|
9239
9443
|
* Clear cached value for current execution context of a specific function.
|
|
9240
9444
|
*
|
|
@@ -9264,7 +9468,7 @@ declare class CacheUtils {
|
|
|
9264
9468
|
* // Other contexts (different strategies/exchanges) remain cached
|
|
9265
9469
|
* ```
|
|
9266
9470
|
*/
|
|
9267
|
-
clear: <T extends Function>(run: T) => void;
|
|
9471
|
+
clear: <T extends Function$1>(run: T) => void;
|
|
9268
9472
|
}
|
|
9269
9473
|
/**
|
|
9270
9474
|
* Singleton instance of CacheUtils for convenient function caching.
|
|
@@ -10065,7 +10269,7 @@ declare class PartialConnectionService implements IPartial {
|
|
|
10065
10269
|
* @param when - Event timestamp (current time for live, candle time for backtest)
|
|
10066
10270
|
* @returns Promise that resolves when profit processing is complete
|
|
10067
10271
|
*/
|
|
10068
|
-
profit: (symbol: string, data:
|
|
10272
|
+
profit: (symbol: string, data: IPublicSignalRow, currentPrice: number, revenuePercent: number, backtest: boolean, when: Date) => Promise<void>;
|
|
10069
10273
|
/**
|
|
10070
10274
|
* Processes loss state and emits events for newly reached loss levels.
|
|
10071
10275
|
*
|
|
@@ -10080,7 +10284,7 @@ declare class PartialConnectionService implements IPartial {
|
|
|
10080
10284
|
* @param when - Event timestamp (current time for live, candle time for backtest)
|
|
10081
10285
|
* @returns Promise that resolves when loss processing is complete
|
|
10082
10286
|
*/
|
|
10083
|
-
loss: (symbol: string, data:
|
|
10287
|
+
loss: (symbol: string, data: IPublicSignalRow, currentPrice: number, lossPercent: number, backtest: boolean, when: Date) => Promise<void>;
|
|
10084
10288
|
/**
|
|
10085
10289
|
* Clears partial profit/loss state when signal closes.
|
|
10086
10290
|
*
|
|
@@ -10349,6 +10553,37 @@ declare class StrategyConnectionService implements TStrategy$1 {
|
|
|
10349
10553
|
exchangeName: ExchangeName;
|
|
10350
10554
|
frameName: FrameName;
|
|
10351
10555
|
}) => Promise<void>;
|
|
10556
|
+
/**
|
|
10557
|
+
* Adjusts the trailing stop-loss distance for an active pending signal.
|
|
10558
|
+
*
|
|
10559
|
+
* Updates the stop-loss distance by a percentage adjustment relative to the original SL distance.
|
|
10560
|
+
* Positive percentShift tightens the SL (reduces distance), negative percentShift loosens it.
|
|
10561
|
+
*
|
|
10562
|
+
* Delegates to ClientStrategy.trailingStop() with current execution context.
|
|
10563
|
+
*
|
|
10564
|
+
* @param backtest - Whether running in backtest mode
|
|
10565
|
+
* @param symbol - Trading pair symbol
|
|
10566
|
+
* @param percentShift - Percentage adjustment to SL distance (-100 to 100)
|
|
10567
|
+
* @param context - Execution context with strategyName, exchangeName, frameName
|
|
10568
|
+
* @returns Promise that resolves when trailing SL is updated
|
|
10569
|
+
*
|
|
10570
|
+
* @example
|
|
10571
|
+
* ```typescript
|
|
10572
|
+
* // LONG: entry=100, originalSL=90, distance=10
|
|
10573
|
+
* // Tighten stop by 50%: newSL = 100 - 10*(1-0.5) = 95
|
|
10574
|
+
* await strategyConnectionService.trailingStop(
|
|
10575
|
+
* false,
|
|
10576
|
+
* "BTCUSDT",
|
|
10577
|
+
* -50,
|
|
10578
|
+
* { strategyName: "my-strategy", exchangeName: "binance", frameName: "" }
|
|
10579
|
+
* );
|
|
10580
|
+
* ```
|
|
10581
|
+
*/
|
|
10582
|
+
trailingStop: (backtest: boolean, symbol: string, percentShift: number, context: {
|
|
10583
|
+
strategyName: StrategyName;
|
|
10584
|
+
exchangeName: ExchangeName;
|
|
10585
|
+
frameName: FrameName;
|
|
10586
|
+
}) => Promise<void>;
|
|
10352
10587
|
}
|
|
10353
10588
|
|
|
10354
10589
|
/**
|
|
@@ -10821,6 +11056,37 @@ declare class StrategyCoreService implements TStrategy {
|
|
|
10821
11056
|
exchangeName: ExchangeName;
|
|
10822
11057
|
frameName: FrameName;
|
|
10823
11058
|
}) => Promise<void>;
|
|
11059
|
+
/**
|
|
11060
|
+
* Adjusts the trailing stop-loss distance for an active pending signal.
|
|
11061
|
+
*
|
|
11062
|
+
* Validates strategy existence and delegates to connection service
|
|
11063
|
+
* to update the stop-loss distance by a percentage adjustment.
|
|
11064
|
+
*
|
|
11065
|
+
* Does not require execution context as this is a direct state mutation.
|
|
11066
|
+
*
|
|
11067
|
+
* @param backtest - Whether running in backtest mode
|
|
11068
|
+
* @param symbol - Trading pair symbol
|
|
11069
|
+
* @param percentShift - Percentage adjustment to SL distance (-100 to 100)
|
|
11070
|
+
* @param context - Execution context with strategyName, exchangeName, frameName
|
|
11071
|
+
* @returns Promise that resolves when trailing SL is updated
|
|
11072
|
+
*
|
|
11073
|
+
* @example
|
|
11074
|
+
* ```typescript
|
|
11075
|
+
* // LONG: entry=100, originalSL=90, distance=10
|
|
11076
|
+
* // Tighten stop by 50%: newSL = 100 - 10*(1-0.5) = 95
|
|
11077
|
+
* await strategyCoreService.trailingStop(
|
|
11078
|
+
* false,
|
|
11079
|
+
* "BTCUSDT",
|
|
11080
|
+
* -50,
|
|
11081
|
+
* { strategyName: "my-strategy", exchangeName: "binance", frameName: "" }
|
|
11082
|
+
* );
|
|
11083
|
+
* ```
|
|
11084
|
+
*/
|
|
11085
|
+
trailingStop: (backtest: boolean, symbol: string, percentShift: number, context: {
|
|
11086
|
+
strategyName: StrategyName;
|
|
11087
|
+
exchangeName: ExchangeName;
|
|
11088
|
+
frameName: FrameName;
|
|
11089
|
+
}) => Promise<void>;
|
|
10824
11090
|
}
|
|
10825
11091
|
|
|
10826
11092
|
/**
|
|
@@ -12409,7 +12675,7 @@ declare class PartialGlobalService implements TPartial {
|
|
|
12409
12675
|
* @param when - Event timestamp (current time for live, candle time for backtest)
|
|
12410
12676
|
* @returns Promise that resolves when profit processing is complete
|
|
12411
12677
|
*/
|
|
12412
|
-
profit: (symbol: string, data:
|
|
12678
|
+
profit: (symbol: string, data: IPublicSignalRow, currentPrice: number, revenuePercent: number, backtest: boolean, when: Date) => Promise<void>;
|
|
12413
12679
|
/**
|
|
12414
12680
|
* Processes loss state and emits events for newly reached loss levels.
|
|
12415
12681
|
*
|
|
@@ -12423,7 +12689,7 @@ declare class PartialGlobalService implements TPartial {
|
|
|
12423
12689
|
* @param when - Event timestamp (current time for live, candle time for backtest)
|
|
12424
12690
|
* @returns Promise that resolves when loss processing is complete
|
|
12425
12691
|
*/
|
|
12426
|
-
loss: (symbol: string, data:
|
|
12692
|
+
loss: (symbol: string, data: IPublicSignalRow, currentPrice: number, lossPercent: number, backtest: boolean, when: Date) => Promise<void>;
|
|
12427
12693
|
/**
|
|
12428
12694
|
* Clears partial profit/loss state when signal closes.
|
|
12429
12695
|
*
|
|
@@ -12642,4 +12908,4 @@ declare const backtest: {
|
|
|
12642
12908
|
loggerService: LoggerService;
|
|
12643
12909
|
};
|
|
12644
12910
|
|
|
12645
|
-
export { Backtest, type BacktestDoneNotification, type BacktestStatisticsModel, type BootstrapNotification, Cache, type CandleInterval, type ColumnConfig, type ColumnModel, Constant, type CriticalErrorNotification, type DoneContract, type EntityId, Exchange, ExecutionContextService, type FrameInterval, type GlobalConfig, Heat, type HeatmapStatisticsModel, type ICandleData, type IExchangeSchema, type IFrameSchema, type IHeatmapRow, type IOptimizerCallbacks, type IOptimizerData, type IOptimizerFetchArgs, type IOptimizerFilterArgs, type IOptimizerRange, type IOptimizerSchema, type IOptimizerSource, type IOptimizerStrategy, type IOptimizerTemplate, type IPersistBase, type IPositionSizeATRParams, type IPositionSizeFixedPercentageParams, type IPositionSizeKellyParams, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISignalDto, type ISignalRow, type ISizingCalculateParams, type ISizingCalculateParamsATR, type ISizingCalculateParamsFixedPercentage, type ISizingCalculateParamsKelly, type ISizingSchema, type ISizingSchemaATR, type ISizingSchemaFixedPercentage, type ISizingSchemaKelly, type IStrategyPnL, type IStrategyResult, type IStrategySchema, type IStrategyTickResult, type IStrategyTickResultActive, type IStrategyTickResultCancelled, type IStrategyTickResultClosed, type IStrategyTickResultIdle, type IStrategyTickResultOpened, type IStrategyTickResultScheduled, type IWalkerResults, type IWalkerSchema, type IWalkerStrategyResult, type InfoErrorNotification, Live, type LiveDoneNotification, type LiveStatisticsModel, type MessageModel, type MessageRole, MethodContextService, type MetricStats, Notification, type NotificationModel, Optimizer, Partial$1 as Partial, type PartialData, type PartialEvent, type PartialLossContract, type PartialLossNotification, type PartialProfitContract, type PartialProfitNotification, type PartialStatisticsModel, Performance, type PerformanceContract, type PerformanceMetricType, type PerformanceStatisticsModel, PersistBase, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, type PingContract, PositionSize, type ProgressBacktestContract, type ProgressBacktestNotification, type ProgressOptimizerContract, type ProgressWalkerContract, Risk, type RiskContract, type RiskData, type RiskEvent, type RiskRejectionNotification, type RiskStatisticsModel, Schedule, type ScheduleData, type ScheduleStatisticsModel, type ScheduledEvent, type SignalCancelledNotification, type SignalClosedNotification, type SignalData, type SignalInterval, type SignalOpenedNotification, type SignalScheduledNotification, type TPersistBase, type TPersistBaseCtor, type TickEvent, type ValidationErrorNotification, Walker, type WalkerCompleteContract, type WalkerContract, type WalkerMetric, type SignalData$1 as WalkerSignalData, type WalkerStatisticsModel, addExchange, addFrame, addOptimizer, addRisk, addSizing, addStrategy, addWalker, cancel, dumpSignal, emitters, formatPrice, formatQuantity, getAveragePrice, getCandles, getColumns, getConfig, getDate, getDefaultColumns, getDefaultConfig, getMode, hasTradeContext, backtest as lib, listExchanges, listFrames, listOptimizers, listRisks, listSizings, listStrategies, listWalkers, listenBacktestProgress, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenOptimizerProgress, listenPartialLoss, listenPartialLossOnce, listenPartialProfit, listenPartialProfitOnce, listenPerformance, listenPing, listenPingOnce, listenRisk, listenRiskOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, partialLoss, partialProfit, setColumns, setConfig, setLogger, stop, validate };
|
|
12911
|
+
export { Backtest, type BacktestDoneNotification, type BacktestStatisticsModel, type BootstrapNotification, Cache, type CandleInterval, type ColumnConfig, type ColumnModel, Constant, type CriticalErrorNotification, type DoneContract, type EntityId, Exchange, ExecutionContextService, type FrameInterval, type GlobalConfig, Heat, type HeatmapStatisticsModel, type ICandleData, type IExchangeSchema, type IFrameSchema, type IHeatmapRow, type IOptimizerCallbacks, type IOptimizerData, type IOptimizerFetchArgs, type IOptimizerFilterArgs, type IOptimizerRange, type IOptimizerSchema, type IOptimizerSource, type IOptimizerStrategy, type IOptimizerTemplate, type IPersistBase, type IPositionSizeATRParams, type IPositionSizeFixedPercentageParams, type IPositionSizeKellyParams, type IPublicSignalRow, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISignalDto, type ISignalRow, type ISizingCalculateParams, type ISizingCalculateParamsATR, type ISizingCalculateParamsFixedPercentage, type ISizingCalculateParamsKelly, type ISizingSchema, type ISizingSchemaATR, type ISizingSchemaFixedPercentage, type ISizingSchemaKelly, type IStrategyPnL, type IStrategyResult, type IStrategySchema, type IStrategyTickResult, type IStrategyTickResultActive, type IStrategyTickResultCancelled, type IStrategyTickResultClosed, type IStrategyTickResultIdle, type IStrategyTickResultOpened, type IStrategyTickResultScheduled, type IWalkerResults, type IWalkerSchema, type IWalkerStrategyResult, type InfoErrorNotification, Live, type LiveDoneNotification, type LiveStatisticsModel, type MessageModel, type MessageRole, MethodContextService, type MetricStats, Notification, type NotificationModel, Optimizer, Partial$1 as Partial, type PartialData, type PartialEvent, type PartialLossContract, type PartialLossNotification, type PartialProfitContract, type PartialProfitNotification, type PartialStatisticsModel, Performance, type PerformanceContract, type PerformanceMetricType, type PerformanceStatisticsModel, PersistBase, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, type PingContract, PositionSize, type ProgressBacktestContract, type ProgressBacktestNotification, type ProgressOptimizerContract, type ProgressWalkerContract, Risk, type RiskContract, type RiskData, type RiskEvent, type RiskRejectionNotification, type RiskStatisticsModel, Schedule, type ScheduleData, type ScheduleStatisticsModel, type ScheduledEvent, type SignalCancelledNotification, type SignalClosedNotification, type SignalData, type SignalInterval, type SignalOpenedNotification, type SignalScheduledNotification, type TPersistBase, type TPersistBaseCtor, type TickEvent, type ValidationErrorNotification, Walker, type WalkerCompleteContract, type WalkerContract, type WalkerMetric, type SignalData$1 as WalkerSignalData, type WalkerStatisticsModel, addExchange, addFrame, addOptimizer, addRisk, addSizing, addStrategy, addWalker, cancel, dumpSignal, emitters, formatPrice, formatQuantity, getAveragePrice, getCandles, getColumns, getConfig, getDate, getDefaultColumns, getDefaultConfig, getMode, hasTradeContext, backtest as lib, listExchanges, listFrames, listOptimizers, listRisks, listSizings, listStrategies, listWalkers, listenBacktestProgress, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenOptimizerProgress, listenPartialLoss, listenPartialLossOnce, listenPartialProfit, listenPartialProfitOnce, listenPerformance, listenPing, listenPingOnce, listenRisk, listenRiskOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, partialLoss, partialProfit, setColumns, setConfig, setLogger, stop, trailingStop, validate };
|