openalgo-charts 2.5.10 → 2.6.0

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.
Files changed (59) hide show
  1. package/README.md +35 -34
  2. package/dist/draw/index.d.ts +395 -403
  3. package/dist/index.d.ts +3208 -2526
  4. package/dist/indicators/index.d.ts +229 -60
  5. package/dist/openalgo-charts.draw.mjs +1 -1
  6. package/dist/openalgo-charts.draw.mjs.map +1 -1
  7. package/dist/openalgo-charts.draw.standalone.js +1 -0
  8. package/dist/openalgo-charts.indicators.mjs +1 -1
  9. package/dist/openalgo-charts.indicators.mjs.map +1 -1
  10. package/dist/openalgo-charts.indicators.standalone.js +1 -0
  11. package/dist/openalgo-charts.mjs +1 -1
  12. package/dist/openalgo-charts.mjs.map +1 -1
  13. package/dist/openalgo-charts.profile.mjs +1 -1
  14. package/dist/openalgo-charts.profile.mjs.map +1 -1
  15. package/dist/openalgo-charts.profile.standalone.js +1 -0
  16. package/dist/openalgo-charts.standalone.js +1 -1
  17. package/dist/openalgo-charts.standalone.js.map +1 -1
  18. package/dist/openalgo-charts.trade.mjs +1 -1
  19. package/dist/openalgo-charts.trade.mjs.map +1 -1
  20. package/dist/openalgo-charts.trade.standalone.js +1 -0
  21. package/dist/openalgo-charts.transform.mjs +1 -1
  22. package/dist/openalgo-charts.transform.mjs.map +1 -1
  23. package/dist/openalgo-charts.transform.standalone.js +1 -0
  24. package/dist/openalgo-charts.webgl.mjs +1 -1
  25. package/dist/openalgo-charts.webgl.mjs.map +1 -1
  26. package/dist/openalgo-charts.webgl.standalone.js +1 -0
  27. package/dist/openalgo-charts.widget.chart-data-export-dialog-CX6h5-cp.mjs +2 -0
  28. package/dist/openalgo-charts.widget.chart-data-export-dialog-CX6h5-cp.mjs.map +1 -0
  29. package/dist/openalgo-charts.widget.grid-bar-Cm_CyA2j.mjs +2 -0
  30. package/dist/openalgo-charts.widget.grid-bar-Cm_CyA2j.mjs.map +1 -0
  31. package/dist/openalgo-charts.widget.grid-menus-CPZWEiD3.mjs +2 -0
  32. package/dist/openalgo-charts.widget.grid-menus-CPZWEiD3.mjs.map +1 -0
  33. package/dist/openalgo-charts.widget.layouts-menu-B7XYKPAW.mjs +2 -0
  34. package/dist/{openalgo-charts.widget.layouts-menu-Can1iJqQ.mjs.map → openalgo-charts.widget.layouts-menu-B7XYKPAW.mjs.map} +1 -1
  35. package/dist/openalgo-charts.widget.layouts-templates-menu-DmYVzrWk.mjs +2 -0
  36. package/dist/{openalgo-charts.widget.layouts-templates-menu-D-ia3TEX.mjs.map → openalgo-charts.widget.layouts-templates-menu-DmYVzrWk.mjs.map} +1 -1
  37. package/dist/openalgo-charts.widget.mjs +1 -1
  38. package/dist/openalgo-charts.widget.mjs.map +1 -1
  39. package/dist/openalgo-charts.widget.standalone.js +1 -0
  40. package/dist/{openalgo-charts.widget.storage-idb-CT2jXJA9.mjs → openalgo-charts.widget.storage-idb-WH_o01Wj.mjs} +2 -2
  41. package/dist/{openalgo-charts.widget.storage-idb-CT2jXJA9.mjs.map → openalgo-charts.widget.storage-idb-WH_o01Wj.mjs.map} +1 -1
  42. package/dist/openalgo-charts.workspace.mjs +1 -1
  43. package/dist/openalgo-charts.workspace.mjs.map +1 -1
  44. package/dist/openalgo-charts.workspace.standalone.js +1 -0
  45. package/dist/profile/index.d.ts +84 -31
  46. package/dist/trade/index.d.ts +202 -175
  47. package/dist/transform/index.d.ts +44 -21
  48. package/dist/webgl/index.d.ts +56 -47
  49. package/dist/widget/index.d.ts +352 -276
  50. package/dist/workspace/index.d.ts +9 -23
  51. package/package.json +25 -12
  52. package/dist/openalgo-charts.widget.chart-data-export-dialog-CQgCMbsq.mjs +0 -2
  53. package/dist/openalgo-charts.widget.chart-data-export-dialog-CQgCMbsq.mjs.map +0 -1
  54. package/dist/openalgo-charts.widget.grid-bar-CqdczCgG.mjs +0 -2
  55. package/dist/openalgo-charts.widget.grid-bar-CqdczCgG.mjs.map +0 -1
  56. package/dist/openalgo-charts.widget.grid-menus--16fPxvz.mjs +0 -2
  57. package/dist/openalgo-charts.widget.grid-menus--16fPxvz.mjs.map +0 -1
  58. package/dist/openalgo-charts.widget.layouts-menu-Can1iJqQ.mjs +0 -2
  59. package/dist/openalgo-charts.widget.layouts-templates-menu-D-ia3TEX.mjs +0 -2
