mmt-tradingview-charts

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MMT + TradingView Lightweight Charts

MMT + TradingView Lightweight Charts

Rules for building charting applications that render MMT market data using TradingView Lightweight Charts (v5.x).
使用TradingView Lightweight Charts(v5.x版本)渲染MMT市场数据的图表应用构建规则。

Chart Setup

图表设置

  • Chart Initialization: createChart config, container setup, autoSize, dark/light themes
  • Data Mapping: transform MMT types (OHLCVTPublic, etc.) to Lightweight Charts format
  • 图表初始化:createChart配置、容器设置、自动尺寸、深色/浅色主题
  • 数据映射:将MMT数据类型(如OHLCVTPublic等)转换为Lightweight Charts格式

Real-Time Updates

实时更新

  • Live Candlestick Updates: WS candle stream to series.update(), handling candle close vs in-progress
  • Live Trade Ticker: WS trade stream to line/marker overlays, trade volume histogram
  • 实时K线更新:通过WebSocket K线流调用series.update(),处理K线收盘与未完成状态
  • 实时交易行情:通过WebSocket交易流实现折线/标记叠加层、成交量柱状图

Multi-Chart Patterns

多图表模式

  • Multi-Pane Layout: price + volume + indicator panes, synchronized time scales
  • Multi-Symbol Comparison: overlay multiple symbols, normalize price scales
  • 多面板布局:价格+成交量+指标面板,时间轴同步
  • 多标的对比:叠加多个交易标的,价格轴归一化

Indicators & Overlays

指标与叠加层

  • Volume Histogram: buy/sell volume from MMT candles as colored histogram
  • Funding Rate Overlay: stats channel funding rate as line/baseline series
  • Open Interest Overlay: OI candles as area/line on separate pane
  • 成交量柱状图:将MMT K线中的买/卖成交量生成分色柱状图
  • 资金费率叠加层:统计频道资金费率作为折线/基准线系列
  • 持仓量叠加层:持仓量K线在独立面板中显示为区域图/折线图

Data Management

数据管理

  • Historical Data Loading: REST fetch to setData, pagination for long ranges, loading states
  • Timeframe & Symbol Switching: clear stores, flush timers, reload on tf/symbol/exchange change
  • 历史数据加载:通过REST接口获取数据并调用setData,长范围数据分页处理,加载状态管理
  • 时间周期与标的切换:清空存储、刷新定时器,切换时间周期/标的/交易所时重新加载数据

Interaction

交互功能

  • Crosshair & Tooltips: subscribeCrosshairMove, custom tooltip with MMT data fields
  • Chart Lifecycle: React/framework integration, cleanup, resize, memory management
  • 十字光标与工具提示:订阅crosshairMove事件,自定义包含MMT数据字段的工具提示
  • 图表生命周期:React/框架集成、资源清理、尺寸调整、内存管理

Framework Integration

框架集成

  • React Integration Patterns: hooks, refs, lifecycle, state management, performance patterns
  • React集成模式:Hooks、Refs、生命周期、状态管理、性能优化方案