Interface OrderCheckContract

Signal order-ping sync event.

Emitted on every live tick while a signal is being monitored, BEFORE the framework evaluates completion. It asks the external order management system whether the corresponding order is STILL open on the exchange. Fires for BOTH monitored states, discriminated by type:

  • type: "active" — a pending signal (open position); the order backing the position.
  • type: "schedule" — a scheduled signal; the resting entry order awaiting activation.

Listener contract (mirrors syncSubject semantics):

  • Return true (or do nothing) — the order is still open on the exchange, keep monitoring.
  • Return false OR throw — the order is no longer open on the exchange (filled, cancelled, liquidated externally). For "active" the framework closes the pending signal with closeReason "closed"; for "schedule" it cancels the scheduled signal (reason "user"). NOTE for "schedule": if the resting order actually FILLED, confirm it via activateScheduled/commitActivateScheduled instead of failing the ping — a failed ping is a terminal cancel, not an activation.

Backtest never emits this event — there is no live exchange to query.

Consumers:

  • Broker adapter via onOrderActiveCheck / onOrderScheduleCheck (syncPendingSubject subscription)
  • Registered actions via orderCheck / onOrderCheck
interface OrderCheckContract {
    action: "signal-ping";
    backtest: boolean;
    currentPrice: number;
    exchangeName: string;
    frameName: string;
    maxDrawdown: IStrategyPnL;
    originalPriceOpen: number;
    originalPriceStopLoss: number;
    originalPriceTakeProfit: number;
    peakProfit: IStrategyPnL;
    pendingAt: number;
    pnl: IStrategyPnL;
    position: "long" | "short";
    priceOpen: number;
    priceStopLoss: number;
    priceTakeProfit: number;
    scheduledAt: number;
    signal: IPublicSignalRow;
    signalId: string;
    strategyName: string;
    symbol: string;
    timestamp: number;
    totalEntries: number;
    totalPartials: number;
    type: "active" | "schedule";
}

Properties

action: "signal-ping"

Discriminator for pending-ping action

backtest: boolean

Whether this event is from backtest mode (true) or live mode (false) — always false in practice

currentPrice: number

Market price at the moment of the ping (VWAP)

exchangeName: string

Exchange name where signal was executed

frameName: string

Timeframe name (empty string in live mode)

maxDrawdown: IStrategyPnL

Maximum drawdown experienced during the life of this position up to this event

originalPriceOpen: number

Original entry price before any DCA averaging (initial priceOpen)

originalPriceStopLoss: number

Original stop loss price before any trailing adjustments

originalPriceTakeProfit: number

Original take profit price before any trailing adjustments

peakProfit: IStrategyPnL

Peak profit achieved during the life of this position up to this event

pendingAt: number

Position activation timestamp in milliseconds

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

position: "long" | "short"

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

priceOpen: number

Effective entry price (may differ from priceOpen after DCA 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

Complete public signal row at the moment of this event

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)

totalEntries: number

Total number of DCA entries (_entry.length). 1 = no averaging done.

totalPartials: number

Total number of partial closes executed (_partial.length). 0 = none.

type: "active" | "schedule"

Monitored state: "active" — open position order, "schedule" — resting entry order