Trading

Footprint

Order-flow footprint chart. Each candle is expanded into price-level rows showing bid (sell-initiated) volume against ask (buy-initiated) volume. Cells are shaded by volume, diagonal imbalances are outlined, and the per-candlePOC is boxed.

Preview

Fullscreen

Profile mode

Set mode="profile" for a divergent volume-profile per candle — bid bars left, ask bars right.

Fullscreen

Source

Copy this file to components/trading/footprint.tsx

tsx
'use client'

import * as React from 'react'
import { cn } from '@/lib/utils'

export interface FootprintPriceLevel {
  price: number
  bidVolume: number
  askVolume: number
}

export interface FootprintCandle {
  time: number
  open: number
  high: number
  low: number
  close: number
  levels: FootprintPriceLevel[]
}

export interface FootprintProps {
  candles: FootprintCandle[]
  mode?: 'numbers' | 'profile'
  priceDecimals?: number
  imbalanceRatio?: number
  showPOC?: boolean
  tickSize?: number
  width?: number
  height?: number
  className?: string
}

// Canvas footprint chart with two modes. 'numbers': each candle is a column of
// price-level rows showing bid (left) vs ask (right) volume, intensity-shaded,
// with diagonal imbalance outlines. 'profile': a divergent volume-profile per
// candle (bid bars left, ask bars right). Both box the per-candle POC.

Props

PropType
candles*FootprintCandle[]
mode'numbers' | 'profile'
priceDecimalsnumber
imbalanceRationumber
showPOCboolean
showDeltaboolean
tickSizenumber
widthnumber
heightnumber
classNamestring