fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Trade Classification

4 algorithms in Market Microstructure.

In this family#

  1. Tick Test contract

    Signs a trade buyer- or seller-initiated by comparing its price with the previous trade. The cheapest classifier and the least accurate — it needs no quote data, which is exactly why it is still used on historical tapes that have none.

    tickTest(data, config)
  2. Quote Test contract

    Signs a trade by which side of the prevailing midpoint it executed on. More accurate than the tick test where quotes exist, and undefined for trades exactly at the midpoint — which is where the Lee-Ready hybrid earns its place.

    quoteTest(data, config)
  3. Lee-Ready Trade Signing contract

    The standard hybrid: quote test where the trade is away from the midpoint, tick test at it. The classification most empirical microstructure results are built on, so reproducing them requires this rule specifically.

    leeReady(data, config)
  4. Bulk Volume Classification contract

    Assigns a *fraction* of each volume bar to buyers rather than signing individual trades. Designed for aggregated data where trade-level signing is impossible, and the input to VPIN.

    bulkVolumeClassification(data, config)

What they share#

Every topic here is a record-transform, so once you have called one the rest follow the same shape. Import paths differ only in the final segment:

ts
import { tickTest } from "fintech-algorithms/market-microstructure/trade-classification/tick-test";
import { quoteTest } from "fintech-algorithms/market-microstructure/trade-classification/quote-test";

Read them in the order above — the sequence is pedagogical, not alphabetical.

Where this sits#

Market Microstructure collects 29 algorithms across 5 families. For the concept behind this family rather than the call signatures, see the concept guides.