Introduction

The core design philosophy of DeepSeek Harness (DSH) is that “everything is a plugin”. When developing agents or toolchains, outputting visualized data directly in the conversation flow is more informative than returning plain text alone. The ikomom/dsh-trade-chart plugin solves the need to render financial charts directly in a DSH environment. It embeds K-line, line, bar, and heatmap components in the conversation using pure custom-drawn SVG, without relying on any external chart library.

Plugin Overview

The plugin is maintained by developer ikomom, is classified as a client plugin, and is released under the MIT open-source license. It does not rely on existing browser chart libraries; instead, it includes complete drawing logic and can handle multiple data display formats, including K-line charts, technical indicators, sector rotation matrices, and ladder promotion charts.

Installation

Before installation, ensure that your DeepSeek Harness environment is correctly configured. Depending on your deployment method, execute one of the following three commands:

# 方式一:本地路径安装(Windows 示例,请替换为你的真实路径)
dsh plugin --profile web add link:D:\你的真实路径\dsh-trade-chart

# 方式二:直接从 Git 安装(推荐)
dsh plugin --profile web add git+https://github.com/ikomom/dsh-trade-chart.git

# 方式三:通过 NPM 包安装(发布后可用)
dsh plugin --profile web add @ikonon/dsh-trade-chart

After installation, restart the dsh web process and refresh the page to make it take effect.

Core Features

The plugin mainly provides the following chart rendering capabilities:

  • K-line chart: Supports candlestick charts with red for rises and green for drops, including a volume subchart and MA moving averages with customizable periods.
  • Technical indicators:
    • Main chart indicators: EMA (custom periods), BOLL Bands (band filling).
    • Subchart indicators: MACD (DIF/DEA/histogram), RSI (30/70 overbought/oversold zones), KDJ.
    • Volume indicators: volume bars, MAVOL average volume line.
  • Basic charts: Supports line, bar, and area charts, with multi-series comparison, legend display, and hover tooltips.
  • Special charts:
    • Hotspot rotation matrix: A two-dimensional matrix of sectors and dates, colored with red for rises and green for drops.
    • Ladder promotion chart: A ladder chart of board counts and dates, showing the number of stocks and automatically calculated promotion rates.
  • Annotations and interaction: Supports automatic annotation of swing highs/lows with pivots, and free annotations (trend lines, arrows, rectangles, etc.). Interaction supports wheel zoom (Y-axis locked), drag panning, double-click reset, and crosshair cursor.

Usage

The plugin invokes the trade_chart tool in the conversation to render charts. The following are the main parameter descriptions.

Chart Types

Specify the chart shape via chart.type; supported values include kline (K-line), line (line), bar (bar), area (area), heatmap (heatmap), and ladder (ladder promotion chart).

K-Line Chart Parameters

If type is kline, you need to pass the kline array (OHLCV format) and the indicators object.

{
  "chart": {
    "type": "kline",
    "title": "示例日K",
    "symbol": "600519.SH",
    "period": "日K",
    "kline": [
      {
        "time": "2026-07-19T16:00:00Z",
        "open": 1270,
        "high": 1329,
        "low": 1266,
        "close": 1327.5,
        "volume": 106151
      }
    ],
    "indicators": {
      "ema": [12, 26],
      "boll": true,
      "mavol": [5, 10],
      "macd": true,
      "rsi": [6, 12, 24],
      "kdj": true
    },
    "pivots": true
  }
}

Hotspot Rotation Matrix Parameters

If type is heatmap, you need to pass the heatmap object.

{
  "chart": {
    "type": "heatmap",
    "title": "热点轮动",
    "heatmap": {
      "rows": ["AI算力", "机器人"],
      "categories": ["07-01", "07-02"],
      "values": [[5.2, 3.1], [-1.5, 2.3]],
      "unit": "%"
    }
  }
}

Ladder Promotion Chart Parameters

If type is ladder, you need to pass the ladder array.

{
  "chart": {
    "type": "ladder",
    "title": "连板晋级",
    "ladder": [
      {
        "date": "2026-07-01",
        "boards": [
          { "level": 1, "count": 42 },
          { "level": 2, "count": 9 },
          { "level": 3, "count": 3, "stocks": ["中际旭创", "新易盛"] }
        ]
      }
    ]
  }
}

Free Annotations

Custom annotations are supported via the annotations array, including high/low points, horizontal lines, trend lines, arrows, rectangles, and notes.

Data and Indicator Notes

  • Data location: Supports locating data points by time (timestamp) or i (zero-based index), and supports adding a color property.
  • Indicator calculation logic:
    • MACD: The histogram is calculated as 2 × (DIF - DEA).
    • RSI: Uses SMA (simple moving average) smoothing.
    • KDJ: Default parameters are (9, 3, 3).
  • Heatmap coloring: Follows the A-share convention: red for rises and green for drops, 0 values are neutral on the diverging scale, and null values are shown as gray blocks.
  • Ladder promotion logic:
    • The vertical axis is board count, and the horizontal axis is date.
    • The client automatically calculates the promotion rate (today’s quantity ÷ yesterday’s previous board quantity).
    • Cells with a promotion rate ≥ 50% are marked red.
    • When the board is high (few stocks), specific stock names are listed directly in the cell.

Caveats

  1. Performance limit: When K-line data exceeds 800 bars, it is automatically aggregated; if it exceeds 5,000 bars, rendering is rejected.
  2. Rendering method: All charts are rendered with pure SVG and do not depend on external chart libraries, ensuring lightweight operation.
  3. Permission dependency: The plugin runs in the DSH client environment. Before installation, check the source code and license (MIT).