Class ImmediateFill

java.lang.Object
com.wualabs.qtsurfer.engine.strategy.backtest.simulation.ImmediateFill
All Implemented Interfaces:
FillPolicy

public class ImmediateFill extends Object implements FillPolicy
The DEFAULT FillPolicy: every signal fills on the same tick it was raised on — reproducing today's inline fill timing byte-for-byte. The pending queue that would call resolvePending(MarketHintSignal, Ticker) for non-immediate policies is wired in P3, so this policy never has resolvePending(MarketHintSignal, Ticker) invoked in practice.
  • Constructor Details

    • ImmediateFill

      public ImmediateFill()
  • Method Details

    • isImmediate

      public boolean isImmediate(MarketHintSignal signal)
      Description copied from interface: FillPolicy
      Returns whether the given signal fills immediately (same tick), or must be queued and resolved against a later tick.
      Specified by:
      isImmediate in interface FillPolicy
      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

      public BigDecimal resolvePending(MarketHintSignal signal, Ticker ticker)
      Description copied from interface: FillPolicy
      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 FillPolicy.isImmediate(MarketHintSignal) returned false; the pending queue that calls this is wired in P3.
      Specified by:
      resolvePending in interface FillPolicy
      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