Interface AverageBuyCommit

Average-buy (DCA) event. Emitted when a new averaging entry is added to an open position.

interface AverageBuyCommit {
    action: "average-buy";
    backtest: boolean;
    cost: number;
    currentPrice: number;
    effectivePriceOpen: number;
    exchangeName: string;
    frameName: string;
    originalPriceOpen: number;
    originalPriceStopLoss: number;
    originalPriceTakeProfit: number;
    pendingAt: number;
    pnl: IStrategyPnL;
    position: "long" | "short";
    priceOpen: number;
    priceStopLoss: number;
    priceTakeProfit: number;
    scheduledAt: number;
    signalId: string;
    strategyName: string;
    symbol: string;
    timestamp: number;
    totalEntries: number;
    totalPartials: number;
}

Hierarchy

  • SignalCommitBase
    • AverageBuyCommit

Properties

action: "average-buy"

Discriminator for average-buy action

backtest: boolean

Whether this event is from backtest mode (true) or live mode (false)

cost: number

Cost of this averaging entry in USD

currentPrice: number

Price at which the new averaging entry was executed

effectivePriceOpen: number

Effective (averaged) entry price after this addition

exchangeName: string

Exchange name where signal was executed

frameName: string

Timeframe name (used in backtest mode, empty string in live mode)

originalPriceOpen: number

Original entry price at signal creation (unchanged by DCA averaging).

originalPriceStopLoss: number

Original stop loss price before any trailing adjustments

originalPriceTakeProfit: number

Original take profit price before any trailing adjustments

pendingAt: number

Position activation timestamp in milliseconds (when price reached priceOpen)

Unrealized PNL at the moment of average-buy (calculated after new entry added)

position: "long" | "short"

Trade direction: "long" (buy) or "short" (sell)

priceOpen: number

Original entry price (signal.priceOpen, unchanged by averaging)

priceStopLoss: number

Effective stop loss price (may differ from original after trailing)

priceTakeProfit: number

Effective take profit price (may differ from original after trailing)

scheduledAt: number

Signal creation timestamp in milliseconds

signalId: string

Unique signal identifier (UUID v4)

strategyName: string

Strategy name that generated this signal

symbol: string

Trading pair symbol (e.g., "BTCUSDT")

timestamp: number

Timestamp from execution context (tick's when or backtest candle timestamp)

totalEntries: number

Total number of DCA entries at the time of this event (_entry.length). 1 = no averaging done (only initial entry). 2+ = averaged positions.

totalPartials: number

Total number of partial closes executed at the time of this event (_partial.length). 0 = no partial closes done. 1+ = partial closes executed.