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); }}); Copy
import { listenDone } from "backtest-kit";listenDone((event) => { if (event.backtest) { console.log("Backtest completed:", event.symbol); } else { console.log("Live trading completed:", event.symbol); }});
backtest - True if backtest mode, false if live mode
exchangeName - Name of the exchange used in execution
strategyName - Name of the strategy that completed
symbol - Trading symbol (e.g., "BTCUSDT")
Contract for background execution completion events.
Emitted when Live.background() or Backtest.background() completes execution. Contains metadata about the completed execution context.
Example