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 onOrderCheck (syncPendingSubject subscription)
  • Registered actions via orderCheck / onOrderCheck
action: "signal-ping"

Discriminator for pending-ping action

type: "schedule" | "active"

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

symbol: string

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

strategyName: string

Strategy name that generated this signal

exchangeName: string

Exchange name where signal was executed

frameName: string

Timeframe name (empty string in live mode)

backtest: boolean

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

signalId: string

Unique signal identifier (UUID v4)

timestamp: number

Timestamp from execution context (tick's when)

signal: IPublicSignalRow

Complete public signal row at the moment of this event

currentPrice: number

Market price at the moment of the ping (VWAP)

pnl: IStrategyPnL

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

peakProfit: IStrategyPnL

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

maxDrawdown: IStrategyPnL

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

position: "long" | "short"

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

priceOpen: number

Effective entry price (may differ from priceOpen after DCA averaging)

priceTakeProfit: number

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

priceStopLoss: number

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

originalPriceTakeProfit: number

Original take profit price before any trailing adjustments

originalPriceStopLoss: number

Original stop loss price before any trailing adjustments

originalPriceOpen: number

Original entry price before any DCA averaging (initial priceOpen)

scheduledAt: number

Signal creation timestamp in milliseconds

pendingAt: number

Position activation timestamp in milliseconds

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.