true when called during a backtest run — adapter should skip exchange calls
OptionalcloseReason?: StrategyCloseReasonWhy the position closed: "take_profit" / "stop_loss" / "time_expired" / "closed"
Strategy/exchange/frame routing context
Market price at the moment of close
Position direction
Effective entry price of the closed position
Effective stop-loss price of the closed position
Effective take-profit price of the closed position
Unique signal identifier (UUID v4) of the closed position
Trading pair symbol, e.g. "BTCUSDT"
const payload: BrokerPendingClosePayload = {
symbol: "BTCUSDT",
position: "long",
currentPrice: 55000,
priceOpen: 50000,
priceTakeProfit: 55000,
priceStopLoss: 48000,
closeReason: "take_profit",
context: { strategyName: "my-strategy", exchangeName: "binance", frameName: "1h" },
backtest: false,
};
Payload for the pending-signal-close broker event.
Emitted automatically via signalEventSubject (action "closed") when a pending position is closed. Forwarded to the registered IBroker adapter via
onSignalPendingClose. ThecloseReasondistinguishes take_profit / stop_loss / time_expired / user-close / broker fill / order gone.