backtest-kit 1.1.0 → 1.1.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/README.md CHANGED
@@ -148,7 +148,7 @@ addFrame({
148
148
  import { Backtest, listenSignalBacktest, listenError } from "backtest-kit";
149
149
 
150
150
  // Run backtest in background
151
- await Backtest.background("BTCUSDT", {
151
+ const stopBacktest = Backtest.background("BTCUSDT", {
152
152
  strategyName: "my-strategy",
153
153
  exchangeName: "binance",
154
154
  frameName: "1d-backtest"
@@ -177,7 +177,7 @@ await Backtest.dump("my-strategy"); // ./logs/backtest/my-strategy.md
177
177
  import { Live, listenSignalLive, listenError } from "backtest-kit";
178
178
 
179
179
  // Run live trading in background (infinite loop, crash-safe)
180
- const stop = await Live.background("BTCUSDT", {
180
+ const stop = Live.background("BTCUSDT", {
181
181
  strategyName: "my-strategy",
182
182
  exchangeName: "binance"
183
183
  });
@@ -313,7 +313,7 @@ Generate detailed trading reports with statistics:
313
313
  import { Backtest } from "backtest-kit";
314
314
 
315
315
  // Run backtest
316
- await Backtest.background("BTCUSDT", {
316
+ const stopBacktest = Backtest.background("BTCUSDT", {
317
317
  strategyName: "my-strategy",
318
318
  exchangeName: "binance",
319
319
  frameName: "1d-backtest"
@@ -426,7 +426,7 @@ listenSignalBacktestOnce(
426
426
  import { Live, listenSignalLive, listenSignalLiveOnce } from "backtest-kit";
427
427
 
428
428
  // Run live trading in background (infinite loop)
429
- const cancel = await Live.background("BTCUSDT", {
429
+ const cancel = Live.background("BTCUSDT", {
430
430
  strategyName: "my-strategy",
431
431
  exchangeName: "binance"
432
432
  });
@@ -792,7 +792,7 @@ setTimeout(() => {
792
792
  }, 5000);
793
793
 
794
794
  // Live.background also returns a stop function
795
- const stopLive = await Live.background("BTCUSDT", {
795
+ const stopLive = Live.background("BTCUSDT", {
796
796
  strategyName: "my-strategy",
797
797
  exchangeName: "binance"
798
798
  });
package/build/index.cjs CHANGED
@@ -4114,7 +4114,7 @@ class BacktestUtils {
4114
4114
  * console.log("Backtest completed");
4115
4115
  * ```
4116
4116
  */
4117
- this.background = async (symbol, context) => {
4117
+ this.background = (symbol, context) => {
4118
4118
  backtest$1.loggerService.info(BACKTEST_METHOD_NAME_BACKGROUND, {
4119
4119
  symbol,
4120
4120
  context,
@@ -4272,7 +4272,7 @@ class LiveUtils {
4272
4272
  * });
4273
4273
  * ```
4274
4274
  */
4275
- this.background = async (symbol, context) => {
4275
+ this.background = (symbol, context) => {
4276
4276
  backtest$1.loggerService.info(LIVE_METHOD_NAME_BACKGROUND, {
4277
4277
  symbol,
4278
4278
  context,
package/build/index.mjs CHANGED
@@ -4112,7 +4112,7 @@ class BacktestUtils {
4112
4112
  * console.log("Backtest completed");
4113
4113
  * ```
4114
4114
  */
4115
- this.background = async (symbol, context) => {
4115
+ this.background = (symbol, context) => {
4116
4116
  backtest$1.loggerService.info(BACKTEST_METHOD_NAME_BACKGROUND, {
4117
4117
  symbol,
4118
4118
  context,
@@ -4270,7 +4270,7 @@ class LiveUtils {
4270
4270
  * });
4271
4271
  * ```
4272
4272
  */
4273
- this.background = async (symbol, context) => {
4273
+ this.background = (symbol, context) => {
4274
4274
  backtest$1.loggerService.info(LIVE_METHOD_NAME_BACKGROUND, {
4275
4275
  symbol,
4276
4276
  context,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -1205,7 +1205,7 @@ declare class BacktestUtils {
1205
1205
  strategyName: string;
1206
1206
  exchangeName: string;
1207
1207
  frameName: string;
1208
- }) => Promise<() => void>;
1208
+ }) => () => void;
1209
1209
  /**
1210
1210
  * Generates markdown report with all closed signals for a strategy.
1211
1211
  *
@@ -1324,7 +1324,7 @@ declare class LiveUtils {
1324
1324
  background: (symbol: string, context: {
1325
1325
  strategyName: string;
1326
1326
  exchangeName: string;
1327
- }) => Promise<() => void>;
1327
+ }) => () => void;
1328
1328
  /**
1329
1329
  * Generates markdown report with all events for a strategy.
1330
1330
  *