A custom pre-trade policy implemented in JavaScript. Pass an object
satisfying this shape to EngineBuilder.preTrade /
ReadyEngineBuilder.preTrade; the engine adapts it to a native policy
and invokes its hooks during the pre-trade, post-trade, and
account-adjustment flows.
checkPreTradeStart and performPreTradeCheck are required. Their optional
dry-run counterparts let a stateful policy provide a read-only emulation;
when absent, the engine falls back to the corresponding normal hook.
applyExecutionReport and applyAccountAdjustment are optional. Each hook
is called with this bound to the policy object.
A custom pre-trade policy implemented in JavaScript. Pass an object satisfying this shape to EngineBuilder.preTrade / ReadyEngineBuilder.preTrade; the engine adapts it to a native policy and invokes its hooks during the pre-trade, post-trade, and account-adjustment flows.
checkPreTradeStartandperformPreTradeCheckare required. Their optional dry-run counterparts let a stateful policy provide a read-only emulation; when absent, the engine falls back to the corresponding normal hook.applyExecutionReportandapplyAccountAdjustmentare optional. Each hook is called withthisbound to the policy object.