@tony01/astroneum 0.4.1-beta.2 → 0.4.1-beta.25

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 (55) hide show
  1. package/CHANGELOG.md +281 -237
  2. package/LICENSE +21 -21
  3. package/README.md +250 -198
  4. package/dist/{Indicator-BBI3L_lx.d.ts → Indicator-BQQcVGGT.d.ts} +51 -227
  5. package/dist/astroneum.css +1 -1
  6. package/dist/chunk-47YGQEL5.js +399 -0
  7. package/dist/chunk-67XM5LOK.js +2 -0
  8. package/dist/{chunk-2YYGUSVX.js → chunk-DFJMDDL5.js} +1 -1
  9. package/dist/chunk-EFAS6F4C.js +59 -0
  10. package/dist/chunk-EHZN52CY.js +2 -0
  11. package/dist/chunk-HKLWNPMP.js +35 -0
  12. package/dist/chunk-ONPPQW65.js +2 -0
  13. package/dist/chunk-SCTHEM27.js +3 -0
  14. package/dist/chunk-UQXYMB6X.js +2 -0
  15. package/dist/chunk-WSIR5T2M.js +3 -0
  16. package/dist/entries/alerts.d.ts +36 -10
  17. package/dist/entries/alerts.js +1 -1
  18. package/dist/entries/datafeeds/crypto.d.ts +5 -1
  19. package/dist/entries/datafeeds/crypto.js +1 -1
  20. package/dist/entries/datafeeds/polygon.d.ts +3 -1
  21. package/dist/entries/datafeeds/polygon.js +1 -1
  22. package/dist/entries/headless.d.ts +78 -0
  23. package/dist/entries/headless.js +2 -0
  24. package/dist/entries/multichart.d.ts +12 -1
  25. package/dist/entries/multichart.js +1 -1
  26. package/dist/entries/replay.d.ts +3 -1
  27. package/dist/entries/script.d.ts +2 -68
  28. package/dist/entries/script.js +1 -1
  29. package/dist/entries/watchlist.d.ts +32 -2
  30. package/dist/entries/watchlist.js +1 -1
  31. package/dist/entries/workspace.d.ts +61 -0
  32. package/dist/entries/workspace.js +2 -0
  33. package/dist/index-BiXdqLA4.d.ts +45 -0
  34. package/dist/index-_JgHTy8X.d.ts +19 -0
  35. package/dist/index.d.ts +188 -27
  36. package/dist/index.js +1 -1
  37. package/dist/script-BU9StbN-.d.ts +120 -0
  38. package/dist/types-W6SIYQ9m.d.ts +232 -0
  39. package/dist/types-yETgeYsE.d.ts +28 -0
  40. package/dist/zh-CN-NDTUDZGZ.js +3 -0
  41. package/package.json +157 -147
  42. package/dist/chunk-4YOLQ5DC.js +0 -2
  43. package/dist/chunk-I4YQBP2M.js +0 -3
  44. package/dist/chunk-OOMZRONH.js +0 -35
  45. package/dist/chunk-PV2GAINM.js +0 -2
  46. package/dist/chunk-YW3STIPY.js +0 -653
  47. package/dist/zh-CN-Y2C6RSOI.js +0 -3
  48. package/docs/STRUCTURE.md +0 -231
  49. package/docs/TODO-DESIGN.md +0 -261
  50. package/docs/TODO.md +0 -222
  51. package/docs/api.md +0 -528
  52. package/docs/datafeed-guide.md +0 -311
  53. package/docs/design-astroneum.md +0 -479
  54. package/docs/plugin-development.md +0 -565
  55. package/docs/tv-functions-skill.md +0 -706
