Academy

QQ 301 Reference

How the terminal tests a strategy

Course description

This is reference material, written by reading the terminal's source. It is long and exact, and it works better for looking things up than for reading from start to finish.

Every formula and default cites a file and line in the terminal's code. The terminal's source is not public yet, so those references are there for when it is. Where the tool has a known limit, the text states it with the measured number.

If you want the short version first, read "All 49 checks at a glance", then come back to the chapter on validation for the maths.

What you will be able to do

  • Follow how the terminal turns a strategy file into trades
  • Read each cost option and what it charges
  • Reproduce the headline statistics from their formulas
  • Explain what each of the 49 validation checks tests and what bar it has to clear
  • Know what the tool does not model

Syllabus

  1. Chapter 1How a backtest runs here A strategy is an ordinary Python file. There is no framework, no base class and nothing to import from the terminal. The engine executes the file with three names already defined and reads one name back when it finishes.5 min
  2. Chapter 2Fills and costs Every cost option defaults to off. A run with no cost options fills at the bar open for free. Nothing here is charged unless you set it (or run the "realistic" preset in 2.10).8 min
  3. Chapter 3The statistics All of these come from one function, run after the trades are accounted. Key names are the ones the API returns.4 min
  4. Chapter 4Validation, check by check A single backtest is one sample, at one parameter setting, with whatever costs were typed in. Validation reruns and resamples it to say how much was luck.29 min
  5. Chapter 5Data .qqx is the QubitQuant market-data archive format. One file holds one symbol's ticks or bars for one year. Prices are stored as integers (the price times 10^digits) in independent blocks. Within a block each column is delta-coded, the deltas are cut into quantile bins, the bin numbers are entropy-coded (rANS) and the offsets inside a bin are bit-packed. A file is: a header (magic QQX1, version, record kind, digits, a volumes flag, the symbol and a source string), the blocks, an index (per block: first timestamp, record count, byte offset, byte length) and a 56-byte footer (index position, time span, record count, an xxh64 value, the magic again). Timestamps are Unix milliseconds. Because blocks are independent, reading a date range decodes only the blocks that overlap it.6 min
  6. Chapter 6Parameter glossary Every option and input a user can set for a backtest or a validation. "Run option" means a key in the options object.6 min
  7. Chapter 7What the tool does not model Each line is a statement about the code as written.3 min
  8. Chapter 8Added on 2026-10-07: full-history validation and the portfolio tools These landed after sections 1 to 7 were written. Where they change an earlier statement, this section wins.4 min
  9. Chapter 9All 49 checks at a glance Every check the validation suite runs, grouped by the question it answers, with the bar each one has to clear.1 min