Subscribes to filtered live signal events with one-time execution.
Only receives events from Live.run() execution. Executes callback once and automatically unsubscribes.
Predicate to filter which events trigger the callback
Callback function to handle the filtered event (called only once)
Unsubscribe function to cancel the listener before it fires
import { listenSignalLiveOnce } from "./function/event";// Wait for first live take profit hitlistenSignalLiveOnce( (event) => event.action === "closed" && event.closeReason === "take_profit", (event) => console.log("Live take profit:", event.pnl.pnlPercentage)); Copy
import { listenSignalLiveOnce } from "./function/event";// Wait for first live take profit hitlistenSignalLiveOnce( (event) => event.action === "closed" && event.closeReason === "take_profit", (event) => console.log("Live take profit:", event.pnl.pnlPercentage));
Subscribes to filtered live signal events with one-time execution.
Only receives events from Live.run() execution. Executes callback once and automatically unsubscribes.