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

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