Skip to content
All library documents

Building an Efficient Tick-Based Intraday Backtest with Realistic Accounting

Article BigQuant

Summary

This article outlines a backtest framework for high-frequency strategies, organized around data preparation, signal generation, trade accounting, and performance reporting. It aggregates tick data into ten-second bars, derives moving averages with rolling calculations, and converts decision data to arrays to reduce processing overhead. The example strategy enters long or short on a fast and slow moving-average crossover and exits after a fixed holding period.

The accounting section models fills using the next bar’s opposing quote, charges fees, and distinguishes opening positions from closing them, including the price movement within the fill bar. Results are then aggregated to daily returns and common risk and performance measures. The example is deliberately simple and loses money; it is presented to explain the framework, not to establish an investable signal. Its fill-price and liquidity assumptions are approximations, and reported runtime covers a limited sample of 17 trading days and more than 35,000 decision points.

Key ideas

  • The framework separates data preparation, strategy logic, trade accounting, and reporting.
  • Tick data is aggregated into ten-second bars, while rolling calculations and arrays support faster processing.
  • The example trades moving-average crossovers and closes positions after a fixed holding period.
  • Fill assumptions, fees, and within-bar price movements are included in profit and loss accounting.
  • The sample strategy loses money and the backtest covers a limited period, so it demonstrates mechanics rather than profitability.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.