Skip to main content

Trade Sign

Quick Reference

PropertyValue
Dimensionsignal
Categoryorder_flow
Versionv0.9.0 (Beta)
Output Columntrade_sign

Trade sign: sign(trade_price - mid_price) - infers whether a trade was buyer or seller initiated

Formula

sign((price - mid_price))

CDM Inputs

ColumnCDM TableDescription
pricecdm_*CDM source table
mid_pricecdm_*CDM source table

Parameters

This FeatureType has no configurable parameters.

Output

Column: trade_sign

Trade direction indicator: 1=buy, -1=sell, 0=at mid

Market Intuition & Trading Rationale

Trade sign classifies each trade as buyer-initiated or seller-initiated using the Lee-Ready algorithm: sign(price - mid_price). If the trade price is above the prevailing mid-price, the buyer crossed the spread (aggressive buy) — trade_sign = +1. If below mid, the seller crossed (aggressive sell) — trade_sign = -1. If exactly at mid, the direction is ambiguous — trade_sign = 0.

This is the most fundamental trade classification in market microstructure. Every volume-weighted directional metric — signed_volume, trade_flow_imbalance, VPIN, flow pressure — depends on trade_sign as its directional input. The accuracy of trade sign classification directly determines the quality of every downstream flow metric.

The Lee-Ready algorithm has known limitations: it misclassifies trades executed at the mid-point (increasingly common in dark pools and midpoint peg orders), and it can misclassify trades during fast markets where the quote and trade timestamps are not perfectly synchronized. Despite these limitations, it remains the industry standard due to its simplicity and the fact that it requires only trade price and mid-price — no order book reconstruction needed.

Usage Cases

  • Volume-weighted directional metrics: Multiply trade_sign by volume to produce signed_volume. Aggregate signed_volume over windows to measure net capital flow direction. This is the foundation of the entire order-flow signal family.
  • Trade imbalance computation: trade_flow_imbalance = buy_volume - sell_volume relies on trade_sign to partition volume into buy and sell buckets. The accuracy of trade_sign directly determines the accuracy of the imbalance measure.
  • Tick rule alternative: When mid_price is unavailable (e.g., historical data with trades only), use the tick rule (compare current trade price to previous trade price) as a fallback. trade_sign is preferred when quote data is available because it references the instantaneous mid-price rather than a lagged comparison.
  • Execution analysis: Classify your own fills by trade_sign. What fraction of your buy orders were aggressive (crossed the spread) vs passive (filled at or better than mid)? This is the starting point for execution quality analysis.

YAML Definition

name: trade_sign
description: 'Trade sign: sign(trade_price - mid_price) - infers whether a trade was
buyer or seller initiated'
category: order_flow
version: v0.9.0 (Beta)
dimension: signal
status: Pre-release
required_inputs:
- price
- mid_price
output_column: trade_sign
output_description: 'Trade direction indicator: 1=buy, -1=sell, 0=at mid'
parameters: {}
formula: sign((price - mid_price))