backtest-kit 1.0.0 → 1.0.2

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
@@ -572,10 +572,19 @@ function stopAll() {
572
572
  instances.clear();
573
573
  }
574
574
 
575
+ async function getCandles(symbol, interval, limit) {
576
+ return await backtest.candleConnectionService.getCandles(symbol, interval, limit);
577
+ }
578
+ async function getAveragePrice(symbol) {
579
+ return await backtest.candleConnectionService.getAveragePrice(symbol);
580
+ }
581
+
575
582
  exports.ExecutionContextService = ExecutionContextService;
576
583
  exports.addCandle = addCandle;
577
584
  exports.addStrategy = addStrategy;
578
585
  exports.backtest = backtest;
586
+ exports.getAveragePrice = getAveragePrice;
587
+ exports.getCandles = getCandles;
579
588
  exports.reduce = reduce;
580
589
  exports.runBacktest = runBacktest;
581
590
  exports.runBacktestGUI = runBacktestGUI;
package/build/index.mjs CHANGED
@@ -570,4 +570,11 @@ function stopAll() {
570
570
  instances.clear();
571
571
  }
572
572
 
573
- export { ExecutionContextService, addCandle, addStrategy, backtest, reduce, runBacktest, runBacktestGUI, startRun, stopAll, stopRun };
573
+ async function getCandles(symbol, interval, limit) {
574
+ return await backtest.candleConnectionService.getCandles(symbol, interval, limit);
575
+ }
576
+ async function getAveragePrice(symbol) {
577
+ return await backtest.candleConnectionService.getAveragePrice(symbol);
578
+ }
579
+
580
+ export { ExecutionContextService, addCandle, addStrategy, backtest, getAveragePrice, getCandles, reduce, runBacktest, runBacktestGUI, startRun, stopAll, stopRun };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -137,6 +137,9 @@ declare function startRun(config: IRunConfig): void;
137
137
  declare function stopRun(symbol: string): void;
138
138
  declare function stopAll(): void;
139
139
 
140
+ declare function getCandles(symbol: string, interval: CandleInterval, limit: number): Promise<ICandleData[]>;
141
+ declare function getAveragePrice(symbol: string): Promise<number>;
142
+
140
143
  declare class LoggerService implements ILogger {
141
144
  private _commonLogger;
142
145
  log: (topic: string, ...args: any[]) => Promise<void>;
@@ -210,4 +213,4 @@ declare const backtest: {
210
213
  loggerService: LoggerService;
211
214
  };
212
215
 
213
- export { ExecutionContextService, addCandle, addStrategy, backtest, reduce, runBacktest, runBacktestGUI, startRun, stopAll, stopRun };
216
+ export { type CandleInterval, ExecutionContextService, type ICandleData, type ICandleSchema, type ISignalData, type IStrategyPnL, type IStrategySchema, type IStrategyTickResult, type IStrategyTickResultActive, type IStrategyTickResultClosed, type IStrategyTickResultIdle, type IStrategyTickResultOpened, addCandle, addStrategy, backtest, getAveragePrice, getCandles, reduce, runBacktest, runBacktestGUI, startRun, stopAll, stopRun };