Class TickBacktester

java.lang.Object
com.quantfinlib.backtest.tick.TickBacktester
All Implemented Interfaces:
TickTradingContext, TickFileReader.ReplayHandler

public final class TickBacktester extends Object implements TickFileReader.ReplayHandler, TickTradingContext
Event-driven tick-level backtester: replays a captured QFLT tick file through a TickStrategy with microstructure-aware fills — the level below the bar-based engines, where queue position decides whether your passive order actually trades.

Fill model (trade-print data, no book snapshots):

  • Market orders fill instantly at the last trade price ± half the configured spread — the aggressor pays the spread.
  • Limit orders fill fully when a print trades through the limit price. Prints at the limit price accumulate: the order starts behind defaultQueueAhead simulated resting quantity and fills (partially) only as traded volume works that queue off — passive fills must be earned, not assumed.
  • Orders placed while handling a tick are eligible from the next tick, never against the print that triggered them.

Equity is sampled every equitySampleEvery ticks; metrics are computed on that sampled curve with periodsPerYear left at the bar-engine default, so compare Sharpe-style numbers only between runs with the same sampling interval.