Type Alias BrokerSignalOpenPayload

BrokerSignalOpenPayload: {
    backtest: boolean;
    context: {
        exchangeName: ExchangeName;
        frameName?: FrameName;
        strategyName: StrategyName;
    };
    cost: number;
    position: "long"
    | "short";
    priceOpen: number;
    priceStopLoss: number;
    priceTakeProfit: number;
    symbol: string;
}

Payload for the signal-open broker event.

Emitted automatically via syncSubject when a new pending signal is activated. Forwarded to the registered IBroker adapter via onSignalOpenCommit.

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

  • cost: number

    Dollar cost of the position entry (CC_POSITION_ENTRY_COST)

  • position: "long" | "short"

    Position direction

  • priceOpen: number

    Activation price — the price at which the signal became active

  • priceStopLoss: number

    Original stop-loss price from the signal

  • priceTakeProfit: number

    Original take-profit price from the signal

  • symbol: string

    Trading pair symbol, e.g. "BTCUSDT"

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