openalgo-charts 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +15 -0
- package/README.md +78 -46
- package/dist/index.d.ts +529 -21
- package/dist/openalgo-charts.mjs +1 -1
- package/dist/openalgo-charts.mjs.map +1 -1
- package/dist/openalgo-charts.profile.mjs +1 -1
- package/dist/openalgo-charts.profile.mjs.map +1 -1
- package/dist/openalgo-charts.standalone.js +1 -1
- package/dist/openalgo-charts.standalone.js.map +1 -1
- package/dist/openalgo-charts.trade.mjs.map +1 -1
- package/dist/openalgo-charts.transform.mjs +1 -1
- package/dist/openalgo-charts.transform.mjs.map +1 -1
- package/dist/profile/index.d.ts +306 -99
- package/dist/trade/index.d.ts +40 -2
- package/package.json +3 -2
package/NOTICE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
OpenAlgo Charts
|
|
2
|
+
Copyright 2026 OpenAlgo
|
|
3
|
+
|
|
4
|
+
This product includes software developed as part of the OpenAlgo project.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License.
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
This is original, clean-room code with no third-party charting library
|
|
13
|
+
dependencies. Should any third-party (Apache-2.0 or compatibly licensed)
|
|
14
|
+
routine ever be incorporated, its copyright/license headers will be preserved
|
|
15
|
+
and an attribution to its original authors will be added to this file.
|
package/README.md
CHANGED
|
@@ -1,80 +1,112 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# OpenAlgo Charts
|
|
2
4
|
|
|
3
|
-
A from-scratch, dependency-free HTML5-canvas charting engine for OpenAlgo
|
|
4
|
-
professional-grade interactive financial-chart rendering plus advanced on-chart
|
|
5
|
-
trading and trade management. Target: **< 50 KB Brotli** for the full package.
|
|
5
|
+
**A from-scratch, dependency-free HTML5-canvas charting engine for OpenAlgo.**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Professional interactive financial charts, on-chart trading, and live data - in under 40 KB Brotli, with zero runtime dependencies.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
[](https://www.npmjs.com/package/openalgo-charts)
|
|
10
|
+
[](./LICENSE)
|
|
11
|
+
[](./ARCHITECTURE.md)
|
|
12
|
+
[](#develop)
|
|
13
|
+
[](#principles)
|
|
10
14
|
|
|
11
|
-
**https://marketcalls.github.io/openalgo-charts
|
|
15
|
+
[**Documentation**](https://marketcalls.github.io/openalgo-charts/) · [**Live examples**](https://marketcalls.github.io/openalgo-charts/examples) · [**Getting started**](./docs/getting-started.md) · [**Architecture**](./ARCHITECTURE.md)
|
|
16
|
+
|
|
17
|
+
<img src="docs/architecture-diagram.png" alt="OpenAlgo Charts - layered architecture from public API down to feeds and data, with loadable bundle tiers" width="920" />
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Live OpenAlgo trading terminal
|
|
12
24
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
Right-click the chart to place market / limit / stop orders, drag the order and TP/SL bracket lines to modify, and watch live P&L on the position line - all on real OpenAlgo history + WebSocket tick data, with an analyzer (sandbox) mode so nothing goes live until you arm it.
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="docs/trading.png" alt="OpenAlgo Charts live trading terminal: RELIANCE 5m candles with order lines, a right-click order menu, a long position with live P&L, and volume" width="920" />
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
## Examples gallery
|
|
32
|
+
|
|
33
|
+
Every chart in the [live gallery](https://marketcalls.github.io/openalgo-charts/examples) is the real library running in your browser - switch tabs, hover the crosshair, drag the order lines. What you see is the code that ran.
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img src="docs/demo1.png" alt="Chart-type switcher, custom themes, data tooltips, and event markers" width="49%" />
|
|
37
|
+
<img src="docs/demo2.png" alt="Range switcher, legend, series compare, and indicators and markers" width="49%" />
|
|
38
|
+
</p>
|
|
39
|
+
<p align="center">
|
|
40
|
+
<img src="docs/demo3.png" alt="More live OpenAlgo Charts examples" width="49%" />
|
|
41
|
+
<img src="docs/demo4.png" alt="More live OpenAlgo Charts examples" width="49%" />
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
## Install
|
|
18
45
|
|
|
19
46
|
```bash
|
|
20
|
-
npm
|
|
21
|
-
cd website && npm install && npm run dev # http://localhost:3000/openalgo-charts
|
|
47
|
+
npm install openalgo-charts
|
|
22
48
|
```
|
|
23
49
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
```ts
|
|
51
|
+
import { createChart, generateBars } from 'openalgo-charts';
|
|
52
|
+
|
|
53
|
+
const chart = createChart(document.getElementById('chart'));
|
|
54
|
+
chart.addSeries('candlestick').setData(generateBars(1700000000, 200, 3600));
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Loadable tiers - lazy-load only what you use:
|
|
58
|
+
|
|
59
|
+
| Import | Contents |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `openalgo-charts` | Base engine + all standard chart types, indicators, primitives, trading overlay |
|
|
62
|
+
| `openalgo-charts/trade` | On-chart order/position/bracket tools + DOM ladder |
|
|
63
|
+
| `openalgo-charts/transform` | Renko, Range bars, Point & Figure, Kagi, Line Break, Heikin Ashi |
|
|
64
|
+
| `openalgo-charts/profile` | Volume Profile, Market Profile (TPO), Footprint, Order flow |
|
|
36
65
|
|
|
37
66
|
## What's built
|
|
38
67
|
|
|
39
|
-
- **Chart types:** candles, hollow/volume candles, bars, high-low, line,
|
|
40
|
-
line+markers, step, area, HLC-area, baseline, columns, histogram.
|
|
68
|
+
- **Chart types:** candles, hollow/volume candles, bars, high-low, line, line+markers, step, area, HLC-area, baseline, columns, histogram.
|
|
41
69
|
- **Transforms:** Heikin Ashi, Renko, Range bars, Line Break, Point & Figure, Kagi.
|
|
42
70
|
- **Profiles & order flow:** Volume Profile, Market Profile (TPO), Footprint, cumulative delta.
|
|
43
|
-
- **Trading:** order/position/bracket lines, live P&L, one-click + drag-to-modify,
|
|
44
|
-
|
|
45
|
-
- **Live + historical** data, markers/signals, earnings/dividend events, EMA indicator.
|
|
71
|
+
- **Trading:** order/position/bracket lines, live P&L, one-click + drag-to-modify, OCO, validation, analyzer mode, and a depth-of-market ladder (5 to 200 levels).
|
|
72
|
+
- **Live + historical** OpenAlgo data (REST history + WebSocket ticks with auto-reconnect), a unified `chart.on(...)` event bus, markers/signals, earnings/dividend/expiry event markers, custom price/time formatters, and EMA/RSI/ATR/Supertrend indicators.
|
|
46
73
|
|
|
47
|
-
##
|
|
74
|
+
## Documentation
|
|
48
75
|
|
|
49
|
-
|
|
50
|
-
npm install openalgo-charts
|
|
51
|
-
```
|
|
76
|
+
Full docs, the interactive example gallery, and the generated API reference live at:
|
|
52
77
|
|
|
53
|
-
|
|
78
|
+
**https://marketcalls.github.io/openalgo-charts/**
|
|
79
|
+
|
|
80
|
+
The site is built with Nextra (in [`website/`](./website)) and statically exported to GitHub Pages on every push. Every code sample on a docs page is a *live* chart running the real library, so what you read is what runs. To run the site locally:
|
|
54
81
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
82
|
+
```bash
|
|
83
|
+
npm run build # build the library (dist/) the live demos import
|
|
84
|
+
cd website && npm install && npm run dev # http://localhost:3000/openalgo-charts
|
|
85
|
+
```
|
|
59
86
|
|
|
60
87
|
## Develop
|
|
61
88
|
|
|
62
89
|
```bash
|
|
63
90
|
npm install # install dev toolchain
|
|
64
91
|
npm run typecheck # strict TypeScript check
|
|
65
|
-
npm test # unit tests (vitest)
|
|
66
|
-
npm run build # Rollup
|
|
92
|
+
npm test # unit tests (vitest) - 297 across 39 files
|
|
93
|
+
npm run build # Rollup -> dist/ (minified ESM per tier + types)
|
|
67
94
|
npm run size # size-limit (Brotli) against the budget
|
|
68
|
-
npm run
|
|
95
|
+
npm run e2e # Playwright Chromium smoke tests
|
|
96
|
+
npm run verify # typecheck + test + build + size
|
|
69
97
|
```
|
|
70
98
|
|
|
71
99
|
## Principles
|
|
72
100
|
|
|
73
|
-
- **Single canvas pipeline** (no SVG, no DOM-per-bar)
|
|
74
|
-
- **Gapless time axis by default**
|
|
75
|
-
- **Zero runtime dependencies**
|
|
101
|
+
- **Single canvas pipeline** (no SVG, no DOM-per-bar) - small and fast.
|
|
102
|
+
- **Gapless time axis by default** - weekends, holidays, and session breaks collapse.
|
|
103
|
+
- **Zero runtime dependencies** - nothing is excluded from the size budget.
|
|
76
104
|
- **Apache-2.0**, original code.
|
|
77
105
|
|
|
106
|
+
## Status & limitations
|
|
107
|
+
|
|
108
|
+
Version **1.0.1 (published)** - all engine build phases are implemented with 297 unit tests, base engine ~24 KB Brotli, full package ~38 KB Brotli (all tiers). The OpenAlgo WS/trade adapters ship and auto-reconnect, but their exact message/endpoint schemas should be verified against your running OpenAlgo build. Overlay and `indexed-to-100` price scales are not yet implemented - see [`ARCHITECTURE.md`](./ARCHITECTURE.md) for the honest deferred list.
|
|
109
|
+
|
|
78
110
|
## License
|
|
79
111
|
|
|
80
|
-
[Apache-2.0](./LICENSE).
|
|
112
|
+
[Apache-2.0](./LICENSE). See [`NOTICE`](./NOTICE).
|