package/CHANGELOG.md CHANGED
@@ -1,237 +1,281 @@
1
- # Changelog
2
-
3
- All notable changes to **astroneum** are documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
7
- once it reaches v1.0. Until then, minor releases may include breaking changes
8
- — always check this file before upgrading.
9
-
10
- ## [Unreleased]
11
-
12
- ### Added Full Indicator Parity (50 total, +23 new)
13
-
14
- Astroneum now ships **50 technical indicators** — up from 27 — achieving full
15
- parity with the comparison table against TradingView Pro. Every indicator in the
16
- original roadmap (Phases 1–4) is implemented.
17
-
18
- **Phase 1 Critical (MVP)**
19
- - **ATR** (Average True Range) `averageTrueRange.ts` market volatility
20
- measure used for position sizing and stop-loss placement.
21
- - **ADX** (Average Directional Index) `averageDirectionalIndex.ts` —
22
- standalone trend-strength indicator (0–25 weak, 25–50 strong, 50+ very
23
- strong).
24
- - **A/D** (Accumulation/Distribution) `accumulationDistribution.ts` —
25
- cumulative volume + CLV money flow, divergence signals for reversals.
26
-
27
- **Phase 2 — Important (Competitive Feature)**
28
- - **CMF** (Chaikin Money Flow) — `chaikinMoneyFlow.ts` — money flow over N
29
- periods using close-location-within-range (default 20).
30
- - **MFI** (Money Flow Index) `moneyFlowIndex.ts` volume-weighted RSI
31
- using typical price, overbought >80 / oversold <20.
32
- - **VWAP** (Volume Weighted Average Price) `volumeWeightedAveragePrice.ts`
33
- — cumulative volume-weighted typical price overlay.
34
- - **Ichimoku Cloud** `ichimokuCloud.ts` 5-line comprehensive trend
35
- system (Tenkan/Kijun/Senkou A/B/Chikou), default periods 9/26/52.
36
-
37
- **Phase 3 Polish (Market Completeness)**
38
- - **DEMA / TEMA / WMA / VWMA** double/triple/weighted/volume-weighted
39
- moving averages (`doubleExponentialMovingAverage.ts`,
40
- `tripleExponentialMovingAverage.ts`, `weightedMovingAverage.ts`,
41
- `volumeWeightedMovingAverage.ts`).
42
- - **HV** (Historical Volatility) `historicalVolatility.ts` annualized
43
- volatility from log returns × √252.
44
- - **DC** (Donchian Channels) `donchianChannels.ts` highest-high /
45
- lowest-low channels with midline.
46
- - **KC** (Keltner Channels) — `keltnerChannels.ts` — EMA middle line with
47
- ATR-based upper/lower bands.
48
- - **SuperTrend** `superTrend.ts` trend-following volatility stop with
49
- direction tracking.
50
-
51
- **Phase 4 Advanced (Niche Features)**
52
- - **STDDEV** (Standard Deviation) `standardDeviation.ts` population
53
- standard deviation of close over N periods.
54
- - **VROC** (Volume Rate of Change) `volumeRateOfChange.ts` percentage
55
- change in volume over N periods.
56
- - **PP** (Pivot Points) `pivotPoints.ts` classic pivot points with
57
- R1–R3 resistance and S1–S3 support levels.
58
- - **CORR** (Correlation Coefficient)`correlationCoefficient.ts`
59
- Pearson's R between close and linear sequence 1..N.
60
- - **LinReg** (Linear Regression) `linearRegression.ts` — least-squares
61
- regression line on close prices.
62
- - **AMA** (Adaptive Moving Average / KAMA) — `adaptiveMovingAverage.ts` —
63
- Kaufman's adaptive MA with efficiency-ratio smoothing.
64
- - **HMA** (Hull Moving Average) `hullMovingAverage.ts` — WMA-based
65
- lag-reduced moving average.
66
- - **ZZ** (ZigZag) `zigzag.ts` pivot-based trend-reversal detection
67
- with configurable deviation percentage.
68
-
69
- ### Changed
70
-
71
- - **Demo page expanded** category-organised indicator picker displaying all
72
- 50 indicators with tooltips, overlay vs. sub-pane visual distinction
73
- (amber/green), and active-indicator status bar with counts.
74
- - **`INDICATOR_COMPARISON.md`** fully rewritten to track all indicators,
75
- coverage percentages per category, and completed roadmap.
76
-
77
- ### Fixed
78
-
79
- - **SuperTrend state tracking** replaced fragile float comparison
80
- `prevSuperTrend === upperBand` with `direction` variable for correct
81
- trend-state transitions.
82
- - **HMA performance** reduced from O(n³) to O(n²) by pre-computing
83
- `2*WMA(n/2) - WMA(n)` values before the final WMA pass.
84
- - **ZigZag pivot detection** — replaced adjacent-bar comparison with
85
- running extreme tracking to reliably capture peaks/troughs during
86
- consolidation phases.
87
-
88
- ---
89
-
90
- ### AddedTradingView Competitive Parity
91
-
92
- - **Heikin-Ashi candle type** — `barStyle="heikin_ashi"` prop. `heikinAshi(data)` exported.
93
- - **Crosshair sync** in `MultiChartLayout` — `onCrosshairMove()` / `setCrosshair()` on handle.
94
- - **Measure tool** — 18th drawing tool in extension. Pixel distance label + risk/reward line.
95
- - **Magnet/Snap helpers**`snapToOhlc()` and `snapAngle()` in `DrawingSnapper`.
96
- - **Undo/Redo manager** — `UndoManager` class using `serializeState()`/`loadState()`.
97
- - **Extended keyboard shortcuts** arrow keys pan, Page/Home/End, mouse wheel zoom at cursor.
98
- - **Copy/paste drawings** Ctrl+C copies overlays as JSON, Ctrl+V pastes.
99
- - **Session Visualizer** `SessionVisualizer` renders session high/low/open/close lines.
100
- - **Volume Profile** — `volumeProfilePlugin` horizontal histogram with POC + Value Area.
101
- - **Position Visualizer** `PositionVisualizer` entry/stop/target lines on chart.
102
- - **Compare Overlay** — `createCompareIndicator()` overlays second symbol normalized to %.
103
- - **Lock all drawings** `lockAllDrawings(locked)` on `AstroneumHandle`.
104
- - **Drawing live preview** — `DrawingTemplates.preview()` + `applyColor()` per-overlay.
105
- - **Price axis scaling** — `priceScale='linear'|'log'|'percent'|'indexed'` prop + `PriceScaleTransform`.
106
- - **Chart templates** `ChartTemplateManager` singleton saves/loads named configs to localStorage.
107
- - **Multi-timeframe resampling** `resampleBars()`, `forwardFill()`, `mtfIndicator()`.
108
- - **Non-time-based bars** — `generateRenko()`, `generateKagi()`, `generateTickBars()`, `generateRangeBars()`.
109
- - **Point & Figure** — `generatePointAndFigure()`, `computePFColumns()`, `pfColumnsToBars()`.
110
- - **Multi-period layout** — `MultiPeriodLayout` stacked same-symbol different periods.
111
- - **Auto pattern detection** — `zigzag()`, `detectSupportResistance()`, `zigzagPlugin`.
112
- - **DOM visualization** — `domPlugin` bid/ask volume ladder.
113
-
114
- ### Fixed — Bug, Perf & Security Hardening
115
-
116
- - **Bug: `rafMergeTick` low-merge inverted** comparison operator fixed (was `<`, now `>`).
117
- - **Bug: `ScriptEngine` figures mutation** shared `this.figures` now uses `[...result.figures]`.
118
- - **Bug: Plugin `figureKeys` closure leak** moved to per-instance `extendData`.
119
- - **Bug: `Math.max(...arr)` stack overflow risk** — replaced with iterative loops in `DrawingSnapper`/`GlyphAtlas`.
120
- - **Bug: LTTB decimation NaN** — empty bucket guard added in `PerformanceMode.decimate()`.
121
- - **Bug: `virtualizeWindow` overlap** — startIdx/endIdx clamp added.
122
- - **Bug: `useKeyboardShortcuts` stale ref** — fixed stable wrapper pattern.
123
- - **Perf: Tooltip style objects pre-computed** at module scope (no per-render allocation).
124
- - **Perf: `adjustFromTo()` integer math** for week/month/year (eliminates `new Date()` allocations).
125
- - **Perf: `serializeState()` uses `structuredClone`** instead of recursive `deepClone`.
126
- - **Perf: 6 `useEffect` hooks batched** into one for engine prop sync.
127
- - **Perf: `sortBarsAsc()` O(n) validation** before sort (99% of API responses are pre-sorted).
128
- - **Perf: Shared color helpers** extracted to `candleShaders.ts` (~160 lines duplicated code removed).
129
- - **Perf: `TaskScheduler` priority queue** data > indicator > overlay priority ordering.
130
- - **Perf: `IndicatorWorkerPool` SAB transfer** when `crossOriginIsolated`.
131
- - **Perf: `packBars()` optional columns** bitmap for skipping unused columns.
132
- - **Perf: `SharedIndicatorGLCanvas` FinalizationRegistry** for auto-cleanup.
133
- - **Perf: aria-live string buffer reuse** instead of template-string allocation per move.
134
- - **Security: ScriptEngine sandbox hardened** `Object.freeze(Object/Array.prototype)` + `eval` blocked.
135
- - **Security: AlertManager webhook URL validated** — https-only, block private IPs/localhost.
136
- - **Security: localStorage writes debounced** — `AlertManager.check()` saves at most 1/s.
137
- - **Security: localStorage schema validation** on loadcorrupted data rejected.
138
- - **Security: WebSocket URL scheme validation** `wss://`/`ws://` required.
139
- - **Security: Polygon API key** moved from URL query param to `Authorization: Bearer` header.
140
- - **Security: `#apiKey` private class field** — non-enumerable, safe from `JSON.stringify`.
141
- - **Security: Locale strings stripped of HTML tags** XSS prevention.
142
- - **Security: `BarsCodec.decode()` capped** at 500k bars to prevent OOM.
143
- - **Security: `pnpm audit` in all CI workflows.**
144
- - **Security: TA surface gating + OPFS path safety** documented.
145
-
146
- ## [0.3.0]2026-06-15
147
-
148
- ### Addedv0.5 Polish (partial)
149
-
150
- - **Lazy locale loading** ([src/i18n/index.ts](src/i18n/index.ts)) —
151
- only `en-US` is bundled eagerly; the other 18 locales are loaded on
152
- demand via dynamic `import()`. New public exports:
153
- - `loadLocale(key)` async loader for built-in locales
154
- - `BUILTIN_LOCALES` the canonical list
155
- - Existing `loadLocales(key, dictionary)` continues to work for custom
156
- translations.
157
- - **Drawing & layout persistence** — `serializeState()` and `loadState(state)`
158
- on `AstroneumHandle` capture / restore theme, locale, timezone, symbol,
159
- period, styles, indicators, and overlays as JSON.
160
- See [docs/api.md](docs/api.md#serializestate--loadstate).
161
- - **Accessibility pass** — opt-in via the new `accessible` prop on
162
- `<AstroneumChart>`. When enabled, the chart container gets `tabindex=0`,
163
- `role="img"`, and an `aria-label`; a visually-hidden `aria-live="polite"`
164
- region announces OHLCV on crosshair changes (throttled to ~10/s).
165
- - **High-contrast theme** — set `theme="high-contrast"` for a
166
- WCAG-conscious black/white/yellow palette with strong focus rings.
167
- - **Benchmark CI workflow**
168
- ([.github/workflows/benchmark.yml](.github/workflows/benchmark.yml))
169
- runs `pnpm size` and the perf tests on every PR and posts the perf
170
- output as a sticky comment.
171
-
172
- ### Changed
173
-
174
- - `WasmIndicators.ts` renamed to **`TypedArrayIndicators.ts`** to match
175
- what it actually is (a column-store TS implementation). A back-compat
176
- shim is kept at the old path with `@deprecated` JSDoc and will be
177
- removed in v1.0.
178
-
179
- ### Deferred
180
-
181
- Still tracked for v0.6 v1.0; not in this release:
182
-
183
- - WebGPU renderer / real Rust + WASM SIMD indicators
184
- - `OrderManager` + broker package
185
- - Heatmap / footprint / options-chain panes
186
- - Full mobile audit & Storybook site
187
- - React component tests (jsdom + RTL) + Playwright visual regression
188
- - Compare overlay UI
189
-
190
- ---
191
-
192
- ## [0.2.0]2026-05-30
193
-
194
- ### Added v0.3 Hardening
195
-
196
- - **Subpath exports** for tree-shakeable, opt-in feature modules
197
- ([#roadmap-4](README.md#v04--modularization)):
198
- - `astroneum/replay` — `BarReplay`
199
- - `astroneum/multichart` `MultiChartLayout`
200
- - `astroneum/watchlist` — `WatchlistManager`
201
- - `astroneum/portfolio` `PortfolioTracker`
202
- - `astroneum/alerts` `AlertManager`
203
- - `astroneum/script` `ScriptEngine`
204
- - `astroneum/datafeeds/polygon` — `DefaultDatafeed` + `WebSocketDatafeed`
205
- - `astroneum/datafeeds/crypto` — `createStandardCryptoDatafeed` + adapters
206
- - **`size-limit` budget** ([.size-limit.json](.size-limit.json)) with one
207
- budget per entry. Run `pnpm size` after `pnpm build`.
208
- - **Datafeed contract tests** ([src/__tests__/datafeed-contract.test.ts](src/__tests__/datafeed-contract.test.ts))
209
- type-level + behavioural checks for any `Datafeed` implementation.
210
- - **SSR smoke tests** ([src/__tests__/ssr-smoke.test.ts](src/__tests__/ssr-smoke.test.ts))
211
- verifies the root entry and all subpath entries import cleanly with no
212
- DOM globals defined, and that the root entry's public API surface is stable.
213
- - **`CONTRIBUTING.md`**, **`SECURITY.md`**, **`CODE_OF_CONDUCT.md`**,
214
- and this `CHANGELOG.md`.
215
- - **Browser support matrix** documented in [README](README.md#browser-support).
216
-
217
- ### Changed
218
-
219
- - `pnpm verify` order is now `lint typecheck build → test` so SSR and
220
- bundle tests can assert against fresh `dist/` output.
221
- - `tsup.config.ts` now bundles every subpath entry and injects `'use client'`
222
- into every emitted JS file (not just `dist/index.js`).
223
- - `package.json#files` widened from `dist/*.{js,css,d.ts}` to
224
- `dist/**/*.{js,css,d.ts}` so nested subpath artifacts ship.
225
-
226
- ### Fixed
227
-
228
- - `src/index.ts` no longer side-imports the non-existent
229
- `./styles/index.less` (was a leftover from a SCSS migration and caused the
230
- build to fail outright on a clean install).
231
-
232
- ---
233
-
234
- ## [0.2.0-baseline] — 2026-05-30
235
-
236
- Initial public roadmap baseline. See git history for details prior to this
237
- changelog being introduced.
1
+ # Changelog
2
+
3
+ All notable changes to **astroneum** are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
7
+ once it reaches v1.0. Until then, minor releases may include breaking changes
8
+ — always check this file before upgrading.
9
+
10
+ ## [0.4.1-beta.25] - 2026-08-31
11
+
12
+ The `0.4.1-beta.22` and `0.4.1-beta.23` tags failed their package-content gates before npm publication and are not consumable releases.
13
+ The published `0.4.1-beta.24` artifact included internal/reference documentation and is not accepted for Barwise consumption. `0.4.1-beta.25` restricts the package to license, public release documentation, package metadata, and built distribution files.
14
+
15
+ ### Added Headless engine package
16
+ - Added `@tony01/astroneum/headless` with a React-free declaration/runtime graph, no native UI, stylesheet, datafeed, keyboard-shortcut, or implicit-network dependency.
17
+ - Added validated host-owned `replaceBars()`, `updateBar()`, and copied `getBars()` data APIs for strictly ascending UTC-millisecond OHLCV data.
18
+ - Added explicit optional indicator/drawing registration and an immutable version-1 capability manifest.
19
+ - Added idempotent duplicate initialization, multiple-container isolation, deterministic teardown, SSR/package isolation, direct-bar, and size tests.
20
+ - Added React-independent typed study-plugin exports and bounded version-1 viewport capture/restore for headless consumers.
21
+ - Added browser coverage for 16 study outputs, 16 host overlays, left-scrolled viewport restoration, and teardown during active animation.
22
+
23
+ ### Changed — Headless engine ownership
24
+ - Engine rendering no longer installs keyboard shortcuts; the existing React host keyboard hook remains the shortcut owner.
25
+ - Headless teardown now cancels chart animations, unsubscribes configured loaders, and ignores late loader and indicator scheduling work.
26
+ - Screenshot export now composites ordered Canvas2D, WebGL, WebGPU, worker-canvas, and GPU-text layers and has browser pixel coverage.
27
+
28
+ ### Changed
29
+ - The right rail now keeps its 52px toggle strip on the viewport's outer-right edge; panels open immediately to its left and collapse without hiding the strip.
30
+ - The Watchlist panel now uses Watchlist/Details/News sub-tabs, horizontal list tabs, sortable configurable quote columns, Simple/Advanced presets, list colors, validated symbol search, context actions, and same-list/cross-list symbol drag.
31
+ - The Details sub-tab follows the active chart symbol and shows current OHLC data and metadata; News remains an honest provider-dependent empty state.
32
+ - Hidden panel content is inert and excluded from keyboard navigation while the collapsed rail remains interactive.
33
+
34
+ ### AddedWatchlist live quotes and persistence
35
+ - Added optional `Datafeed.getQuotes?(symbols: SymbolInfo[]): Promise<QuoteSnapshot[]>`.
36
+ - Added Binance, Bitget, and OKX ticker snapshots to `StandardCryptoDatafeed`.
37
+ - Extended `WatchlistManager` with symbol metadata, cross-list moves, persisted columns/sort/colors, and non-persisted live quote updates.
38
+ - Added watchlist manager and quote batching tests; the suite now passes 38 tests.
39
+
40
+ ### Added — Forecasting group + popup clipping fix (drawing tools 20 to 32)
41
+ - 12 new drawing overlays in `src/extension/`: `longPosition`, `shortPosition`, `positionForecast`, `barsPattern`, `ghostFeed`, `sector`, `anchoredVwap`, `fixedRangeVolumeProfile`, `anchoredVolumeProfile`, `priceRange`, `dateRange`, `dateAndPriceRange`.
42
+ - New `forecasting` group in `DrawingBar` with 3 section headers (Forecasting, Volume-based, Measurers) using `isHeader` on `SelectDataSourceItem`.
43
+ - 13 new SVG icons extracted from TV reference. 15 new i18n keys in `en-US.json`.
44
+ - Fixed popup clipping: `demo/terminal.css` `.astroneum-drawing-bar` overflow override moved to `@media(max-height:620px)` ??? all drawing-bar popups now visible on normal viewports, scroll preserved on short ones.
45
+ - Fixed 3 pre-existing lint errors in `AstroneumChart.tsx` (unnecessary type assertions).
46
+
47
+ ### Added — TV mirror workspace and strategy foundation
48
+ - Default demo route now mounts the terminal workspace with dismissible curtains and in-app split view.
49
+ - Unified terminal alert creation with the library `AlertModal`; drawing controls now expose semantic accessibility state.
50
+ - Added deterministic backtest types/core, bounded `strategySignals()` compilation, strategy tests, and the initial strategy report UI.
51
+ - Wired compiled strategies to current chart history in the terminal and replaced fixture-only strategy reports with runtime results.
52
+ - Added persistent dock report tabs with Rename/Duplicate/Close, More, keyboard navigation, resize, and maximize/restore.
53
+ - Fixed dock/rail geometry: explicit CSS Grid chart+dock rows prevent chart bleed; the real left drawing rail remains pinned through dock height, scrolls on short viewports, and dock maximize no longer reflows it.
54
+ - Added `docs/WORKSTREAMS.md` and the strategy-builder agent for scoped AI handoffs.
55
+
56
+ ### Added Full Indicator Parity (50 total, +23 new)
57
+
58
+ Astroneum now ships **50 technical indicators** up from 27 achieving full
59
+ parity with the comparison table against TradingView Pro. Every indicator in the
60
+ original roadmap (Phases 1–4) is implemented.
61
+
62
+ **Phase 1 Critical (MVP)**
63
+ - **ATR** (Average True Range) — `averageTrueRange.ts` — market volatility
64
+ measure used for position sizing and stop-loss placement.
65
+ - **ADX** (Average Directional Index) — `averageDirectionalIndex.ts` —
66
+ standalone trend-strength indicator (0–25 weak, 25–50 strong, 50+ very
67
+ strong).
68
+ - **A/D** (Accumulation/Distribution) — `accumulationDistribution.ts` —
69
+ cumulative volume + CLV money flow, divergence signals for reversals.
70
+
71
+ **Phase 2Important (Competitive Feature)**
72
+ - **CMF** (Chaikin Money Flow) — `chaikinMoneyFlow.ts` money flow over N
73
+ periods using close-location-within-range (default 20).
74
+ - **MFI** (Money Flow Index) `moneyFlowIndex.ts` — volume-weighted RSI
75
+ using typical price, overbought >80 / oversold <20.
76
+ - **VWAP** (Volume Weighted Average Price) — `volumeWeightedAveragePrice.ts`
77
+ cumulative volume-weighted typical price overlay.
78
+ - **Ichimoku Cloud** — `ichimokuCloud.ts` — 5-line comprehensive trend
79
+ system (Tenkan/Kijun/Senkou A/B/Chikou), default periods 9/26/52.
80
+
81
+ **Phase 3 — Polish (Market Completeness)**
82
+ - **DEMA / TEMA / WMA / VWMA** double/triple/weighted/volume-weighted
83
+ moving averages (`doubleExponentialMovingAverage.ts`,
84
+ `tripleExponentialMovingAverage.ts`, `weightedMovingAverage.ts`,
85
+ `volumeWeightedMovingAverage.ts`).
86
+ - **HV** (Historical Volatility) — `historicalVolatility.ts` — annualized
87
+ volatility from log returns × √252.
88
+ - **DC** (Donchian Channels) — `donchianChannels.ts` — highest-high /
89
+ lowest-low channels with midline.
90
+ - **KC** (Keltner Channels) `keltnerChannels.ts` EMA middle line with
91
+ ATR-based upper/lower bands.
92
+ - **SuperTrend** — `superTrend.ts` trend-following volatility stop with
93
+ direction tracking.
94
+
95
+ **Phase 4Advanced (Niche Features)**
96
+ - **STDDEV** (Standard Deviation) — `standardDeviation.ts` population
97
+ standard deviation of close over N periods.
98
+ - **VROC** (Volume Rate of Change) `volumeRateOfChange.ts` percentage
99
+ change in volume over N periods.
100
+ - **PP** (Pivot Points) — `pivotPoints.ts` classic pivot points with
101
+ R1–R3 resistance and S1–S3 support levels.
102
+ - **CORR** (Correlation Coefficient) — `correlationCoefficient.ts`
103
+ Pearson's R between close and linear sequence 1..N.
104
+ - **LinReg** (Linear Regression) — `linearRegression.ts` least-squares
105
+ regression line on close prices.
106
+ - **AMA** (Adaptive Moving Average / KAMA) `adaptiveMovingAverage.ts`
107
+ Kaufman's adaptive MA with efficiency-ratio smoothing.
108
+ - **HMA** (Hull Moving Average) `hullMovingAverage.ts` — WMA-based
109
+ lag-reduced moving average.
110
+ - **ZZ** (ZigZag) — `zigzag.ts` pivot-based trend-reversal detection
111
+ with configurable deviation percentage.
112
+
113
+ ### Changed
114
+
115
+ - **Demo page expanded** — category-organised indicator picker displaying all
116
+ 50 indicators with tooltips, overlay vs. sub-pane visual distinction
117
+ (amber/green), and active-indicator status bar with counts.
118
+ - **`INDICATOR_COMPARISON.md`** fully rewritten to track all indicators,
119
+ coverage percentages per category, and completed roadmap.
120
+
121
+ ### Fixed
122
+
123
+ - **SuperTrend state tracking** replaced fragile float comparison
124
+ `prevSuperTrend === upperBand` with `direction` variable for correct
125
+ trend-state transitions.
126
+ - **HMA performance** reduced from O(n³) to O(n²) by pre-computing
127
+ `2*WMA(n/2) - WMA(n)` values before the final WMA pass.
128
+ - **ZigZag pivot detection** replaced adjacent-bar comparison with
129
+ running extreme tracking to reliably capture peaks/troughs during
130
+ consolidation phases.
131
+
132
+ ---
133
+
134
+ ### AddedTradingView Competitive Parity
135
+
136
+ - **Heikin-Ashi candle type** — `barStyle="heikin_ashi"` prop. `heikinAshi(data)` exported.
137
+ - **Crosshair sync** in `MultiChartLayout``onCrosshairMove()` / `setCrosshair()` on handle.
138
+ - **Measure tool** 18th drawing tool in extension. Pixel distance label + risk/reward line.
139
+ - **Magnet/Snap helpers** `snapToOhlc()` and `snapAngle()` in `DrawingSnapper`.
140
+ - **Undo/Redo manager** — `UndoManager` class using `serializeState()`/`loadState()`.
141
+ - **Extended keyboard shortcuts** arrow keys pan, Page/Home/End, mouse wheel zoom at cursor.
142
+ - **Copy/paste drawings** Ctrl+C copies overlays as JSON, Ctrl+V pastes.
143
+ - **Session Visualizer** `SessionVisualizer` renders session high/low/open/close lines.
144
+ - **Volume Profile** `volumeProfilePlugin` horizontal histogram with POC + Value Area.
145
+ - **Position Visualizer** — `PositionVisualizer` entry/stop/target lines on chart.
146
+ - **Compare Overlay** `createCompareIndicator()` overlays second symbol normalized to %.
147
+ - **Lock all drawings** — `lockAllDrawings(locked)` on `AstroneumHandle`.
148
+ - **Drawing live preview** `DrawingTemplates.preview()` + `applyColor()` per-overlay.
149
+ - **Price axis scaling** — `priceScale='linear'|'log'|'percent'|'indexed'` prop + `PriceScaleTransform`.
150
+ - **Chart templates** — `ChartTemplateManager` singleton saves/loads named configs to localStorage.
151
+ - **Multi-timeframe resampling** `resampleBars()`, `forwardFill()`, `mtfIndicator()`.
152
+ - **Non-time-based bars** `generateRenko()`, `generateKagi()`, `generateTickBars()`, `generateRangeBars()`.
153
+ - **Point & Figure** `generatePointAndFigure()`, `computePFColumns()`, `pfColumnsToBars()`.
154
+ - **Multi-period layout** — `MultiPeriodLayout` stacked same-symbol different periods.
155
+ - **Auto pattern detection** — `zigzag()`, `detectSupportResistance()`, `zigzagPlugin`.
156
+ - **DOM visualization** — `domPlugin` bid/ask volume ladder.
157
+
158
+ ### Fixed Bug, Perf & Security Hardening
159
+
160
+ - **Bug: `rafMergeTick` low-merge inverted** — comparison operator fixed (was `<`, now `>`).
161
+ - **Bug: `ScriptEngine` figures mutation** — shared `this.figures` now uses `[...result.figures]`.
162
+ - **Bug: Plugin `figureKeys` closure leak** moved to per-instance `extendData`.
163
+ - **Bug: `Math.max(...arr)` stack overflow risk** replaced with iterative loops in `DrawingSnapper`/`GlyphAtlas`.
164
+ - **Bug: LTTB decimation NaN** empty bucket guard added in `PerformanceMode.decimate()`.
165
+ - **Bug: `virtualizeWindow` overlap** — startIdx/endIdx clamp added.
166
+ - **Bug: `useKeyboardShortcuts` stale ref** fixed stable wrapper pattern.
167
+ - **Perf: Tooltip style objects pre-computed** at module scope (no per-render allocation).
168
+ - **Perf: `adjustFromTo()` integer math** for week/month/year (eliminates `new Date()` allocations).
169
+ - **Perf: `serializeState()` uses `structuredClone`** instead of recursive `deepClone`.
170
+ - **Perf: 6 `useEffect` hooks batched** into one for engine prop sync.
171
+ - **Perf: `sortBarsAsc()` O(n) validation** before sort (99% of API responses are pre-sorted).
172
+ - **Perf: Shared color helpers** extracted to `candleShaders.ts` (~160 lines duplicated code removed).
173
+ - **Perf: `TaskScheduler` priority queue** — data > indicator > overlay priority ordering.
174
+ - **Perf: `IndicatorWorkerPool` SAB transfer** when `crossOriginIsolated`.
175
+ - **Perf: `packBars()` optional columns** bitmap for skipping unused columns.
176
+ - **Perf: `SharedIndicatorGLCanvas` FinalizationRegistry** for auto-cleanup.
177
+ - **Perf: aria-live string buffer reuse** instead of template-string allocation per move.
178
+ - **Security: ScriptEngine sandbox hardened** — `Object.freeze(Object/Array.prototype)` + `eval` blocked.
179
+ - **Security: AlertManager webhook URL validated** — https-only, block private IPs/localhost.
180
+ - **Security: localStorage writes debounced** — `AlertManager.check()` saves at most 1/s.
181
+ - **Security: localStorage schema validation** on load corrupted data rejected.
182
+ - **Security: WebSocket URL scheme validation** — `wss://`/`ws://` required.
183
+ - **Security: Polygon API key** moved from URL query param to `Authorization: Bearer` header.
184
+ - **Security: `#apiKey` private class field** — non-enumerable, safe from `JSON.stringify`.
185
+ - **Security: Locale strings stripped of HTML tags** — XSS prevention.
186
+ - **Security: `BarsCodec.decode()` capped** at 500k bars to prevent OOM.
187
+ - **Security: `pnpm audit` in all CI workflows.**
188
+ - **Security: TA surface gating + OPFS path safety** documented.
189
+
190
+ ## [0.3.0] — 2026-06-15
191
+
192
+ ### Addedv0.5 Polish (partial)
193
+
194
+ - **Lazy locale loading** ([src/i18n/index.ts](src/i18n/index.ts))
195
+ only `en-US` is bundled eagerly; the other 18 locales are loaded on
196
+ demand via dynamic `import()`. New public exports:
197
+ - `loadLocale(key)` — async loader for built-in locales
198
+ - `BUILTIN_LOCALES` — the canonical list
199
+ - Existing `loadLocales(key, dictionary)` continues to work for custom
200
+ translations.
201
+ - **Drawing & layout persistence** — `serializeState()` and `loadState(state)`
202
+ on `AstroneumHandle` capture / restore theme, locale, timezone, symbol,
203
+ period, styles, indicators, and overlays as JSON.
204
+ See [docs/api.md](docs/api.md#serializestate--loadstate).
205
+ - **Accessibility pass** opt-in via the new `accessible` prop on
206
+ `<AstroneumChart>`. When enabled, the chart container gets `tabindex=0`,
207
+ `role="img"`, and an `aria-label`; a visually-hidden `aria-live="polite"`
208
+ region announces OHLCV on crosshair changes (throttled to ~10/s).
209
+ - **High-contrast theme** set `theme="high-contrast"` for a
210
+ WCAG-conscious black/white/yellow palette with strong focus rings.
211
+ - **Benchmark CI workflow**
212
+ ([.github/workflows/benchmark.yml](.github/workflows/benchmark.yml))
213
+ runs `pnpm size` and the perf tests on every PR and posts the perf
214
+ output as a sticky comment.
215
+
216
+ ### Changed
217
+
218
+ - `WasmIndicators.ts` renamed to **`TypedArrayIndicators.ts`** to match
219
+ what it actually is (a column-store TS implementation). A back-compat
220
+ shim is kept at the old path with `@deprecated` JSDoc and will be
221
+ removed in v1.0.
222
+
223
+ ### Deferred
224
+
225
+ Still tracked for v0.6 – v1.0; not in this release:
226
+
227
+ - WebGPU renderer / real Rust + WASM SIMD indicators
228
+ - `OrderManager` + broker package
229
+ - Heatmap / footprint / options-chain panes
230
+ - Full mobile audit & Storybook site
231
+ - React component tests (jsdom + RTL) + Playwright visual regression
232
+ - Compare overlay UI
233
+
234
+ ---
235
+
236
+ ## [0.2.0] 2026-05-30
237
+
238
+ ### Added — v0.3 Hardening
239
+
240
+ - **Subpath exports** for tree-shakeable, opt-in feature modules
241
+ ([#roadmap-4](README.md#v04--modularization)):
242
+ - `@tony01/astroneum/replay` — `BarReplay`
243
+ - `@tony01/astroneum/multichart` — `MultiChartLayout`
244
+ - `@tony01/astroneum/watchlist` — `WatchlistManager`
245
+ - `@tony01/astroneum/portfolio` — `PortfolioTracker`
246
+ - `@tony01/astroneum/alerts` — `AlertManager`
247
+ - `@tony01/astroneum/script` — `ScriptEngine`
248
+ - `@tony01/astroneum/datafeeds/polygon` — `DefaultDatafeed` + `WebSocketDatafeed`
249
+ - `@tony01/astroneum/datafeeds/crypto` — `createStandardCryptoDatafeed` + adapters
250
+ - **`size-limit` budget** ([.size-limit.json](.size-limit.json)) with one
251
+ budget per entry. Run `pnpm size` after `pnpm build`.
252
+ - **Datafeed contract tests** ([src/__tests__/datafeed-contract.test.ts](src/__tests__/datafeed-contract.test.ts))
253
+ — type-level + behavioural checks for any `Datafeed` implementation.
254
+ - **SSR smoke tests** ([src/__tests__/ssr-smoke.test.ts](src/__tests__/ssr-smoke.test.ts))
255
+ — verifies the root entry and all subpath entries import cleanly with no
256
+ DOM globals defined, and that the root entry's public API surface is stable.
257
+ - **`CONTRIBUTING.md`**, **`SECURITY.md`**, **`CODE_OF_CONDUCT.md`**,
258
+ and this `CHANGELOG.md`.
259
+ - **Browser support matrix** documented in [README](README.md#browser-support).
260
+
261
+ ### Changed
262
+
263
+ - `pnpm verify` order is now `lint → typecheck → build → test` so SSR and
264
+ bundle tests can assert against fresh `dist/` output.
265
+ - `tsup.config.ts` now bundles every subpath entry and injects `'use client'`
266
+ into every emitted JS file (not just `dist/index.js`).
267
+ - `package.json#files` widened from `dist/*.{js,css,d.ts}` to
268
+ `dist/**/*.{js,css,d.ts}` so nested subpath artifacts ship.
269
+
270
+ ### Fixed
271
+
272
+ - `src/index.ts` no longer side-imports the non-existent
273
+ `./styles/index.less` (was a leftover from a SCSS migration and caused the
274
+ build to fail outright on a clean install).
275
+
276
+ ---
277
+
278
+ ## [0.2.0-baseline] — 2026-05-30
279
+
280
+ Initial public roadmap baseline. See git history for details prior to this
281
+ changelog being introduced.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Kowit Charoenratchatabhan
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kowit Charoenratchatabhan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.