HQChart: a JavaScript and Python K-line charting library with a TDX-style indicator engine
HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据替换接口
At a glance
- What is it?
- HQChart ports a domestic Chinese PC trading client to JavaScript and Python, shipping both a canvas K-line renderer and a Mai/analyst-syntax indicator executor. It is a rendering and calculation library, not a data source.
- Who is it for?
- Adopt HQChart if you already have a licensed market data feed and need a canvas K-line renderer with TDX-style indicator scripts running in the browser, a worker, Node or Python. Do not adopt it as a data source: the README states the built-in test data interface was stopped for security reasons and that all quotes shown in the demos come from the internet or fake test data.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 35 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 25, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What HQChart actually ships, and who it is for
HQChart describes itself as the first project to port a traditional domestic PC stock client, originally written in C++, to JS and Python. That origin explains the feature list: forward and backward adjustment, daily, weekly, monthly, yearly and minute bars, hollow and filled candles, American bars, close-price lines, stock overlay on the main chart, and drawing tools that include Gann angles, speed lines, Fibonacci time zones and parallel channels. The README also lists more than 80 built-in indicators (MA, BOLL, MACD, KDJ, VOL, RSI, BRAR, WR, BIAS, OBV, DMI, CR, PSY, CCI, DMA, TRIX, VR, EMV, ROC) plus more than 30 colorful-candle patterns and an expert-system indicator mode.
The audience is narrow and specific. This is for teams building a Chinese-market terminal or a mini program who already hold a quote feed and need the rendering layer plus an indicator scripting layer on top of it. The project covers stocks, futures, digital currencies and forex, so the instrument type is not the constraint. The constraint is that HQChart supplies no market data. The README states plainly that the project only provides a charting library and a Mai-syntax script executor, that all quotes in the pages come from the internet or from fake test data, that their correctness is not guaranteed, and that anyone with a data problem should buy licensed quotes from the exchange. Treat that as the boundary of the product.
How the chart, the worker and the indicator engine fit together
The repository is split by runtime rather than by feature. webhqchart holds the browser JavaScript, wechathqchart holds the WeChat mini program module, vuehqchart holds Vue components with image resources and CSS under umychart.resource, and umychart_uniapp_h5 covers the uniapp target. Indicator calculation exists in three separate places: umychart_python for the Python port of the analyst syntax, umychart_indexapi as a Node.js backend calculation demo that includes Docker packaging files, and a C++ indicator engine directory at the top level. The README points to a separate repository, hqchartPy2, for a C++ implementation exposed to Python through CPython, intended for backtesting and batch stock screening where indicator evaluation runs over many symbols.
The data flow is the part worth understanding before you start. HQChart renders what you hand it and computes indicators over that series. The README notes that indicator computation can run in a front-end worker thread, which keeps the drawing path free while scripts evaluate. Data arrives through a replacement interface: the README points third-party data integration at the HQChart-Super repository and says the full quote panel demo is pure front end and needs the HQChartData plugin installed. There is also a single-indicator, single-stock front-end backtest in webhqchart/umychart.regressiontest.js, which the README says produces trade counts, total days, success and fail counts, maximum and minimum run length, total profit, per-stock profit, excess return, maximum drawdown, beta, and a net value series with date, net value, stock close and index close. That is a per-symbol calculation, not a portfolio backtester.
Installing HQChart from npm and drawing a first K-line chart
The README gives npm as the install path, with jQuery installed alongside it. Run both commands from your project root:
npm install jquery
npm install hqchartThe package page is npmjs.com/package/hqchart. For Vue and React there are separate walkthroughs in the repository's tutorial directory, demo-vue.md and demo-react.md. The mini program and uniapp builds are not installed this way; the README links the uniapp plugin through the DCloud plugin registry, with a new plugin entry and an older manual-import entry.
The step people get wrong is the next one. There is no bundled data service to point the chart at. The README states that the built-in test data interface was stopped for security reasons, and that if you need data integration you should follow the third-party example in HQChart-Super. It also notes that the code uses ES6 features, so older browsers will not render it without a Babel pass to ES5. A minimal local loop therefore looks like this: install the package, wire your own quote endpoint, and feed the series into the chart. The repository's own demo pages under webhqchart.demo are the reference for the shape of that call, including samples/kline_index_edit.html and the order-flow samples the README links by URL.
The data problem is the adoption problem
Most charting libraries are judged on rendering. HQChart is judged on rendering plus a scripting language, and the scripting language is where the real value sits: analyst syntax and TDX syntax indicators mean existing Chinese indicator formulas can be reused rather than rewritten. The cost is that the project is deliberately incomplete as a product. The README's disclaimer is unusually blunt, saying the project provides only the chart library and the Mai-syntax executor, that quotes come from the internet or are fake test data, that correctness is not guaranteed, and that data problems are unrelated to the project. There is no fallback feed to prototype against, because the built-in test interface was shut down.
The second limitation is platform divergence. The README marks interval statistics and interval pattern matching as unsupported in the WeChat mini program version. A feature list that reads as one product is in fact several builds with different capability sets, and the mini program build is the one with documented omissions. The third is browser baseline: ES6 output plus an explicit note that older browsers need Babel. If your audience includes embedded webviews in older Android shells, budget for that transpile step and test it, because the README only tells you the problem exists, not which browsers pass.
Where HQChart is the wrong tool: if you want a drop-in chart with a hosted data feed, this is not it. If you need a portfolio-level backtester, the included backtest is single-indicator and single-stock. And if you need documented rollback or upgrade procedures, the README does not document them.
HQChart against TradingView's lightweight-charts and KLineChart
The nearest alternatives people search for are TradingView's lightweight-charts and KLineChart. The difference is scope, not quality. lightweight-charts is a rendering library: you give it OHLCV series and it draws them, and indicator values are computed by you or by a separate library. HQChart bundles the indicator executor, so a TDX or analyst-syntax formula can be evaluated in the browser or in a worker without you writing the math. That is the whole reason to pick it, and also the reason it is heavier: you inherit a scripting engine, a resource directory of images and CSS, and per-runtime builds.
KLineChart sits closer to HQChart in that it targets K-line rendering for Chinese and crypto markets, but the README's feature inventory is the thing to compare line by line, because HQChart's list is unusually long: chip distribution charts, OX charts, depth charts, order flow in three layouts, Danmaku overlay, screenshot export, multi-indicator overlay, draggable indicator panes, Y-axis drag zoom, and per-bar data auto-update for daily and minute series. If you need three of those, the comparison stops being about size and starts being about how many libraries you would otherwise stitch together. If you need none of them, the extra surface is cost with no return.
Licence, maintenance and what an upgrade costs you
The repository carries Apache-2.0, and the README links both a user agreement file in the repository root and a separate article titled commercial use notes and user agreement. Read both before shipping anything commercial; Apache-2.0 is the code licence, and the project publishes an additional agreement that may add conditions the licence text alone does not describe. This is not legal advice, and the two documents are the authoritative source.
On maintenance: the last push to the repository was on 2026-08-27, so the codebase is being touched. Release tags tell a different story. The three most recent releases listed are v1.11464 from 2022-10-19, v1.10723 from 2022-02-28, and v1.10697, labelled a stable version, from 2022-02-12. No release has been tagged since 2022 even though commits continue, which means the npm package and the repository head are not obviously the same thing. Check which commit the published npm version corresponds to before you plan an upgrade, and pin the version you test against rather than tracking the branch.
Editorial conclusion
Adopt HQChart if you already have a licensed market data feed and need a canvas K-line renderer with TDX-style indicator scripts running in the browser, a worker, Node or Python. Do not adopt it as a data source: the README states the built-in test data interface was stopped for security reasons and that all quotes shown in the demos come from the internet or fake test data. Before committing, verify on a real device which features your target platform actually supports, since the README marks interval statistics and pattern matching as unavailable in the WeChat mini program version.
Frequently asked questions
Does HQChart include market data, or do I need my own feed?
You need your own feed. The README states the project provides only the charting library and the Mai-syntax indicator executor, that the built-in test data interface was stopped for security reasons, and that quotes in the demo pages come from the internet or from fake test data and are for development debugging only.
How do I install HQChart in a web project?
The README gives npm as the install path, with jQuery installed alongside it: npm install jquery and npm install hqchart. Vue and React walkthroughs live in the repository's tutorial directory as demo-vue.md and demo-react.md. The mini program and uniapp builds are distributed separately, not through this npm package.
Which platforms does HQChart support, and are all features available on each?
The README lists js, vue2.0, vue3.0, uniapp and mini program as supported platforms, with indicator execution available in js, nodejs, py, c# and c++. Feature sets differ: interval statistics and interval pattern matching are marked as unsupported in the WeChat mini program version.
Can I run HQChart indicator calculations on the server or in Python?
Yes. The repository contains umychart_python for the Python port of the analyst syntax and umychart_indexapi as a Node.js backend calculation demo with Docker packaging files. The README also points to hqchartPy2, a C++ engine exposed to Python through CPython, aimed at backtesting and batch screening where indicators are computed over many symbols.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/jones2000-hqchart)