package/README.md CHANGED
@@ -12,7 +12,7 @@ with no runtime dependencies.
12
12
  [![npm version](https://img.shields.io/npm/v/openalgo-charts.svg?color=cb3837&label=npm)](https://www.npmjs.com/package/openalgo-charts)
13
13
  [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
14
14
  [![npm downloads](https://img.shields.io/npm/dm/openalgo-charts.svg?color=0ea5e9&label=npm%20downloads)](https://www.npmjs.com/package/openalgo-charts)
15
- [![tests](https://img.shields.io/badge/engine%20tests-11118%20passing-brightgreen.svg)](#develop)
15
+ [![tests](https://img.shields.io/badge/engine%20tests-11591%20passing-brightgreen.svg)](#develop)
16
16
  [![dependencies](https://img.shields.io/badge/runtime%20deps-0-brightgreen.svg)](#principles)
17
17
 
18
18
  [**Documentation**](https://marketcalls.github.io/openalgo-charts/)  ·  [**Live examples**](https://marketcalls.github.io/openalgo-charts/examples)  ·  [**Getting started**](./docs/getting-started.md)  ·  [**Migrating to 2.0**](./docs/migrating-to-2.md)  ·  [**Architecture**](./ARCHITECTURE.md)
@@ -25,7 +25,7 @@ with no runtime dependencies.
25
25
  npm install openalgo-charts
26
26
  ```
27
27
 
28
- Current version: **2.5.10**, persistence, saved layouts and the chart grid: the widget keeps its state in IndexedDB and says when it has landed (`widget.ready`), saves and reopens named layouts and indicator templates, and lets a user move any shortcut from the ? panel; a bottom bar carries preset ranges sized in trading sessions, Go to, the market status and a clock; calendars know pre-open, post-close and extended hours, and a chart can shade them; the chart grid lays out one to sixteen charts with a grid bar, maximize and swap, and named link groups that can share the chart type and drawings; and a label pass makes every control say what it is. 2.5.9 was the drawing interaction and replay release.
28
+ Current version: **2.6.0**, analysis depth and a stricter API: the chart applies Heikin Ashi, Renko, range bars, line break, point and figure and Kagi to the bars you feed, live, with each study on the elements or the underlying bars; seven new built-ins and a timeframe input on 29 of them; symbol search through the OpenAlgo feed; rich event details with host actions; a typed event map for `chart.on`; a classic-script build of every tier and `require()` of the ESM files; and declarations that hold for a host compiling with both strict flags. 2.5.10 was the persistence, saved layouts and chart grid release.
29
29
  See the [changelog](./CHANGELOG.md) for release notes.
30
30
 
31
31
  ## Quick start
@@ -66,7 +66,7 @@ Firefox and WebKit. In Vue, hold the chart in a `shallowRef`, never in `ref()` o
66
66
 
67
67
  ## Architecture
68
68
 
69
- <a href="docs/architecture-diagram.svg"><img src="docs/architecture-diagram.svg" alt="OpenAlgo Charts 2.5.10 architecture: host responsibilities, the base data-to-rendering pipeline with alerts and shared replay, and eight optional tiers including workspace storage, trading tools and the widget" width="920" /></a>
69
+ <a href="docs/architecture-diagram.svg"><img src="docs/architecture-diagram.svg" alt="OpenAlgo Charts 2.6.0 architecture: host responsibilities, the base data-to-rendering pipeline with alerts and shared replay, and eight optional tiers including workspace storage, trading tools and the widget" width="920" /></a>
70
70
 
71
71
  How data reaches the chart, what your app owns, and which features you can import.
72
72
  [Open the full-size diagram](docs/architecture-diagram.svg).
@@ -117,7 +117,7 @@ You can also load the library from a CDN in a plain HTML page:
117
117
  ```html
118
118
  <div id="chart" style="width:100vw;height:100vh"></div>
119
119
  <script type="module">
120
- import { createChart, generateBars } from 'https://unpkg.com/openalgo-charts@2.5.10/dist/openalgo-charts.mjs';
120
+ import { createChart, generateBars } from 'https://unpkg.com/openalgo-charts@2.6.0/dist/openalgo-charts.mjs';
121
121
  const chart = createChart(document.getElementById('chart'), { timezone: 'Asia/Kolkata' });
122
122
  chart.addSeries('candlestick').setData(generateBars(1700000000, 200, 3600));
123
123
  chart.fitContent();
@@ -125,7 +125,7 @@ You can also load the library from a CDN in a plain HTML page:
125
125
  ```
126
126
 
127
127
  Each optional tier has its own file. For example,
128
- `openalgo-charts.indicators.mjs` registers all 105 built-in indicators. Pin the
128
+ `openalgo-charts.indicators.mjs` registers all 112 built-in indicators. Pin the
129
129
  version in production. The base chart needs no stylesheet; the widget adds its
130
130
  own styles. See
131
131
  [Use from a CDN](https://marketcalls.github.io/openalgo-charts/docs/cdn).
@@ -179,17 +179,17 @@ Unused optional tiers stay out of the base chart download.
179
179
 
180
180
  | Import | Contents | Brotli |
181
181
  |---|---|---|
182
- | `openalgo-charts` | Engine, 13 chart types, panes and scales, custom indicator registry, primitives, alerts, replay, comparisons, chart linking, state, feeds, bar cache, trading overlays, CSV and SVG export | 134.69 kB |
183
- | `openalgo-charts/indicators` | 105 built-in indicators, calculation helpers and helpers for studies that use external data | 40.43 kB |
184
- | `openalgo-charts/draw` | 87 drawing tools + a headless drawing controller, clipboard, settings schema, level palette, freehand geometry and SVG icons | 57.98 kB |
185
- | `openalgo-charts/transform` | Heikin Ashi, Renko, Range bars, Line Break, Point &amp; Figure, Kagi, and symbol arithmetic (`AAPL/MSFT`) | 4.55 kB |
186
- | `openalgo-charts/profile` | Volume Profile, Market Profile (TPO) with compact pixel letters, Footprint, order flow | 14.97 kB |
187
- | `openalgo-charts/trade` | Order, position and bracket tools, account state, order preview and position commands, plus a depth-of-market ladder | 16.69 kB |
188
- | `openalgo-charts/webgl` | GPU drawing for supported series, with Canvas 2D fallback | 6.93 kB |
189
- | `openalgo-charts/widget` | `createWidget`: toolbar, bottom bar, Data, Objects, Watchlist and News dock, account summary, symbol search, dialogs, mobile controls, a shortcuts editor, saved layouts, the chart grid (`createChartGrid`) and optional persistence in IndexedDB | 121.36 kB |
190
- | `openalgo-charts/workspace` | Validated workspace and indicator-template documents, named watchlists, named catalogs with revision checks, asynchronous storage and an IndexedDB adapter; no DOM | 11.53 kB |
191
-
192
- Everything together is **409.13 kB Brotli**; a widget terminal with built-in indicators (base + draw + indicators + widget) is 354.46 kB. The widget's seven first-use parts (the shortcuts editor, the Layouts menu, the templates list, the chart data dialog, the grid bar and its menus, and the IndexedDB store) add 18.19 kB in files of their own, fetched only when a widget first uses one. Figures are measured from the 2.5.10 release build. The trade tier is 16.69 kB on its own; base + trade costs 151.38 kB. Sizes use decimal kB.
182
+ | `openalgo-charts` | Engine, 13 chart types, panes and scales, custom indicator registry, primitives, alerts, replay, comparisons, chart linking, state, feeds, bar cache, trading overlays, CSV and SVG export | 137.53 kB |
183
+ | `openalgo-charts/indicators` | 112 built-in indicators, calculation helpers and helpers for studies that use external data | 43.02 kB |
184
+ | `openalgo-charts/draw` | 87 drawing tools + a headless drawing controller, clipboard, settings schema, level palette, freehand geometry and SVG icons | 58.36 kB |
185
+ | `openalgo-charts/transform` | Heikin Ashi, Renko, Range bars, Line Break, Point &amp; Figure, Kagi, and symbol arithmetic (`AAPL/MSFT`) | 6.07 kB |
186
+ | `openalgo-charts/profile` | Volume Profile, Market Profile (TPO) with compact pixel letters, Footprint, order flow | 14.94 kB |
187
+ | `openalgo-charts/trade` | Order, position and bracket tools, account state, order preview and position commands, plus a depth-of-market ladder | 16.88 kB |
188
+ | `openalgo-charts/webgl` | GPU drawing for supported series, with Canvas 2D fallback | 6.97 kB |
189
+ | `openalgo-charts/widget` | `createWidget`: toolbar, bottom bar, Data, Objects, Watchlist and News dock, account summary, symbol search, dialogs, mobile controls, a shortcuts editor, saved layouts, the chart grid (`createChartGrid`) and optional persistence in IndexedDB | 123.57 kB |
190
+ | `openalgo-charts/workspace` | Validated workspace and indicator-template documents, named watchlists, named catalogs with revision checks, asynchronous storage and an IndexedDB adapter; no DOM | 11.73 kB |
191
+
192
+ Everything together is **419.05 kB Brotli**; a widget terminal with built-in indicators (base + draw + indicators + widget) is 362.48 kB. The widget's seven first-use parts (the shortcuts editor, the Layouts menu, the templates list, the chart data dialog, the grid bar and its menus, and the IndexedDB store) add 18.24 kB in files of their own, fetched only when a widget first uses one. The nine classic-script files together are 430.90 kB. Figures are measured from the 2.6.0 release build. The trade tier is 16.88 kB on its own; base + trade costs 154.41 kB. Sizes use decimal kB.
193
193
 
194
194
  ## What's built
195
195
 
@@ -206,7 +206,7 @@ const macd = chart.addIndicator('macd', { fastPeriod: 8 }); // gets its own pa
206
206
  macd.setSettings({ 'macd:width': 2, 'macd:lineStyle': 'dashed' });
207
207
  ```
208
208
 
209
- 105 built-ins across Trend, Momentum, Volatility and Volume, from the everyday (SMA, EMA, WMA, VWAP, Bollinger Bands, RSI, MACD, Stochastic, ADX/DMI, ATR) through Supertrend, HalfTrend, Ichimoku, Keltner, Donchian, Chandelier Exit and CPR with floor pivots to Connors RSI, Fisher Transform, Woodies CCI, Klinger, Vortex, WaveTrend Pro, Chop Zone and Williams Fractals, with a least-squares family (Least Squares Moving Average, Linear Regression Slope, Standard Error, Standard Error Bands) and a Smoothed Moving Average alongside them, joined in 1.8.3 by the T3 average, the Hull Suite (Hma / Ehma / Thma with a displaced band) and Consolidation and Breakout, which tracks inside-bar ranges and marks the bar that leaves one. Twenty-eight of them draw shaded bands, six emit named buy/sell markers, two recolour the price candles, and Seasonality draws a monthly return heatmap as a table over the chart. The full catalogue with ids and defaults is in the docs.
209
+ 112 built-ins across Trend, Momentum, Volatility and Volume, from the everyday (SMA, EMA, WMA, VWAP, Bollinger Bands, RSI, MACD, Stochastic, ADX/DMI, ATR) through Supertrend, HalfTrend, Ichimoku, Keltner, Donchian, Chandelier Exit and CPR with floor pivots to Connors RSI, Fisher Transform, Woodies CCI, Klinger, Vortex, WaveTrend Pro, Chop Zone and Williams Fractals, with a least-squares family (Least Squares Moving Average, Linear Regression Slope, Standard Error, Standard Error Bands) and a Smoothed Moving Average alongside them, joined in 1.8.3 by the T3 average, the Hull Suite (Hma / Ehma / Thma with a displaced band) and Consolidation and Breakout, which tracks inside-bar ranges and marks the bar that leaves one. Version 2.6.0 adds ZigZag, 52 Week High/Low, Zero Lag EMA, Variable Index Dynamic Average, Elder-Ray Index, Schaff Trend Cycle and Volatility Squeeze. Twenty-eight of them draw shaded bands, six emit named buy/sell markers, three recolour the price candles, and Seasonality draws a monthly return heatmap as a table over the chart. The full catalogue with ids and defaults is in the docs.
210
210
 
211
211
  Since 2.4.0 a study can fold the chart's own bars up to a higher timeframe with `securitySeries` (as the bucket stood at each bar, or the last completed one, or with lookahead when reproducing a source that repaints), paint a plot displaced by a number of bars, colour a candle's wick and border apart from its body, pin a marker to the pane edge, put a tooltip on a drawn zone, compute an alert message from the bar that fired, and ask the host for another instrument's bars through `chart.setBarsProvider`. A calculation that throws once it is on the chart is reported on that study's data status rather than thrown into the render loop.
212
212
 
@@ -515,18 +515,19 @@ Enforced in CI by [`size-limit`](./.size-limit.json). Nothing is excluded, becau
515
515
 
516
516
  | Bundle | Limit | Actual |
517
517
  |---|---|---|
518
- | Base engine | 134.69 kB | 134.69 kB |
519
- | Base + trade | 151.38 kB | 151.38 kB |
520
- | Indicators tier | 40.43 kB | 40.43 kB |
521
- | Draw tier | 57.99 kB | 57.98 kB |
522
- | Transform tier | 4.56 kB | 4.55 kB |
523
- | Profile tier | 14.98 kB | 14.97 kB |
524
- | WebGL2 tier | 6.94 kB | 6.93 kB |
525
- | Widget tier | 121.36 kB | 121.36 kB |
526
- | Widget first-use parts (seven files beside the widget tier) | 18.19 kB | 18.19 kB |
527
- | Widget terminal (base + draw + indicators + widget) | 354.46 kB | 354.46 kB |
528
- | Workspace tier | 11.53 kB | 11.53 kB |
529
- | **Everything** | 409.14 kB | 409.13 kB |
518
+ | Base engine | 137.54 kB | 137.53 kB |
519
+ | Base + trade | 154.42 kB | 154.41 kB |
520
+ | Indicators tier | 43.02 kB | 43.02 kB |
521
+ | Draw tier | 58.36 kB | 58.36 kB |
522
+ | Transform tier | 6.07 kB | 6.07 kB |
523
+ | Profile tier | 14.94 kB | 14.94 kB |
524
+ | WebGL2 tier | 6.97 kB | 6.97 kB |
525
+ | Widget tier | 123.57 kB | 123.57 kB |
526
+ | Widget first-use parts (seven files beside the widget tier) | 18.24 kB | 18.24 kB |
527
+ | Widget terminal (base + draw + indicators + widget) | 362.48 kB | 362.48 kB |
528
+ | Workspace tier | 11.73 kB | 11.73 kB |
529
+ | Script tags (the nine classic-script files) | 430.91 kB | 430.90 kB |
530
+ | **Everything** | 419.06 kB | 419.05 kB |
530
531
 
531
532
  ## Documentation
532
533
 
@@ -576,15 +577,15 @@ See [Contributing](./CONTRIBUTING.md) for setup, targeted checks, documentation
576
577
 
577
578
  ```bash
578
579
  npm install # install dev toolchain
579
- npm run typecheck # strict TypeScript check
580
- npm test # engine unit tests (Vitest): 11118 across 469 files
581
- npm run test:demo # reference-host tests: 683 across 64 files
580
+ npm run typecheck # TypeScript: src with the stricter flags, then the tests
581
+ npm test # engine unit tests (Vitest): 11591 across 512 files
582
+ npm run test:demo # reference-host tests: 689 across 67 files
582
583
  npm run test:endurance # node endurance-harness tests: 7 cases
583
584
  npm run build # Rollup -> dist/ (minified ESM per tier + types)
584
585
  npm run size # size-limit (Brotli) against the budget
585
586
  npm run e2e # Playwright Chromium smoke tests
586
587
  npm run bench:render # render bench: pan, zoom-out and tick frame budgets per bar count
587
- npm run verify # lint + types + unit + endurance harness + build + demo + dts + size + shake
588
+ npm run verify # lint + types + cycles + unused exports + unit + endurance harness + build + demo + dts + exports + compat + size + shake
588
589
  ```
589
590
 
590
591
  ## Principles
@@ -598,7 +599,7 @@ npm run verify # lint + types + unit + endurance harness + build + demo + dt
598
599
 
599
600
  ## Status &amp; limitations
600
601
 
601
- Version **2.5.10**. All engine build phases are implemented. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
602
+ Version **2.6.0**. All engine build phases are implemented. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
602
603
 
603
604
  Known gaps, stated plainly:
604
605