Interface StrategyEvent

Unified strategy event data for markdown report generation. Contains all information about strategy management actions.

interface StrategyEvent {
    action: StrategyActionType;
    activateId?: string;
    backtest: boolean;
    cancelId?: string;
    closeId?: string;
    cost?: number;
    createdAt: string;
    currentPrice?: number;
    effectivePriceOpen?: number;
    exchangeName: string;
    frameName: string;
    originalPriceOpen?: number;
    originalPriceStopLoss?: number;
    originalPriceTakeProfit?: number;
    pendingAt?: number;
    percentShift?: 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;
}

Properties

Action type

activateId?: string

Activate ID for activate-scheduled action

backtest: boolean

True if backtest mode, false if live mode

cancelId?: string

Cancel ID for cancel-scheduled action

closeId?: string

Close ID for close-pending action

cost?: number

Cost of this entry in USD (average-buy action only)

createdAt: string

ISO timestamp string when action was created

currentPrice?: number

Current market price when action was executed

effectivePriceOpen?: number

Averaged entry price after DCA addition (average-buy action only)

exchangeName: string

Exchange name

frameName: string

Frame name (empty for live)

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

Pending timestamp in milliseconds (when position became pending/active at priceOpen)

percentShift?: number

Percent shift for trailing stop/take

percentToClose?: number

Percent to close for partial profit/loss

PNL at the moment of this action

position?: "long" | "short"

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

priceOpen?: number

Entry price for the position

priceStopLoss?: number

Effective stop loss price (with trailing if set)

priceTakeProfit?: number

Effective take profit price (with trailing if set)

scheduledAt?: number

Signal creation timestamp in milliseconds (when signal was first created/scheduled)

signalId: string

Signal ID

strategyName: string

Strategy name

symbol: string

Trading pair symbol

timestamp: number

Event timestamp in milliseconds

totalEntries?: number

Total number of DCA entries after this addition (average-buy action only)

totalPartials?: number

Total number of partial closes executed (_partial.length)