backtest-kit 1.4.13 → 1.4.14
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 +23 -16
- package/build/index.mjs +23 -16
- package/package.json +1 -1
- package/types.d.ts +16 -12
package/build/index.cjs
CHANGED
|
@@ -13098,24 +13098,26 @@ class BacktestUtils {
|
|
|
13098
13098
|
/**
|
|
13099
13099
|
* Saves strategy report to disk.
|
|
13100
13100
|
*
|
|
13101
|
+
* @param symbol - Trading pair symbol
|
|
13101
13102
|
* @param strategyName - Strategy name to save report for
|
|
13102
13103
|
* @param path - Optional directory path to save report (default: "./dump/backtest")
|
|
13103
13104
|
*
|
|
13104
13105
|
* @example
|
|
13105
13106
|
* ```typescript
|
|
13106
13107
|
* // Save to default path: ./dump/backtest/my-strategy.md
|
|
13107
|
-
* await Backtest.dump("my-strategy");
|
|
13108
|
+
* await Backtest.dump("BTCUSDT", "my-strategy");
|
|
13108
13109
|
*
|
|
13109
13110
|
* // Save to custom path: ./custom/path/my-strategy.md
|
|
13110
|
-
* await Backtest.dump("my-strategy", "./custom/path");
|
|
13111
|
+
* await Backtest.dump("BTCUSDT", "my-strategy", "./custom/path");
|
|
13111
13112
|
* ```
|
|
13112
13113
|
*/
|
|
13113
|
-
this.dump = async (strategyName, path) => {
|
|
13114
|
+
this.dump = async (symbol, strategyName, path) => {
|
|
13114
13115
|
backtest$1.loggerService.info(BACKTEST_METHOD_NAME_DUMP, {
|
|
13116
|
+
symbol,
|
|
13115
13117
|
strategyName,
|
|
13116
13118
|
path,
|
|
13117
13119
|
});
|
|
13118
|
-
await backtest$1.backtestMarkdownService.dump(strategyName, path);
|
|
13120
|
+
await backtest$1.backtestMarkdownService.dump(symbol, strategyName, path);
|
|
13119
13121
|
};
|
|
13120
13122
|
}
|
|
13121
13123
|
}
|
|
@@ -13311,24 +13313,26 @@ class LiveUtils {
|
|
|
13311
13313
|
/**
|
|
13312
13314
|
* Saves strategy report to disk.
|
|
13313
13315
|
*
|
|
13316
|
+
* @param symbol - Trading pair symbol
|
|
13314
13317
|
* @param strategyName - Strategy name to save report for
|
|
13315
13318
|
* @param path - Optional directory path to save report (default: "./dump/live")
|
|
13316
13319
|
*
|
|
13317
13320
|
* @example
|
|
13318
13321
|
* ```typescript
|
|
13319
13322
|
* // Save to default path: ./dump/live/my-strategy.md
|
|
13320
|
-
* await Live.dump("my-strategy");
|
|
13323
|
+
* await Live.dump("BTCUSDT", "my-strategy");
|
|
13321
13324
|
*
|
|
13322
13325
|
* // Save to custom path: ./custom/path/my-strategy.md
|
|
13323
|
-
* await Live.dump("my-strategy", "./custom/path");
|
|
13326
|
+
* await Live.dump("BTCUSDT", "my-strategy", "./custom/path");
|
|
13324
13327
|
* ```
|
|
13325
13328
|
*/
|
|
13326
|
-
this.dump = async (strategyName, path) => {
|
|
13329
|
+
this.dump = async (symbol, strategyName, path) => {
|
|
13327
13330
|
backtest$1.loggerService.info(LIVE_METHOD_NAME_DUMP, {
|
|
13331
|
+
symbol,
|
|
13328
13332
|
strategyName,
|
|
13329
13333
|
path,
|
|
13330
13334
|
});
|
|
13331
|
-
await backtest$1.liveMarkdownService.dump(strategyName, path);
|
|
13335
|
+
await backtest$1.liveMarkdownService.dump(symbol, strategyName, path);
|
|
13332
13336
|
};
|
|
13333
13337
|
}
|
|
13334
13338
|
}
|
|
@@ -13422,24 +13426,26 @@ class ScheduleUtils {
|
|
|
13422
13426
|
/**
|
|
13423
13427
|
* Saves strategy report to disk.
|
|
13424
13428
|
*
|
|
13429
|
+
* @param symbol - Trading pair symbol
|
|
13425
13430
|
* @param strategyName - Strategy name to save report for
|
|
13426
13431
|
* @param path - Optional directory path to save report (default: "./dump/schedule")
|
|
13427
13432
|
*
|
|
13428
13433
|
* @example
|
|
13429
13434
|
* ```typescript
|
|
13430
13435
|
* // Save to default path: ./dump/schedule/my-strategy.md
|
|
13431
|
-
* await Schedule.dump("my-strategy");
|
|
13436
|
+
* await Schedule.dump("BTCUSDT", "my-strategy");
|
|
13432
13437
|
*
|
|
13433
13438
|
* // Save to custom path: ./custom/path/my-strategy.md
|
|
13434
|
-
* await Schedule.dump("my-strategy", "./custom/path");
|
|
13439
|
+
* await Schedule.dump("BTCUSDT", "my-strategy", "./custom/path");
|
|
13435
13440
|
* ```
|
|
13436
13441
|
*/
|
|
13437
|
-
this.dump = async (strategyName, path) => {
|
|
13442
|
+
this.dump = async (symbol, strategyName, path) => {
|
|
13438
13443
|
backtest$1.loggerService.info(SCHEDULE_METHOD_NAME_DUMP, {
|
|
13444
|
+
symbol,
|
|
13439
13445
|
strategyName,
|
|
13440
13446
|
path,
|
|
13441
13447
|
});
|
|
13442
|
-
await backtest$1.scheduleMarkdownService.dump(strategyName, path);
|
|
13448
|
+
await backtest$1.scheduleMarkdownService.dump(symbol, strategyName, path);
|
|
13443
13449
|
};
|
|
13444
13450
|
}
|
|
13445
13451
|
}
|
|
@@ -13551,20 +13557,21 @@ class Performance {
|
|
|
13551
13557
|
* Creates directory if it doesn't exist.
|
|
13552
13558
|
* Default path: ./dump/performance/{strategyName}.md
|
|
13553
13559
|
*
|
|
13560
|
+
* @param symbol - Trading pair symbol
|
|
13554
13561
|
* @param strategyName - Strategy name to save report for
|
|
13555
13562
|
* @param path - Optional custom directory path
|
|
13556
13563
|
*
|
|
13557
13564
|
* @example
|
|
13558
13565
|
* ```typescript
|
|
13559
13566
|
* // Save to default path: ./dump/performance/my-strategy.md
|
|
13560
|
-
* await Performance.dump("my-strategy");
|
|
13567
|
+
* await Performance.dump("BTCUSDT", "my-strategy");
|
|
13561
13568
|
*
|
|
13562
13569
|
* // Save to custom path: ./reports/perf/my-strategy.md
|
|
13563
|
-
* await Performance.dump("my-strategy", "./reports/perf");
|
|
13570
|
+
* await Performance.dump("BTCUSDT", "my-strategy", "./reports/perf");
|
|
13564
13571
|
* ```
|
|
13565
13572
|
*/
|
|
13566
|
-
static async dump(strategyName, path = "./dump/performance") {
|
|
13567
|
-
return backtest$1.performanceMarkdownService.dump(strategyName, path);
|
|
13573
|
+
static async dump(symbol, strategyName, path = "./dump/performance") {
|
|
13574
|
+
return backtest$1.performanceMarkdownService.dump(symbol, strategyName, path);
|
|
13568
13575
|
}
|
|
13569
13576
|
}
|
|
13570
13577
|
|
package/build/index.mjs
CHANGED
|
@@ -13096,24 +13096,26 @@ class BacktestUtils {
|
|
|
13096
13096
|
/**
|
|
13097
13097
|
* Saves strategy report to disk.
|
|
13098
13098
|
*
|
|
13099
|
+
* @param symbol - Trading pair symbol
|
|
13099
13100
|
* @param strategyName - Strategy name to save report for
|
|
13100
13101
|
* @param path - Optional directory path to save report (default: "./dump/backtest")
|
|
13101
13102
|
*
|
|
13102
13103
|
* @example
|
|
13103
13104
|
* ```typescript
|
|
13104
13105
|
* // Save to default path: ./dump/backtest/my-strategy.md
|
|
13105
|
-
* await Backtest.dump("my-strategy");
|
|
13106
|
+
* await Backtest.dump("BTCUSDT", "my-strategy");
|
|
13106
13107
|
*
|
|
13107
13108
|
* // Save to custom path: ./custom/path/my-strategy.md
|
|
13108
|
-
* await Backtest.dump("my-strategy", "./custom/path");
|
|
13109
|
+
* await Backtest.dump("BTCUSDT", "my-strategy", "./custom/path");
|
|
13109
13110
|
* ```
|
|
13110
13111
|
*/
|
|
13111
|
-
this.dump = async (strategyName, path) => {
|
|
13112
|
+
this.dump = async (symbol, strategyName, path) => {
|
|
13112
13113
|
backtest$1.loggerService.info(BACKTEST_METHOD_NAME_DUMP, {
|
|
13114
|
+
symbol,
|
|
13113
13115
|
strategyName,
|
|
13114
13116
|
path,
|
|
13115
13117
|
});
|
|
13116
|
-
await backtest$1.backtestMarkdownService.dump(strategyName, path);
|
|
13118
|
+
await backtest$1.backtestMarkdownService.dump(symbol, strategyName, path);
|
|
13117
13119
|
};
|
|
13118
13120
|
}
|
|
13119
13121
|
}
|
|
@@ -13309,24 +13311,26 @@ class LiveUtils {
|
|
|
13309
13311
|
/**
|
|
13310
13312
|
* Saves strategy report to disk.
|
|
13311
13313
|
*
|
|
13314
|
+
* @param symbol - Trading pair symbol
|
|
13312
13315
|
* @param strategyName - Strategy name to save report for
|
|
13313
13316
|
* @param path - Optional directory path to save report (default: "./dump/live")
|
|
13314
13317
|
*
|
|
13315
13318
|
* @example
|
|
13316
13319
|
* ```typescript
|
|
13317
13320
|
* // Save to default path: ./dump/live/my-strategy.md
|
|
13318
|
-
* await Live.dump("my-strategy");
|
|
13321
|
+
* await Live.dump("BTCUSDT", "my-strategy");
|
|
13319
13322
|
*
|
|
13320
13323
|
* // Save to custom path: ./custom/path/my-strategy.md
|
|
13321
|
-
* await Live.dump("my-strategy", "./custom/path");
|
|
13324
|
+
* await Live.dump("BTCUSDT", "my-strategy", "./custom/path");
|
|
13322
13325
|
* ```
|
|
13323
13326
|
*/
|
|
13324
|
-
this.dump = async (strategyName, path) => {
|
|
13327
|
+
this.dump = async (symbol, strategyName, path) => {
|
|
13325
13328
|
backtest$1.loggerService.info(LIVE_METHOD_NAME_DUMP, {
|
|
13329
|
+
symbol,
|
|
13326
13330
|
strategyName,
|
|
13327
13331
|
path,
|
|
13328
13332
|
});
|
|
13329
|
-
await backtest$1.liveMarkdownService.dump(strategyName, path);
|
|
13333
|
+
await backtest$1.liveMarkdownService.dump(symbol, strategyName, path);
|
|
13330
13334
|
};
|
|
13331
13335
|
}
|
|
13332
13336
|
}
|
|
@@ -13420,24 +13424,26 @@ class ScheduleUtils {
|
|
|
13420
13424
|
/**
|
|
13421
13425
|
* Saves strategy report to disk.
|
|
13422
13426
|
*
|
|
13427
|
+
* @param symbol - Trading pair symbol
|
|
13423
13428
|
* @param strategyName - Strategy name to save report for
|
|
13424
13429
|
* @param path - Optional directory path to save report (default: "./dump/schedule")
|
|
13425
13430
|
*
|
|
13426
13431
|
* @example
|
|
13427
13432
|
* ```typescript
|
|
13428
13433
|
* // Save to default path: ./dump/schedule/my-strategy.md
|
|
13429
|
-
* await Schedule.dump("my-strategy");
|
|
13434
|
+
* await Schedule.dump("BTCUSDT", "my-strategy");
|
|
13430
13435
|
*
|
|
13431
13436
|
* // Save to custom path: ./custom/path/my-strategy.md
|
|
13432
|
-
* await Schedule.dump("my-strategy", "./custom/path");
|
|
13437
|
+
* await Schedule.dump("BTCUSDT", "my-strategy", "./custom/path");
|
|
13433
13438
|
* ```
|
|
13434
13439
|
*/
|
|
13435
|
-
this.dump = async (strategyName, path) => {
|
|
13440
|
+
this.dump = async (symbol, strategyName, path) => {
|
|
13436
13441
|
backtest$1.loggerService.info(SCHEDULE_METHOD_NAME_DUMP, {
|
|
13442
|
+
symbol,
|
|
13437
13443
|
strategyName,
|
|
13438
13444
|
path,
|
|
13439
13445
|
});
|
|
13440
|
-
await backtest$1.scheduleMarkdownService.dump(strategyName, path);
|
|
13446
|
+
await backtest$1.scheduleMarkdownService.dump(symbol, strategyName, path);
|
|
13441
13447
|
};
|
|
13442
13448
|
}
|
|
13443
13449
|
}
|
|
@@ -13549,20 +13555,21 @@ class Performance {
|
|
|
13549
13555
|
* Creates directory if it doesn't exist.
|
|
13550
13556
|
* Default path: ./dump/performance/{strategyName}.md
|
|
13551
13557
|
*
|
|
13558
|
+
* @param symbol - Trading pair symbol
|
|
13552
13559
|
* @param strategyName - Strategy name to save report for
|
|
13553
13560
|
* @param path - Optional custom directory path
|
|
13554
13561
|
*
|
|
13555
13562
|
* @example
|
|
13556
13563
|
* ```typescript
|
|
13557
13564
|
* // Save to default path: ./dump/performance/my-strategy.md
|
|
13558
|
-
* await Performance.dump("my-strategy");
|
|
13565
|
+
* await Performance.dump("BTCUSDT", "my-strategy");
|
|
13559
13566
|
*
|
|
13560
13567
|
* // Save to custom path: ./reports/perf/my-strategy.md
|
|
13561
|
-
* await Performance.dump("my-strategy", "./reports/perf");
|
|
13568
|
+
* await Performance.dump("BTCUSDT", "my-strategy", "./reports/perf");
|
|
13562
13569
|
* ```
|
|
13563
13570
|
*/
|
|
13564
|
-
static async dump(strategyName, path = "./dump/performance") {
|
|
13565
|
-
return backtest$1.performanceMarkdownService.dump(strategyName, path);
|
|
13571
|
+
static async dump(symbol, strategyName, path = "./dump/performance") {
|
|
13572
|
+
return backtest$1.performanceMarkdownService.dump(symbol, strategyName, path);
|
|
13566
13573
|
}
|
|
13567
13574
|
}
|
|
13568
13575
|
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -5213,19 +5213,20 @@ declare class BacktestUtils {
|
|
|
5213
5213
|
/**
|
|
5214
5214
|
* Saves strategy report to disk.
|
|
5215
5215
|
*
|
|
5216
|
+
* @param symbol - Trading pair symbol
|
|
5216
5217
|
* @param strategyName - Strategy name to save report for
|
|
5217
5218
|
* @param path - Optional directory path to save report (default: "./dump/backtest")
|
|
5218
5219
|
*
|
|
5219
5220
|
* @example
|
|
5220
5221
|
* ```typescript
|
|
5221
5222
|
* // Save to default path: ./dump/backtest/my-strategy.md
|
|
5222
|
-
* await Backtest.dump("my-strategy");
|
|
5223
|
+
* await Backtest.dump("BTCUSDT", "my-strategy");
|
|
5223
5224
|
*
|
|
5224
5225
|
* // Save to custom path: ./custom/path/my-strategy.md
|
|
5225
|
-
* await Backtest.dump("my-strategy", "./custom/path");
|
|
5226
|
+
* await Backtest.dump("BTCUSDT", "my-strategy", "./custom/path");
|
|
5226
5227
|
* ```
|
|
5227
5228
|
*/
|
|
5228
|
-
dump: (strategyName: StrategyName, path?: string) => Promise<void>;
|
|
5229
|
+
dump: (symbol: string, strategyName: StrategyName, path?: string) => Promise<void>;
|
|
5229
5230
|
}
|
|
5230
5231
|
/**
|
|
5231
5232
|
* Singleton instance of BacktestUtils for convenient backtest operations.
|
|
@@ -5347,19 +5348,20 @@ declare class LiveUtils {
|
|
|
5347
5348
|
/**
|
|
5348
5349
|
* Saves strategy report to disk.
|
|
5349
5350
|
*
|
|
5351
|
+
* @param symbol - Trading pair symbol
|
|
5350
5352
|
* @param strategyName - Strategy name to save report for
|
|
5351
5353
|
* @param path - Optional directory path to save report (default: "./dump/live")
|
|
5352
5354
|
*
|
|
5353
5355
|
* @example
|
|
5354
5356
|
* ```typescript
|
|
5355
5357
|
* // Save to default path: ./dump/live/my-strategy.md
|
|
5356
|
-
* await Live.dump("my-strategy");
|
|
5358
|
+
* await Live.dump("BTCUSDT", "my-strategy");
|
|
5357
5359
|
*
|
|
5358
5360
|
* // Save to custom path: ./custom/path/my-strategy.md
|
|
5359
|
-
* await Live.dump("my-strategy", "./custom/path");
|
|
5361
|
+
* await Live.dump("BTCUSDT", "my-strategy", "./custom/path");
|
|
5360
5362
|
* ```
|
|
5361
5363
|
*/
|
|
5362
|
-
dump: (strategyName: StrategyName, path?: string) => Promise<void>;
|
|
5364
|
+
dump: (symbol: string, strategyName: StrategyName, path?: string) => Promise<void>;
|
|
5363
5365
|
}
|
|
5364
5366
|
/**
|
|
5365
5367
|
* Singleton instance of LiveUtils for convenient live trading operations.
|
|
@@ -5435,19 +5437,20 @@ declare class ScheduleUtils {
|
|
|
5435
5437
|
/**
|
|
5436
5438
|
* Saves strategy report to disk.
|
|
5437
5439
|
*
|
|
5440
|
+
* @param symbol - Trading pair symbol
|
|
5438
5441
|
* @param strategyName - Strategy name to save report for
|
|
5439
5442
|
* @param path - Optional directory path to save report (default: "./dump/schedule")
|
|
5440
5443
|
*
|
|
5441
5444
|
* @example
|
|
5442
5445
|
* ```typescript
|
|
5443
5446
|
* // Save to default path: ./dump/schedule/my-strategy.md
|
|
5444
|
-
* await Schedule.dump("my-strategy");
|
|
5447
|
+
* await Schedule.dump("BTCUSDT", "my-strategy");
|
|
5445
5448
|
*
|
|
5446
5449
|
* // Save to custom path: ./custom/path/my-strategy.md
|
|
5447
|
-
* await Schedule.dump("my-strategy", "./custom/path");
|
|
5450
|
+
* await Schedule.dump("BTCUSDT", "my-strategy", "./custom/path");
|
|
5448
5451
|
* ```
|
|
5449
5452
|
*/
|
|
5450
|
-
dump: (strategyName: StrategyName, path?: string) => Promise<void>;
|
|
5453
|
+
dump: (symbol: string, strategyName: StrategyName, path?: string) => Promise<void>;
|
|
5451
5454
|
}
|
|
5452
5455
|
/**
|
|
5453
5456
|
* Singleton instance of ScheduleUtils for convenient scheduled signals reporting.
|
|
@@ -5553,19 +5556,20 @@ declare class Performance {
|
|
|
5553
5556
|
* Creates directory if it doesn't exist.
|
|
5554
5557
|
* Default path: ./dump/performance/{strategyName}.md
|
|
5555
5558
|
*
|
|
5559
|
+
* @param symbol - Trading pair symbol
|
|
5556
5560
|
* @param strategyName - Strategy name to save report for
|
|
5557
5561
|
* @param path - Optional custom directory path
|
|
5558
5562
|
*
|
|
5559
5563
|
* @example
|
|
5560
5564
|
* ```typescript
|
|
5561
5565
|
* // Save to default path: ./dump/performance/my-strategy.md
|
|
5562
|
-
* await Performance.dump("my-strategy");
|
|
5566
|
+
* await Performance.dump("BTCUSDT", "my-strategy");
|
|
5563
5567
|
*
|
|
5564
5568
|
* // Save to custom path: ./reports/perf/my-strategy.md
|
|
5565
|
-
* await Performance.dump("my-strategy", "./reports/perf");
|
|
5569
|
+
* await Performance.dump("BTCUSDT", "my-strategy", "./reports/perf");
|
|
5566
5570
|
* ```
|
|
5567
5571
|
*/
|
|
5568
|
-
static dump(strategyName: string, path?: string): Promise<void>;
|
|
5572
|
+
static dump(symbol: string, strategyName: string, path?: string): Promise<void>;
|
|
5569
5573
|
}
|
|
5570
5574
|
|
|
5571
5575
|
/**
|