Skip to main content

Cumulative Depth Slope

Quick Reference

PropertyValue
Dimensionsignal
Categoryorder_flow
Versionv1.0
Output Columndepth_slope

Slope of cumulative depth across order book levels 鈥?measures depth decay rate

Formula

diff(order_book_depth, 1)

CDM Inputs

ColumnCDM TableDescription
order_book_depthcdm_lob_snapshotOrder book snapshot data 鈥?depth levels, bid/ask prices and sizes

Parameters

ParameterTypeDefaultDescription
levelsinteger20Number of levels for slope estimation

Output

Column: depth_slope

Rate of depth decay across levels

Market Intuition & Trading Rationale

Cumulative depth slope measures how depth changes from one level to the next: diff(order_book_depth, 1). A flat or positive slope means depth is consistent or increasing across levels 鈥?the book is deep and resilient. A steep negative slope means depth decays rapidly away from the touch 鈥?the visible depth at the touch is misleading; deeper levels are thin. This captures the shape of the order book, which is more informative than total depth alone.

Usage Cases

  • Book shape assessment: Flat slope = deep, resilient book (good for large orders). Steep negative slope = shallow book beyond the touch (large orders will walk quickly). Trade size should reflect the slope.
  • Spoofing detection: A sudden change from flat to steep negative slope may indicate spoofing 鈥?large orders at the touch are canceled, revealing the true thin depth underneath.
  • context: Used in depth_imbalance pack 鈥?slope captures the structure of depth, complementing the level measured by depth_imbalance.

YAML Definition

name: cumulative_depth_slope
description: Slope of cumulative depth across order book levels 鈥?measures depth decay
rate
category: order_flow
dimension: signal
version: v0.9.0 (Beta)
required_inputs:
- order_book_depth
output_column: depth_slope
output_description: Rate of depth decay across levels
tags:
- depth
- orderbook
- signal
parameters:
levels:
type: integer
description: Number of levels for slope estimation
required: false
default: 20
formula: diff(order_book_depth, 1)