Interface DoneContract

Contract for background execution completion events.

Emitted when Live.background() or Backtest.background() completes execution. Contains metadata about the completed execution context.

import { listenDone } from "backtest-kit";

listenDone((event) => {
if (event.backtest) {
console.log("Backtest completed:", event.symbol);
} else {
console.log("Live trading completed:", event.symbol);
}
});
interface DoneContract {
    backtest: boolean;
    exchangeName: string;
    strategyName: string;
    symbol: string;
}

Properties

backtest: boolean

backtest - True if backtest mode, false if live mode

exchangeName: string

exchangeName - Name of the exchange used in execution

strategyName: string

strategyName - Name of the strategy that completed

symbol: string

symbol - Trading symbol (e.g., "BTCUSDT")