Skip to main content

Depth

The Depth module provides a market depth (order book) visualization panel that displays bid and ask orders at various price levels. It shows real-time liquidity information for the current symbol.

Key Features

  • Real-time market depth visualization
  • Bid/ask order display with quantities
  • Price level highlighting
  • Depth chart visualization
  • Order book statistics (total bids/asks, spread)
  • Historical depth data analysis

Architecture / Behavior

The Depth module is implemented as a right sidebar panel that subscribes to depth data through the data feed's subscribeDepth method. It receives DepthData objects containing bid and ask arrays and renders them in a hierarchical format showing price levels and order quantities.

API Usage

Initialization

The Depth module is enabled by default in the chart configuration:

const chart = Chart.create(document.getElementById('container'), {
// ... other options
enabled_features: ['depth'], // Enable depth panel
});

Methods

// Subscribe to depth data
chart.subscribeDepth((depth) => {
console.log('Market depth:', depth);
});

// Unsubscribe from depth data
chart.unsubscribeDepth(subscriberUID);

Configuration Options

OptionTypeDefaultDescription
enabled_featuresstring[]['depth']Enable/disable the depth panel
depth_max_levelsnumber10Maximum number of price levels to display
depth_show_total_volumebooleantrueShow total bid/ask volume

Events

The Depth module emits events through the GlobalStore:

  • depth:loaded - When depth data is initially loaded
  • depth:updated - When new depth data is received
  • depth:changed - When significant depth changes occur

Customization

  • Depth visualization can be customized via CSS classes
  • Price level formatting can be customized using the price_format option
  • Color scheme can be customized via theme configuration

Use Cases

  • Monitoring market liquidity
  • Identifying support/resistance levels
  • Detecting large orders (iceberg detection)
  • Analyzing order flow
  • High-frequency trading strategy development

Limitations

  • Requires data feed implementation of subscribeDepth, unsubscribeDepth, and related methods
  • Limited to depth data supported by the connected data provider
  • No built-in depth analytics or pattern recognition

✅ Supported

  • Real-time market depth visualization
  • Bid/ask order display
  • Depth chart visualization
  • Order book statistics

❌ Not Supported

  • Depth prediction or forecasting
  • Advanced order flow analysis
  • Multi-symbol depth comparison

⚠️ Partial / Custom

  • Advanced depth analytics require custom implementation
  • Depth historical analysis requires custom data feed implementation

Integration

This module should be linked from:

  • Charting section → Right Sidebar Panels
  • Advanced Features → Modules
  • API Reference → Data Feed Interface