Interface FillPolicy
- All Known Implementing Classes:
ImmediateFill
public interface FillPolicy
Decides WHEN a backtest signal fills.
Non-immediate policies (a deferred pending-order queue resolving limit/stop/stopTrailing
signals against later ticks) are wired in P3 — see P3. In
P1 only ImmediateFill exists and every signal fills on the same tick it was raised on,
exactly as today.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisImmediate(MarketHintSignal signal) Returns whether the given signal fills immediately (same tick), or must be queued and resolved against a later tick.resolvePending(MarketHintSignal signal, Ticker ticker) Resolves the price at which a queued (non-immediate) signal fills against the given ticker, ornullif it does not resolve yet.
-
Method Details
-
isImmediate
Returns whether the given signal fills immediately (same tick), or must be queued and resolved against a later tick.- Parameters:
signal- the market hint signal (buy/sell) about to be routed to an executor- Returns:
- true if the signal should fill on the current tick
-
resolvePending
Resolves the price at which a queued (non-immediate) signal fills against the given ticker, ornullif it does not resolve yet. Only consulted for signals whereisImmediate(MarketHintSignal)returned false; the pending queue that calls this is wired in P3.- Parameters:
signal- the pending market hint signalticker- the current tick being evaluated against the pending signal- Returns:
- the resolved execution price, or
nullif still pending
-