true when called during a backtest run — adapter should skip exchange calls
Strategy/exchange/frame routing context
Total dollar cost basis of the position at close
Market price at the moment of close
Maximum drawdown experienced during the life of this position up to the moment this public signal was created
Peak profit achieved during the life of this position up to the moment this public signal was created
Realized PnL breakdown for the closed position
Position direction
Effective entry price at time of close (may differ from priceOpen after DCA averaging)
Original stop-loss price from the signal
Original take-profit price from the signal
Trading pair symbol, e.g. "BTCUSDT"
Total number of DCA entries (including initial open)
Total number of partial closes executed before final close
const payload: BrokerSignalClosePayload = {
symbol: "BTCUSDT",
cost: 100,
position: "long",
currentPrice: 54000,
priceTakeProfit: 55000,
priceStopLoss: 48000,
totalEntries: 2,
totalPartials: 1,
pnl: { profit: 80, loss: 0, volume: 100 },
context: { strategyName: "my-strategy", exchangeName: "binance", frameName: "1h" },
backtest: false,
};
Payload for the signal-close broker event.
Emitted automatically via syncSubject when a pending signal is closed (SL/TP hit or manual close). Forwarded to the registered IBroker adapter via
onSignalCloseCommit.