Type Alias BrokerActivePingPayload

BrokerActivePingPayload: {
    backtest: boolean;
    context: {
        exchangeName: ExchangeName;
        frameName?: FrameName;
        strategyName: StrategyName;
    };
    currentPrice: number;
    pnl: IStrategyPnL;
    position: "long"
    | "short";
    priceOpen: number;
    priceStopLoss: number;
    priceTakeProfit: number;
    signalId: string;
    symbol: string;
}

Payload for the active-ping broker event.

Emitted automatically via activePingSubject on every live tick while a pending (open) signal is monitored. Forwarded to the registered IBroker adapter via onSignalActivePing. Purely informational — unlike onOrderCheck a throw here does NOT close the position.

Type declaration

  • backtest: boolean

    true when called during a backtest run — adapter should skip exchange calls

  • context: {
        exchangeName: ExchangeName;
        frameName?: FrameName;
        strategyName: StrategyName;
    }

    Strategy/exchange/frame routing context

  • currentPrice: number

    Market price at the moment of the ping

  • pnl: IStrategyPnL

    Unrealized PnL of the open position at the moment of the ping

  • position: "long" | "short"

    Position direction

  • priceOpen: number

    Effective entry price (may differ from priceOpen after DCA averaging)

  • priceStopLoss: number

    Effective stop-loss price at the moment of the ping

  • priceTakeProfit: number

    Effective take-profit price at the moment of the ping

  • signalId: string

    Unique signal identifier (UUID v4) of the monitored position

  • symbol: string

    Trading pair symbol, e.g. "BTCUSDT"

const payload: BrokerActivePingPayload = {
symbol: "BTCUSDT",
position: "long",
currentPrice: 50500,
priceOpen: 50000,
priceTakeProfit: 55000,
priceStopLoss: 48000,
context: { strategyName: "my-strategy", exchangeName: "binance", frameName: "1h" },
backtest: false,
};