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 Type
    Method
    Description
    boolean
    Returns whether the given signal fills immediately (same tick), or must be queued and resolved against a later tick.
    Resolves the price at which a queued (non-immediate) signal fills against the given ticker, or null if it does not resolve yet.
  • Method Details

    • isImmediate

      boolean isImmediate(MarketHintSignal signal)
      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

      BigDecimal resolvePending(MarketHintSignal signal, Ticker ticker)
      Resolves the price at which a queued (non-immediate) signal fills against the given ticker, or null if it does not resolve yet. Only consulted for signals where isImmediate(MarketHintSignal) returned false; the pending queue that calls this is wired in P3.
      Parameters:
      signal - the pending market hint signal
      ticker - the current tick being evaluated against the pending signal
      Returns:
      the resolved execution price, or null if still pending