Skip to content

omdsh-dev/dsh-longbridge

40Last commit Aug 13, 2026

dsh-longbridge DSH plugin

dsh-longbridge integrates Longbridge's OpenAPI to provide real-time quotes, K-line data, indices, watchlists, account details, and order placement/cancellation within DSH. It requires a Longbridge account, developer credentials, and manual approval for trading tools. The plugin also adds a settings section and an experimental right-side market panel.

How to install the dsh-longbridge DSH plugin

dsh plugin --profile web add link:/absolute/path/to/dsh-longbridge

Copying does not run this command. Review the repository and version before installing the dsh-longbridge DSH plugin.

dsh-longbridge DSH plugin data source

dsh-longbridge DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-longbridge DSH plugin can do

  • Real-time stock quotes for Hong Kong and US markets (up to 20 symbols per request)
  • K-line data with multiple timeframes (1m to year, up to 500 bars)
  • Major index tracking (HSI, HSTECH, DJI, SPX, NDX)
  • Watchlist management (list, add, remove)
  • Account balance and positions overview
  • Place and cancel orders (limit price validation, mandatory approval)
  • Market status and trading session info

Where the dsh-longbridge DSH plugin fits

  • Monitor real-time Hong Kong and US stock prices during trading hours
  • Analyze historical K-line patterns for technical analysis
  • Manage a watchlist of favorite stocks and track their performance
  • Check account cash, net asset, and margin details
  • Execute trades with pre-approval flow for risk control

Who the dsh-longbridge DSH plugin is for

  • Hong Kong and US stock investors using Longbridge securities
  • Quantitative traders who need automated data and trading tools within DSH

dsh-longbridge DSH plugin limitations

  • Requires Longbridge account and developer certification (App Key/Secret/Access Token)
  • Trading tools (place/cancel order) must go through DSH approval channel each time; non-allowed-once requests are rejected
  • Market data and trading permissions must be enabled separately on Longbridge developer platform
  • Right-side market panel is experimental and disabled by default
  • Quote rate limit: 10 req/s, concurrency 5; trade rate limit: 30 req/30s with 20ms minimum interval

dsh-longbridge DSH plugin: from the repository README

Quoted from the omdsh-dev/dsh-longbridge README, the upstream source of the dsh-longbridge DSH plugin. Copyright remains with the original authors.

DSH 长桥(Longbridge)港美股数据接入插件:券商级行情、账户与交易工具 + 设置页凭据管理。 ## 定位 - **港美股**(`700.HK` / `AAPL.US` 格式)+ **券商级能力**(持仓/下单/账户),数据源为 [Longbridge OpenAPI](https://open.longbridge.com)(`longbridge` npm SDK,App Key/Secret 认证)。 - 与 `dsh-stock-market` 差异化:它覆盖沪深 A 股免费公开源;本插件覆盖港美股与券商级数据。 - 交易工具**强制确认**:`longbridge_place_order` / `longbridge_cancel_order` 每次调用都过 DSH 审批通道(`tools/pre-execute` → approval),非 `allowed-once` 一律拒绝。 ## 硬前置:凭据门槛 1. 在长桥 App 完成**开户**; 2. 登录 open.longbridge.com 开发者平台完成**开发者认证 / OpenAPI 权限申请**; 3. 行情权限与交易权限**分别开通**(免费;港股实时订阅级别、美股期权数据有单独条件); 4. 在用户中心取得 **App Key / App Secret / Access Token** 三件套,填入 设置 → 长桥。 凭据只写入 DSH 凭据保险箱(`ctx.credentials`,本地 `$DSH_HOME/.credentials.yaml`), 不进入 settings 文档、日志或会话内容;环境变量 `LONGBRIDGE_APP_KEY` / `LONGBRIDGE_APP_SECRET` / `LONGBRIDGE_ACCESS_TOKEN` 提供时优先(只读遮蔽)。 ## 工具清单(9 个,按开关分组) | 分组 | 工具 | 说明 | |---|---|---| | 行情(默认开) | `longbridge_quote` | 实时快照(≤20 代码) | | | `longbridge_kline` | K线(1m…year,≤500 根,前/不复权) | | | `longbridge_indices` | 港美主要指数(HSI/HSTECH/DJI/SPX/NDX…) | | | `longbridge_watchlist` | 券商自选分组 list/add/remove | | | `longbridge_market_status` | 当日交易时段 | | 账户(默认关) | `longbridge_account` | 资金总览(现金/净资产/保证金) | | | `longbridge_positions`

Read the full READMERepository license: BSD-3-Clause

dsh-longbridge DSH plugin questions

How do I install dsh-longbridge?

You can install it by running `dsh plugin --profile web add link:/absolute/path/to/dsh-longbridge` from the local repo, or from a published npm/git source. After installation, refresh the DSH web GUI at http://127.0.0.1:3080 to see the Longbridge settings section and tools.

What credentials do I need to use this plugin?

You need an App Key, App Secret, and Access Token from the Longbridge developer platform (open.longbridge.com). You must have a Longbridge account and complete developer certification. These credentials are stored in DSH's credential vault, not in settings or logs.

How do I enable trading tools?

Trading tools (place_order, cancel_order) are disabled by default. Go to Settings → Longbridge and toggle the 'Trading' group on. Even when enabled, each order execution will still require manual approval through DSH's pre-execute approval channel.

Can I use the right-side market panel?

The right-side market panel is experimental and disabled by default. You can enable it in Settings → Longbridge → Experimental: Right-side Market Panel. It refreshes index snapshots every 5 seconds and adjusts layout using the CSS variable --dsh-longbridge-panel-width.

What are the rate limits for the API calls?

Quote endpoints have a limit of 10 requests per second with concurrency 5 (handled by the SDK). Trade endpoints are limited to 30 requests per 30 seconds with a minimum interval of 20ms enforced by the plugin's TradeThrottle. Historical K-line data has a monthly quota per unique symbol (100–3000 depending on asset tier), while real-time K-lines and snapshots are not quota-limited.