type BrokerOrderCheckPayload = {
type: "schedule" | "active";
symbol: string;
signalId: string;
position: "long" | "short";
currentPrice: number;
priceOpen: number;
priceTakeProfit: number;
priceStopLoss: number;
pnl: IStrategyPnL;
peakProfit: IStrategyPnL;
maxDrawdown: IStrategyPnL;
totalEntries: number;
totalPartials: number;
attempt: number;
context: {
strategyName: StrategyName;
exchangeName: ExchangeName;
frameName?: FrameName;
};
when: Date;
backtest: boolean;
};
Payload for the order synchronization broker event.
Emitted automatically via syncPendingSubject on every live tick while a signal is monitored,
BEFORE the framework evaluates completion. Forwarded to the registered IBroker adapter,
routed by type to the matching callback:
type: "active" — pending signal (open position), before TP/SL/time evaluation —
delivered to onOrderActiveCheck;type: "schedule" — scheduled signal, before timeout/price-activation evaluation
(the order in question is the resting entry order) — delivered to onOrderScheduleCheck.The adapter should query the exchange by signalId. Returning normally keeps the signal
under normal monitoring. Throw semantics (see IBrokerOrderVerdict):
attempt incremented, up to CC_ORDER_CHECK_RETRY_ATTEMPTS consecutive failures
before the framework acts terminally (a successful check resets the streak).NOTE for type "schedule": if the resting entry order actually FILLED, confirm the fill via
commitActivateScheduled instead of throwing — a throw here is a terminal cancel, not an
activation.