ExitHookManager

Pipeline-owned lifecycle for one-shot DSL exit hooks.

All lookups are indexed by strategy, order id, broker ticket, or strategy/symbol. Strategies without active hooks return after one strategy-map lookup.

Constructors

Link copied to clipboard
constructor(persistor: StatePersistor)

Functions

Link copied to clipboard
fun bind(strategyId: String, strategy: DslCompiledStrategy, emit: (Signal) -> Unit)

Bind a compiled DSL strategy and its normal gated emit path.

Link copied to clipboard

Execute hook actions prepared by a deferred onFill call for this stamped event.

Link copied to clipboard

Drop an unfilled parent entry that expired or was cancelled.

Link copied to clipboard
fun onFill(event: BrokerEvent.OrderFilled, netRealizedPnl: BigDecimal, strategyAfterQuantity: BigDecimal, reducedExposure: Boolean, deferDispatch: Boolean = false)

Consume an accounted fill. strategyAfterQuantity is the post-fill net strategy quantity, reducedExposure says accounting observed a reduction/flip, and netRealizedPnl is the exact amount already booked by the pipeline. Set deferDispatch when order-lifecycle handlers must finish before child submission.

Link copied to clipboard

Drop a binding whose entry was rejected before any position could open.

Link copied to clipboard
fun register(strategyId: String, request: OrderRequest, ref: ExitHookRef)

Register a risk-approved request before it reaches the broker.

Link copied to clipboard
fun trackCloseRequest(strategyId: String, request: OrderRequest)

Correlate an approved explicit close with the hook-bearing entry it targets.