Interface PartialProfitCommit

Partial profit event.

interface PartialProfitCommit {
    action: "partial-profit";
    backtest: boolean;
    currentPrice: number;
    exchangeName: string;
    frameName: string;
    originalPriceOpen: number;
    originalPriceStopLoss: number;
    originalPriceTakeProfit: number;
    pendingAt: number;
    percentToClose: 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
    • PartialProfitCommit

Properties

action: "partial-profit"

Discriminator for partial-profit action

backtest: boolean

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

currentPrice: number

Current market price at time of action

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)

percentToClose: number

Percentage of position to close (0-100)

Unrealized PNL at the moment of partial profit

position: "long" | "short"

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

priceOpen: number

Entry price for the position

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.