openalgo-charts 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -22
- package/dist/index.d.ts +27 -13
- package/dist/openalgo-charts.indicators.mjs +1 -1
- package/dist/openalgo-charts.indicators.mjs.map +1 -1
- package/dist/openalgo-charts.mjs +1 -1
- package/dist/openalgo-charts.mjs.map +1 -1
- package/dist/openalgo-charts.profile.mjs +1 -1
- package/dist/openalgo-charts.profile.mjs.map +1 -1
- package/dist/openalgo-charts.standalone.js +1 -1
- package/dist/openalgo-charts.standalone.js.map +1 -1
- package/dist/openalgo-charts.widget.mjs +1 -1
- package/dist/openalgo-charts.widget.mjs.map +1 -1
- package/dist/profile/index.d.ts +95 -83
- package/dist/widget/index.d.ts +8 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
**A from-scratch, dependency-free HTML5-canvas charting engine for OpenAlgo.**
|
|
6
6
|
|
|
7
|
-
Professional interactive charts, 102 built-in indicators plus your own custom ones, 51 drawing tools, order flow, market replay, linked chart grids, on-chart trading, vector SVG export and an optional WebGL2 backend. Eight lazy-loaded tiers, zero runtime dependencies, 66.
|
|
7
|
+
Professional interactive charts, 102 built-in indicators plus your own custom ones, 51 drawing tools, order flow, market replay, linked chart grids, on-chart trading, vector SVG export and an optional WebGL2 backend. Eight lazy-loaded tiers, zero runtime dependencies, 66.65 KB Brotli for the base engine, and a one-call widget tier that adds the toolbar, drawing rail, dialogs and shortcuts.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/openalgo-charts)
|
|
10
10
|
[](./LICENSE)
|
|
11
|
-
[](#size-budget)
|
|
12
|
+
[](#develop)
|
|
13
13
|
[](#principles)
|
|
14
14
|
|
|
15
15
|
[**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)
|
|
@@ -43,6 +43,13 @@ Every chart in the [live gallery](https://marketcalls.github.io/openalgo-charts/
|
|
|
43
43
|
|
|
44
44
|
## Install
|
|
45
45
|
|
|
46
|
+
Current version: **2.1.2**.
|
|
47
|
+
|
|
48
|
+
This patch fixes external-indicator races, live history recovery and OpenAlgo
|
|
49
|
+
protocol compatibility, and adds optional widget stylesheet nonces. See the
|
|
50
|
+
[2.1.2 changelog](./CHANGELOG.md#212) and
|
|
51
|
+
[OpenAlgo compatibility guide](https://marketcalls.github.io/openalgo-charts/docs/openalgo-compatibility/).
|
|
52
|
+
|
|
46
53
|
```bash
|
|
47
54
|
npm install openalgo-charts
|
|
48
55
|
```
|
|
@@ -62,7 +69,7 @@ in front of npm rather than being places you upload to. A chart is one HTML file
|
|
|
62
69
|
```html
|
|
63
70
|
<div id="chart" style="width:100vw;height:100vh"></div>
|
|
64
71
|
<script type="module">
|
|
65
|
-
import { createChart } from 'https://unpkg.com/openalgo-charts@2.1.
|
|
72
|
+
import { createChart } from 'https://unpkg.com/openalgo-charts@2.1.2/dist/openalgo-charts.mjs';
|
|
66
73
|
const chart = createChart(document.getElementById('chart'), { timezone: 'Asia/Kolkata' });
|
|
67
74
|
chart.addSeries('candlestick').setData(bars);
|
|
68
75
|
</script>
|
|
@@ -101,16 +108,16 @@ Import only what you use. Each tier is a separate bundle that registers into the
|
|
|
101
108
|
|
|
102
109
|
| Import | Contents | Brotli |
|
|
103
110
|
|---|---|---|
|
|
104
|
-
| `openalgo-charts` | Engine, 13 chart types, panes & scales, primitives, registries, chart state, chart linking, bar cache, interval registry, trading overlay, SVG export, render backend port, OpenAlgo feeds | 66.
|
|
105
|
-
| `openalgo-charts/indicators` | 102 built-in indicators, the `registerIndicator` contract for your own, and the Tier-2 (external-data) contract | 27.
|
|
111
|
+
| `openalgo-charts` | Engine, 13 chart types, panes & scales, primitives, registries, chart state, chart linking, bar cache, interval registry, trading overlay, SVG export, render backend port, OpenAlgo feeds | 66.65 KB |
|
|
112
|
+
| `openalgo-charts/indicators` | 102 built-in indicators, the `registerIndicator` contract for your own, and the Tier-2 (external-data) contract | 27.36 KB |
|
|
106
113
|
| `openalgo-charts/draw` | 51 drawing tools + a headless drawing controller, clipboard, settings schema, level palette, freehand geometry and SVG icons | 25.82 KB |
|
|
107
114
|
| `openalgo-charts/transform` | Heikin Ashi, Renko, Range bars, Line Break, Point & Figure, Kagi | 2.66 KB |
|
|
108
|
-
| `openalgo-charts/profile` | Volume Profile, Market Profile (TPO) with compact pixel letters, Footprint, order flow |
|
|
115
|
+
| `openalgo-charts/profile` | Volume Profile, Market Profile (TPO) with compact pixel letters, Footprint, order flow | 14.96 KB |
|
|
109
116
|
| `openalgo-charts/trade` | Order / position / bracket tools + DOM ladder | 7.61 KB |
|
|
110
117
|
| `openalgo-charts/webgl` | WebGL2 series backend: batched, analytically anti-aliased GPU rendering of the standard chart types behind `renderer: 'auto'`, with a session-long fallback to the 2D path | 6.38 KB |
|
|
111
|
-
| `openalgo-charts/widget` | The chart with its chrome in one call: `createWidget` adds a top bar, the drawing rail, a status line, the settings and indicator dialogs, drawing properties, a right-click menu, a keymap with a `?` panel and optional layout persistence. The only tier that ships DOM |
|
|
118
|
+
| `openalgo-charts/widget` | The chart with its chrome in one call: `createWidget` adds a top bar, the drawing rail, a status line, the settings and indicator dialogs, drawing properties, a right-click menu, a keymap with a `?` panel and optional layout persistence. The only tier that ships DOM | 36.00 KB |
|
|
112
119
|
|
|
113
|
-
Everything together is **
|
|
120
|
+
Everything together is **187.42 KB Brotli**; a widget terminal (base + draw + indicators + widget, what one `createWidget` call loads) is 155.82 KB. Figures are the measured `size-limit` output. The trade tier is listed as its delta over the base, so loading base + trade costs 74.26 KB.
|
|
114
121
|
|
|
115
122
|
## What's built
|
|
116
123
|
|
|
@@ -245,6 +252,72 @@ Headless like the rest, and the engine has no instrument concept, so symbol sync
|
|
|
245
252
|
### Trading
|
|
246
253
|
Order, position, and bracket lines with live P&L, one-click and drag-to-modify, OCO, validation, an order state machine, analyzer (sandbox) mode, and a depth-of-market ladder (5 to 200 levels).
|
|
247
254
|
|
|
255
|
+
### Depth of market: simulated live example
|
|
256
|
+
|
|
257
|
+
[Try the depth ladder](https://marketcalls.github.io/openalgo-charts/docs/depth-of-market/)
|
|
258
|
+
with continuously simulated bids and asks, pause/resume, 5/20/200 depth levels,
|
|
259
|
+
and configurable price grouping independent of the candlestick chart's scale.
|
|
260
|
+
Try option candles with an option ladder, or spot candles with a separate ATM
|
|
261
|
+
call ladder. The
|
|
262
|
+
[drawing playground](https://marketcalls.github.io/openalgo-charts/docs/drawing-tools/)
|
|
263
|
+
also lets you place, select, move, delete, undo and redo drawings.
|
|
264
|
+
|
|
265
|
+
```html
|
|
266
|
+
<div id="depth-chart" style="height: 440px"></div>
|
|
267
|
+
<div style="max-height: 440px; overflow: auto">
|
|
268
|
+
<table>
|
|
269
|
+
<thead><tr><th>Bid qty</th><th>Price</th><th>Ask qty</th></tr></thead>
|
|
270
|
+
<tbody id="depth-rows"></tbody>
|
|
271
|
+
</table>
|
|
272
|
+
</div>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
import { createChart, darkTheme, generateBars } from 'openalgo-charts';
|
|
277
|
+
import { buildRows, FakeBroker } from 'openalgo-charts/trade';
|
|
278
|
+
|
|
279
|
+
const chart = createChart(document.getElementById('depth-chart')!, { theme: darkTheme });
|
|
280
|
+
const bars = generateBars(1700000000, 120, 60);
|
|
281
|
+
chart.addSeries('candlestick').setData(bars);
|
|
282
|
+
chart.timeScale.fitContent(bars.length);
|
|
283
|
+
const mid = Math.round(bars.at(-1)!.close / 0.05) * 0.05;
|
|
284
|
+
const bookRows = document.getElementById('depth-rows')!;
|
|
285
|
+
let groupBy = 20; // Change this to regroup the ladder; the chart keeps its own scale.
|
|
286
|
+
|
|
287
|
+
let step = 0;
|
|
288
|
+
function updateDepth() {
|
|
289
|
+
const price = mid + Math.round(Math.sin(step++ / 8) * 4) * 0.05;
|
|
290
|
+
const depth = FakeBroker.makeDepth(price, 200, 0.05);
|
|
291
|
+
bookRows.replaceChildren(...buildRows(depth, 0.05, groupBy).map(row => {
|
|
292
|
+
const tr = document.createElement('tr');
|
|
293
|
+
for (const text of [String(row.bidQty), row.price.toFixed(2), String(row.askQty)]) {
|
|
294
|
+
const td = document.createElement('td');
|
|
295
|
+
td.textContent = text;
|
|
296
|
+
td.style.height = '28px';
|
|
297
|
+
tr.append(td);
|
|
298
|
+
}
|
|
299
|
+
return tr;
|
|
300
|
+
}));
|
|
301
|
+
}
|
|
302
|
+
updateDepth();
|
|
303
|
+
const timer = setInterval(updateDepth, 750);
|
|
304
|
+
|
|
305
|
+
// Call this when removing the demo from your application.
|
|
306
|
+
function dispose() {
|
|
307
|
+
clearInterval(timer);
|
|
308
|
+
chart.destroy();
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
`tickSize` is the instrument's minimum tick; `groupBy` is the number of ticks
|
|
313
|
+
per display row. Here, 20 × 0.05 creates 1.00-point rows. Quantities are summed
|
|
314
|
+
into the nearest price bucket, with bids and asks kept separate. Grouping changes
|
|
315
|
+
the display; it does not change the instrument's valid order prices. With a real
|
|
316
|
+
feed, pass each supplied order-book snapshot to `buildRows`. Chart candles and
|
|
317
|
+
ladder depth can come from separate instrument subscriptions. `DomLadder` remains
|
|
318
|
+
available for an attached ladder that aligns to the chart's own price scale;
|
|
319
|
+
see the guide for both integration patterns.
|
|
320
|
+
|
|
248
321
|
### Profiles & order flow
|
|
249
322
|
Volume Profile, Market Profile (TPO), Footprint, and cumulative delta.
|
|
250
323
|
|
|
@@ -258,10 +331,37 @@ newest-session `#` price markers, and Dark, Blue, Graphite, Emerald and Ivory th
|
|
|
258
331
|
|
|
259
332
|
The [website profile guide](./website/pages/docs/market-profile-examples.mdx) includes
|
|
260
333
|
the interactive demo, all five theme screenshots and packed/split close-ups.
|
|
261
|
-
See the [2.1.
|
|
262
|
-
|
|
263
|
-
<a href="website/public/screenshots/market-profile/blue.png"><img src="website/public/screenshots/market-profile/blue.png" alt="Blue
|
|
264
|
-
<a href="website/public/screenshots/market-profile/ivory.png"><img src="website/public/screenshots/market-profile/ivory.png" alt="Ivory
|
|
334
|
+
See the [2.1.1 changelog](./CHANGELOG.md#211).
|
|
335
|
+
|
|
336
|
+
<a href="website/public/screenshots/market-profile-v2.1.1/blue.png"><img src="website/public/screenshots/market-profile-v2.1.1/blue.png" alt="Blue TPO close-up with readable letters and the newest session split" width="400" /></a>
|
|
337
|
+
<a href="website/public/screenshots/market-profile-v2.1.1/ivory.png"><img src="website/public/screenshots/market-profile-v2.1.1/ivory.png" alt="Ivory TPO close-up using the same synthetic session" width="400" /></a>
|
|
338
|
+
|
|
339
|
+
### Footprint charts in 2.1.1
|
|
340
|
+
|
|
341
|
+
`Footprint` supports volume-profile rows, cluster ladders and heatmaps through
|
|
342
|
+
`cellStyle: 'profile' | 'ladder' | 'heatmap'`. Background display and text coloring
|
|
343
|
+
are independent: `textColorMode` selects neutral contrast, bid/ask side, row delta,
|
|
344
|
+
same-row dominance, diagonal imbalance or volume intensity. Separate
|
|
345
|
+
`buyTextColor` and `sellTextColor` palettes keep the numbers readable on light,
|
|
346
|
+
dark and bright fills. Candle context, POC/value-area markers and per-bar
|
|
347
|
+
volume, delta, cumulative delta and actual trade-count summaries complete the view.
|
|
348
|
+
|
|
349
|
+
The optional bottom table is disabled by default. Set `tableRows` to any ordered
|
|
350
|
+
subset of `['delta', 'minDelta', 'maxDelta', 'cvd', 'askVolume', 'bidVolume', 'volume']`.
|
|
351
|
+
Columns follow their footprint bars; the fixed left column names each metric.
|
|
352
|
+
Min/Max Delta measure the running delta within the bar, including initial zero.
|
|
353
|
+
The demo simulates NIFTY near 23,800 with 2-point rows and provides a Table switch
|
|
354
|
+
and row checkboxes, independent of the per-bar cards.
|
|
355
|
+
Switch Quantity/Lots and edit the lot size (initially 65) to change display units.
|
|
356
|
+
The library option `volumeDivisor: 65` scales volume and delta labels; its default
|
|
357
|
+
is 1. Raw statistics, delta percentages and actual trade counts remain unchanged.
|
|
358
|
+
|
|
359
|
+
Try the [order-flow example](./examples/orderflow/index.html) and follow the
|
|
360
|
+
[footprint guide](./website/pages/docs/profiles-and-orderflow.mdx). The example uses
|
|
361
|
+
synthetic classified trades; production footprints require actual bid/ask trade
|
|
362
|
+
classification. The 2.1.1 data fixes preserve detached live snapshots, respect
|
|
363
|
+
missing ladder rows during imbalance comparisons, and retain real OHLC and
|
|
364
|
+
trade-count metadata.
|
|
265
365
|
|
|
266
366
|
### Warm-load cache & interval registry
|
|
267
367
|
|
|
@@ -309,16 +409,16 @@ Enforced in CI by [`size-limit`](./.size-limit.json). Nothing is excluded, becau
|
|
|
309
409
|
|
|
310
410
|
| Bundle | Limit | Actual |
|
|
311
411
|
|---|---|---|
|
|
312
|
-
| Base engine | 67 KB | 66.
|
|
313
|
-
| Base + trade | 75 KB | 74.
|
|
314
|
-
| Indicators tier | 30 KB | 27.
|
|
412
|
+
| Base engine | 67 KB | 66.65 KB |
|
|
413
|
+
| Base + trade | 75 KB | 74.26 KB |
|
|
414
|
+
| Indicators tier | 30 KB | 27.36 KB |
|
|
315
415
|
| Draw tier | 26 KB | 25.82 KB |
|
|
316
416
|
| Transform tier | 5 KB | 2.66 KB |
|
|
317
|
-
| Profile tier |
|
|
417
|
+
| Profile tier | 15 KB | 14.96 KB |
|
|
318
418
|
| WebGL2 tier | 7 KB | 6.38 KB |
|
|
319
|
-
| Widget tier | 36 KB |
|
|
320
|
-
| Widget terminal (base + draw + indicators + widget) | 156 KB | 155.
|
|
321
|
-
| **Everything** | **
|
|
419
|
+
| Widget tier | 36 KB | 36.00 KB |
|
|
420
|
+
| Widget terminal (base + draw + indicators + widget) | 156 KB | 155.82 KB |
|
|
421
|
+
| **Everything** | **188 KB** | **187.42 KB** |
|
|
322
422
|
|
|
323
423
|
## Documentation
|
|
324
424
|
|
|
@@ -361,7 +461,7 @@ python server.py --fixture # no yfinance, no network: deterministic synthetic
|
|
|
361
461
|
```bash
|
|
362
462
|
npm install # install dev toolchain
|
|
363
463
|
npm run typecheck # strict TypeScript check
|
|
364
|
-
npm test # unit tests (vitest) -
|
|
464
|
+
npm test # unit tests (vitest) - 4194 across 180 files
|
|
365
465
|
npm run build # Rollup -> dist/ (minified ESM per tier + types)
|
|
366
466
|
npm run size # size-limit (Brotli) against the budget
|
|
367
467
|
npm run e2e # Playwright Chromium smoke tests
|
|
@@ -378,7 +478,7 @@ npm run verify # lint + typecheck + test + build + demo tests + dts + size +
|
|
|
378
478
|
|
|
379
479
|
## Status & limitations
|
|
380
480
|
|
|
381
|
-
Version **2.1.
|
|
481
|
+
Version **2.1.2**. All engine build phases are implemented. Upgrading a 1.9.x host: [Migrating to 2.0](./docs/migrating-to-2.md).
|
|
382
482
|
|
|
383
483
|
Known gaps, stated plainly:
|
|
384
484
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** Library version string. Matches package.json (
|
|
2
|
-
declare const VERSION = "2.1.
|
|
1
|
+
/** Library version string. Matches package.json (including locally prepared releases). */
|
|
2
|
+
declare const VERSION = "2.1.2";
|
|
3
3
|
/** Returns the current library version. */
|
|
4
4
|
declare function version(): string;
|
|
5
5
|
|
|
@@ -3350,6 +3350,8 @@ interface ChartOptions {
|
|
|
3350
3350
|
theme?: ChartTheme;
|
|
3351
3351
|
priceAxisWidth?: number;
|
|
3352
3352
|
timeAxisHeight?: number;
|
|
3353
|
+
/** Initial horizontal scale configuration, including spacing limits for wide profiles. */
|
|
3354
|
+
timeScale?: Partial<TimeScaleOptions>;
|
|
3353
3355
|
/**
|
|
3354
3356
|
* Where indicator legend rows start inside **one** pane, in media px. A host
|
|
3355
3357
|
* that draws its own overlay in a pane's top-left corner — an OHLC readout, a
|
|
@@ -6660,6 +6662,21 @@ interface BarsRequest {
|
|
|
6660
6662
|
interval: string;
|
|
6661
6663
|
from?: UTCSeconds;
|
|
6662
6664
|
to?: UTCSeconds;
|
|
6665
|
+
/** Fetch authoritative history instead of a cached snapshot, when supported. */
|
|
6666
|
+
noCache?: boolean;
|
|
6667
|
+
}
|
|
6668
|
+
/** Optional context for continuing history and recovering an interrupted stream. */
|
|
6669
|
+
interface BarSubscriptionOptions {
|
|
6670
|
+
/** Last historical time-bucketed bar, used as the live builder's starting point. */
|
|
6671
|
+
seedFrom?: Bar;
|
|
6672
|
+
/** Cumulative day volume at the seed snapshot, if the host knows it. */
|
|
6673
|
+
cumDayVolumeSoFar?: number;
|
|
6674
|
+
/**
|
|
6675
|
+
* The stream reconnected and may have missed data. Refresh authoritative
|
|
6676
|
+
* history, then resubscribe with its last bar as the seed. Older bars must
|
|
6677
|
+
* not be delivered through onBar, whose consumers commonly accept only tails.
|
|
6678
|
+
*/
|
|
6679
|
+
onResync?: () => void;
|
|
6663
6680
|
}
|
|
6664
6681
|
/**
|
|
6665
6682
|
* Broker-agnostic market-data source. The chart depends only on this.
|
|
@@ -6668,7 +6685,7 @@ interface BarsRequest {
|
|
|
6668
6685
|
*/
|
|
6669
6686
|
interface DataFeed {
|
|
6670
6687
|
getBars(req: BarsRequest): Promise<Bar[]>;
|
|
6671
|
-
subscribeBars?(req: BarsRequest, onBar: (bar: Bar) => void): UnsubscribeFn;
|
|
6688
|
+
subscribeBars?(req: BarsRequest, onBar: (bar: Bar) => void, opts?: BarSubscriptionOptions): UnsubscribeFn;
|
|
6672
6689
|
/**
|
|
6673
6690
|
* `opts.depthLevel` requests a book depth (broker-dependent: 5/20/30/50).
|
|
6674
6691
|
* Named on the interface so a caller holding a `DataFeed` can ask for one;
|
|
@@ -6747,6 +6764,7 @@ interface HistoryRow {
|
|
|
6747
6764
|
}
|
|
6748
6765
|
interface HistoryResponse {
|
|
6749
6766
|
status?: string;
|
|
6767
|
+
message?: string;
|
|
6750
6768
|
data?: HistoryRow[];
|
|
6751
6769
|
}
|
|
6752
6770
|
/** Pure: coerce a row timestamp (epoch s / epoch ms / IST string) to UTC seconds. */
|
|
@@ -6768,7 +6786,7 @@ declare class OpenAlgoDataFeed implements DataFeed {
|
|
|
6768
6786
|
* server answers { type:'auth', status:'success' } (or a refusal)
|
|
6769
6787
|
* 2. subscribe : { action:'subscribe', symbol, exchange, mode } mode 1=LTP 2=Quote 3=Depth
|
|
6770
6788
|
* (Depth adds depth_level, e.g. 5/20/30/50)
|
|
6771
|
-
* 3. server pushes { type:'market_data',
|
|
6789
|
+
* 3. server pushes { type:'market_data', symbol, exchange, mode, data:{...} }
|
|
6772
6790
|
* 4. heartbeat : OpenAlgo's proxy pings at the protocol level, which a
|
|
6773
6791
|
* browser answers without telling JavaScript, so the client keeps its own
|
|
6774
6792
|
* watchdog and asks { action:'ping' } when the stream goes quiet. An
|
|
@@ -6970,9 +6988,8 @@ declare function backoffDelayMs(attempt: number, opts: {
|
|
|
6970
6988
|
* Payload fields live under `data` per the protocol, but the parser also
|
|
6971
6989
|
* tolerates a flat shape for resilience across broker adapters.
|
|
6972
6990
|
*
|
|
6973
|
-
*
|
|
6974
|
-
*
|
|
6975
|
-
* instrument no subscriber matched.
|
|
6991
|
+
* The proxy puts identity on the envelope. Existing nested broker identity
|
|
6992
|
+
* takes precedence, with `topic` retained as the final fallback.
|
|
6976
6993
|
*/
|
|
6977
6994
|
declare function parseMessage(raw: unknown): {
|
|
6978
6995
|
kind: 'ltp';
|
|
@@ -7616,10 +7633,7 @@ declare class OpenAlgoLiveDataFeed implements DataFeed {
|
|
|
7616
7633
|
* a `day-delta` builder diffs against the right baseline. Seeding applies to
|
|
7617
7634
|
* time-bucketed intervals: a count-driven bar cannot resume a historical one.
|
|
7618
7635
|
*/
|
|
7619
|
-
subscribeBars(req: BarsRequest, onBar: (bar: Bar) => void, opts?:
|
|
7620
|
-
seedFrom?: Bar;
|
|
7621
|
-
cumDayVolumeSoFar?: number;
|
|
7622
|
-
}): UnsubscribeFn;
|
|
7636
|
+
subscribeBars(req: BarsRequest, onBar: (bar: Bar) => void, opts?: BarSubscriptionOptions): UnsubscribeFn;
|
|
7623
7637
|
/** A broker may omit the tick timestamp; never bucket at the epoch, use now. */
|
|
7624
7638
|
private static _tickTime;
|
|
7625
7639
|
private _candleReader;
|
|
@@ -7655,7 +7669,7 @@ declare class FakeDataFeed implements DataFeed {
|
|
|
7655
7669
|
* (`if (feed.subscribeBars)`) is honest. Pass a manual scheduler to drive it
|
|
7656
7670
|
* by hand in tests, and `opts.tickMs` to change the cadence.
|
|
7657
7671
|
*/
|
|
7658
|
-
subscribeBars(req: BarsRequest, onBar: (bar: Bar) => void, opts?: {
|
|
7672
|
+
subscribeBars(req: BarsRequest, onBar: (bar: Bar) => void, opts?: BarSubscriptionOptions & {
|
|
7659
7673
|
tickMs?: number;
|
|
7660
7674
|
}): UnsubscribeFn;
|
|
7661
7675
|
}
|
|
@@ -8232,4 +8246,4 @@ declare function lerp(a: number, b: number, t: number): number;
|
|
|
8232
8246
|
*/
|
|
8233
8247
|
declare function roundToTick(value: number, step: number): number;
|
|
8234
8248
|
|
|
8235
|
-
export { ALT_PRESET, type AddSeriesOptions, type AggTick, type AxisChromeOptions, type AxisStyle, BUILTIN_COMMANDS, type Bar, BarCache, type BarCacheOptions, type BarCacheStats, type BarCacheStore, type BarUpdate, type BarsRequest, type Bucketing, BuySellButtons, type BuySellButtonsOptions, CHART_STATE_VERSION, type CachedBars, type CachedBarsRequest, type CalendarBucketing, type CalendarUnit, CandleBuilder, type CandleBuilderOptions, type CandleGeometry, type CandleStyle, type CandleTier, type CandleUpdate, Canvas2dBackend, type CanvasLineStyle, type CanvasOptions, Chart, type ChartClickEvent, type ChartDragEndEvent, type ChartDragEvent, type ChartEvent, type ChartEventOptions, type ChartOptions, type ChartSettingsColorPairInput, type ChartSettingsInput, type ChartSettingsState, type ChartSettingsTab, type ChartSettingsTabId, type ChartSettingsValue, type ChartSettingsValues, type ChartState, ChartTable, type ChartTableOptions, type ChartTheme, type ComparisonAlignment, type ComparisonChartHost, ComparisonController, type ComparisonControllerOptions, type ComparisonHandle, type ComparisonMode, type ComparisonOptions, type ComparisonPane, type ContextMenuEvent, type ContextMenuTarget, type ContextMenuTargetKind, type CrosshairMoveEvent, type CrosshairOptions, type CrosshairStyle, type CustomShortcut, DEFAULT_CANDLE_BUILDER_OPTIONS, DEFAULT_CANDLE_STYLE, DEFAULT_CHART_TABLE_OPTIONS, DEFAULT_HISTOGRAM_STYLE, DEFAULT_KEYMAP, DEFAULT_PRICE_SCALE_OPTIONS, DEFAULT_THEME, DEFAULT_TIMEZONE, DEFAULT_TIME_NAVIGATOR_OPTIONS, DEFAULT_TIME_SCALE_OPTIONS, DEFAULT_TRADING_COLORS, DEFAULT_ZOOM_GLIDE_OPTIONS, type DataFeed, DataLayer, type DecodedOrder, type DepthLevel, type DoubleClickAction, type DoubleClickEvent, type DrawAnchor, type DrawItem, EventMarkers, type ExportSvgOptions, FakeDataFeed, type FeedScheduler, type FillGradient, type FillPoint, type GridAxisStyle, type GridOptions, type GridStyle, type HistogramStyle, INDICATOR_LINE_STYLES, INDICATOR_PLOT_STYLES, INDICATOR_SOURCES, type IPrimitive, type IRenderBackend, IST_OFFSET_SECONDS, type IndexedBar, type IndicatorAlertContext, type IndicatorAlertPayload, type IndicatorAlertSpec, type IndicatorApi, type IndicatorAttachContext, IndicatorBackground, type IndicatorCalcContext, type IndicatorDescriptor, type IndicatorDrawing, IndicatorDrawings, IndicatorFill, type IndicatorFillOptions, type IndicatorFillSpec, type IndicatorHost, type IndicatorInput, type IndicatorLevel, type IndicatorLevelContext, type IndicatorLineStyle, type IndicatorPlot, type IndicatorSettings, type IndicatorSource, type IndicatorState, type IndicatorStore, type IndicatorValues, type IntervalBucketing, type IntervalDescriptor, type IntervalParts, InvalidationLevel, type IstParts, type KeymapEntry, LINK_CROSSHAIR_ALPHA, type LateTickPolicy, type LegendField, type LegendStatusData, type LegendStatusLineOptions, type LegendStatusSource, type LegendTitleMode, type LegendValue, type LinePoint, type LinkChart, LinkCrosshair, type LinkDataLayer, LinkGroup, type LinkMemberOptions, type LinkMissingPolicy, type LinkOptions, type LogicalRange, LogoWatermark, type LogoWatermarkOptions, type LtpEvent, type MarkerPosition, type MarkerShape, type MarkerSize, type MarketDepth, type MarketPhase, type MarketPhaseFn, type MaybePromise, type ModeCheck, type OpenAlgoConfig, OpenAlgoDataFeed, type OpenAlgoLiveConfig, OpenAlgoLiveDataFeed, type OpenAlgoTradeConfig, OpenAlgoTradeFeed, type OpenAlgoWsConfig, OpenAlgoWsFeed, type OrderBookSnapshot, type OrderDecodeCode, type OrderDecodeIssue, type OrderDecodeResult, type OrderSide$1 as OrderSide, type OrderType$1 as OrderType, type OrderUpdateEvent, type OriginalTime, PRICE_LEVEL_KINDS, PRICE_SCALE_MODES, Pane, type PaneInvalidation, PaneLegend, type PaneLegendAction, type PaneLegendOptions, type PaneState, type PickHost, type PickKind, type PlaceOrder, type PlotMarginOptions, type PointerInfo, type PointerKind, type PointerModifiers, type PointerSample, type PositionSide, type PriceAxisState, type PriceLevelInput, type PriceLevelKind, type PriceLevelQuote, type PriceLevelStyle, type PriceLevelValues, PriceLevels, type PriceLevelsOptions, PriceLine, type PriceLineOptions, type PriceRange, PriceScale, type PriceScaleId, type PriceScaleMode, type PriceScaleOptions, type PriceScaleState, type PrimitiveAnchor, type PrimitiveHit, type PrimitiveHost, type PrimitivePlacement, type PrimitiveRenderContext, type QuarantinedRow, type RawOrder, type RenderBackendFactory, type RenderBackendKind, type RenderDevice, type RendererChoice, type RendererEntry, type RendererFallbackEvent, type RendererFallbackReason, type ReplayChartHost, ReplayController, type ReplayOptions, type ReplayScheduler, ReplayShade, type ReplayShadeOptions, type ReplayState, type ReplayViewport, type ResolvedLinkOptions, type RestoreReport, SCALE_FONT_MAX, SCALE_FONT_MIN, type ScaleCanvasOptions, type SeriesApi, type SeriesDataItem, type SeriesId, type SeriesMarker, SeriesMarkers, type SeriesRenderContext, type SeriesState, type SeriesStyle, type SeriesType, type SessionSpec, type ShortcutListItem, ShortcutManager, type ShortcutManagerOptions, type ShortcutPreset, type ShortcutScope, type ShortcutTriggerEvent, type Size, type SocketFactory, type SocketLike, type SupertrendPoint, SvgContext, type SvgContextOptions, SvgLinearGradient, type TableCell, type TablePosition, TextWatermark, type TextWatermarkOptions, type Tick, TickBarAggregator, type TickBarOptions, type TickCountBucketing, type TickMarkType, type TickTimeframe, TimeNavigator, type TimeNavigatorAction, type TimeNavigatorOptions, TimeScale, type TimeScaleOp, type TimeScaleOptions, type TradeFeed, type TradeMarkerVariant, TradeMarkersPrimitive, type TradingColors, TradingController, type TradingHost, type TradingLineStyle, type TradingLineVariant, type TradingOrder, type TradingOrderSide, type TradingOrderType, type TradingPosition, type TradingSettings, type TradingSyncPayload, type TradingTrade, type UTCSeconds, UnknownIntervalError, type UnsubscribeFn, VERSION, type VolumeBucketing, type VolumeMode, type WatermarkPosition, type Whitespace, type WsClientWarning, type WsControlMessage, type WsMode, type WsState, type ZOrder, type ZonedParts, type ZonedPeriod, type ZoomAnchor, ZoomGlide, type ZoomGlideOptions, addComparison, alignToPrimary, applyChartSettings, atr, autoscaleRange, backendDegradation, backoffDelayMs, barCacheKey, barCloseSec, beginPick, bestHit, bitmapSize, bucketStartOf, calendarPeriodFlags, candleGeometry, candleTier, chartSettingsSchema, clamp, classifyAuthAck, compactVolume, comparisonController, computePriceLevels, conflateBars, conflateItems, conflationGroupSize, createChart, createLinkGroup, createRenderBackend, darkTheme, dashPattern, decodeOrder, drawLabel, drawShape, effectiveMarkerPx, ema, emaSeries, epochMsToUtcSeconds, eventToCombo, followerIndex, followerRange, formatCombo, formatIstCrosshairLabel, formatIstDate, formatIstTime, formatIstTimeSeconds, formatSubscribe, formatUnsubscribe, formatZonedCrosshairLabel, formatZonedDate, formatZonedTime, formatZonedTimeSeconds, fromGradient, generateBars, getChartType, getIndicator, hasIndicator, inSessionAt, indicatorDefaults, indicatorStyleInputs, intervalParts, intervalToSeconds, isDailyInterval, isIntradayInterval, isKnownInterval, isNewIstDay, isNewZonedDay, isNewZonedMonth, isNewZonedPeriod, isNewZonedQuarter, isNewZonedWeek, isNewZonedYear, isRebasing, isReservedCombo, isSecondsInterval, isTickInterval, isTimeBucketed, isValidCombo, isValidTimezone, isWhitespace, istStringToUtcSeconds, lastPriceLevelFromSeriesStyle, lerp, lightTheme, mapHistoryResponse, mapOrder, mapOrderStatus, mapPosition, markerSizePx, mergeBars, nextBucketStart, niceTicks, normalizeCombo, optimalBarWidth, parseCombo, parseMessage, parseSessionSpec, parseTopic, plotStyleKeys, precisionForStep, readChartSettings, readSequence, registerChartType, registerIndicator, registerInterval, registerRenderBackend, registeredChartTypes, registeredIndicators, registeredIntervals, registeredRenderBackends, resolveCrosshairStyle, resolveGridStyle, resolveInterval, resolvePlotMargins, resolveRenderBackend, resolveScaleStyle, roundToTick, rowTimeToUtcSeconds, rsi, rsiSeries, seriesStyleForLastPriceLevel, sessionFlags, sessionStartFlags, sessionStartIndices, snapToDevicePixel, sourceValue, sourceValues, startOfZonedDay, startOfZonedMonth, startOfZonedWeek, supertrend, supertrendSeries, tableOrigin, toBar, trueRange, tryResolveInterval, unregisterInterval, unregisterRenderBackend, utcSecondsToIstDateString, utcSecondsToIstParts, utcSecondsToZonedDateString, utcSecondsToZonedParts, version, verticalGradient, watermarkRect, withAlpha, withBarCache, zoneOffsetSeconds, zonedDayIndex, zonedStringToUtcSeconds, zonedWallClockToUtcSeconds, zonedWeekIndex };
|
|
8249
|
+
export { ALT_PRESET, type AddSeriesOptions, type AggTick, type AxisChromeOptions, type AxisStyle, BUILTIN_COMMANDS, type Bar, BarCache, type BarCacheOptions, type BarCacheStats, type BarCacheStore, type BarSubscriptionOptions, type BarUpdate, type BarsRequest, type Bucketing, BuySellButtons, type BuySellButtonsOptions, CHART_STATE_VERSION, type CachedBars, type CachedBarsRequest, type CalendarBucketing, type CalendarUnit, CandleBuilder, type CandleBuilderOptions, type CandleGeometry, type CandleStyle, type CandleTier, type CandleUpdate, Canvas2dBackend, type CanvasLineStyle, type CanvasOptions, Chart, type ChartClickEvent, type ChartDragEndEvent, type ChartDragEvent, type ChartEvent, type ChartEventOptions, type ChartOptions, type ChartSettingsColorPairInput, type ChartSettingsInput, type ChartSettingsState, type ChartSettingsTab, type ChartSettingsTabId, type ChartSettingsValue, type ChartSettingsValues, type ChartState, ChartTable, type ChartTableOptions, type ChartTheme, type ComparisonAlignment, type ComparisonChartHost, ComparisonController, type ComparisonControllerOptions, type ComparisonHandle, type ComparisonMode, type ComparisonOptions, type ComparisonPane, type ContextMenuEvent, type ContextMenuTarget, type ContextMenuTargetKind, type CrosshairMoveEvent, type CrosshairOptions, type CrosshairStyle, type CustomShortcut, DEFAULT_CANDLE_BUILDER_OPTIONS, DEFAULT_CANDLE_STYLE, DEFAULT_CHART_TABLE_OPTIONS, DEFAULT_HISTOGRAM_STYLE, DEFAULT_KEYMAP, DEFAULT_PRICE_SCALE_OPTIONS, DEFAULT_THEME, DEFAULT_TIMEZONE, DEFAULT_TIME_NAVIGATOR_OPTIONS, DEFAULT_TIME_SCALE_OPTIONS, DEFAULT_TRADING_COLORS, DEFAULT_ZOOM_GLIDE_OPTIONS, type DataFeed, DataLayer, type DecodedOrder, type DepthLevel, type DoubleClickAction, type DoubleClickEvent, type DrawAnchor, type DrawItem, EventMarkers, type ExportSvgOptions, FakeDataFeed, type FeedScheduler, type FillGradient, type FillPoint, type GridAxisStyle, type GridOptions, type GridStyle, type HistogramStyle, INDICATOR_LINE_STYLES, INDICATOR_PLOT_STYLES, INDICATOR_SOURCES, type IPrimitive, type IRenderBackend, IST_OFFSET_SECONDS, type IndexedBar, type IndicatorAlertContext, type IndicatorAlertPayload, type IndicatorAlertSpec, type IndicatorApi, type IndicatorAttachContext, IndicatorBackground, type IndicatorCalcContext, type IndicatorDescriptor, type IndicatorDrawing, IndicatorDrawings, IndicatorFill, type IndicatorFillOptions, type IndicatorFillSpec, type IndicatorHost, type IndicatorInput, type IndicatorLevel, type IndicatorLevelContext, type IndicatorLineStyle, type IndicatorPlot, type IndicatorSettings, type IndicatorSource, type IndicatorState, type IndicatorStore, type IndicatorValues, type IntervalBucketing, type IntervalDescriptor, type IntervalParts, InvalidationLevel, type IstParts, type KeymapEntry, LINK_CROSSHAIR_ALPHA, type LateTickPolicy, type LegendField, type LegendStatusData, type LegendStatusLineOptions, type LegendStatusSource, type LegendTitleMode, type LegendValue, type LinePoint, type LinkChart, LinkCrosshair, type LinkDataLayer, LinkGroup, type LinkMemberOptions, type LinkMissingPolicy, type LinkOptions, type LogicalRange, LogoWatermark, type LogoWatermarkOptions, type LtpEvent, type MarkerPosition, type MarkerShape, type MarkerSize, type MarketDepth, type MarketPhase, type MarketPhaseFn, type MaybePromise, type ModeCheck, type OpenAlgoConfig, OpenAlgoDataFeed, type OpenAlgoLiveConfig, OpenAlgoLiveDataFeed, type OpenAlgoTradeConfig, OpenAlgoTradeFeed, type OpenAlgoWsConfig, OpenAlgoWsFeed, type OrderBookSnapshot, type OrderDecodeCode, type OrderDecodeIssue, type OrderDecodeResult, type OrderSide$1 as OrderSide, type OrderType$1 as OrderType, type OrderUpdateEvent, type OriginalTime, PRICE_LEVEL_KINDS, PRICE_SCALE_MODES, Pane, type PaneInvalidation, PaneLegend, type PaneLegendAction, type PaneLegendOptions, type PaneState, type PickHost, type PickKind, type PlaceOrder, type PlotMarginOptions, type PointerInfo, type PointerKind, type PointerModifiers, type PointerSample, type PositionSide, type PriceAxisState, type PriceLevelInput, type PriceLevelKind, type PriceLevelQuote, type PriceLevelStyle, type PriceLevelValues, PriceLevels, type PriceLevelsOptions, PriceLine, type PriceLineOptions, type PriceRange, PriceScale, type PriceScaleId, type PriceScaleMode, type PriceScaleOptions, type PriceScaleState, type PrimitiveAnchor, type PrimitiveHit, type PrimitiveHost, type PrimitivePlacement, type PrimitiveRenderContext, type QuarantinedRow, type RawOrder, type RenderBackendFactory, type RenderBackendKind, type RenderDevice, type RendererChoice, type RendererEntry, type RendererFallbackEvent, type RendererFallbackReason, type ReplayChartHost, ReplayController, type ReplayOptions, type ReplayScheduler, ReplayShade, type ReplayShadeOptions, type ReplayState, type ReplayViewport, type ResolvedLinkOptions, type RestoreReport, SCALE_FONT_MAX, SCALE_FONT_MIN, type ScaleCanvasOptions, type SeriesApi, type SeriesDataItem, type SeriesId, type SeriesMarker, SeriesMarkers, type SeriesRenderContext, type SeriesState, type SeriesStyle, type SeriesType, type SessionSpec, type ShortcutListItem, ShortcutManager, type ShortcutManagerOptions, type ShortcutPreset, type ShortcutScope, type ShortcutTriggerEvent, type Size, type SocketFactory, type SocketLike, type SupertrendPoint, SvgContext, type SvgContextOptions, SvgLinearGradient, type TableCell, type TablePosition, TextWatermark, type TextWatermarkOptions, type Tick, TickBarAggregator, type TickBarOptions, type TickCountBucketing, type TickMarkType, type TickTimeframe, TimeNavigator, type TimeNavigatorAction, type TimeNavigatorOptions, TimeScale, type TimeScaleOp, type TimeScaleOptions, type TradeFeed, type TradeMarkerVariant, TradeMarkersPrimitive, type TradingColors, TradingController, type TradingHost, type TradingLineStyle, type TradingLineVariant, type TradingOrder, type TradingOrderSide, type TradingOrderType, type TradingPosition, type TradingSettings, type TradingSyncPayload, type TradingTrade, type UTCSeconds, UnknownIntervalError, type UnsubscribeFn, VERSION, type VolumeBucketing, type VolumeMode, type WatermarkPosition, type Whitespace, type WsClientWarning, type WsControlMessage, type WsMode, type WsState, type ZOrder, type ZonedParts, type ZonedPeriod, type ZoomAnchor, ZoomGlide, type ZoomGlideOptions, addComparison, alignToPrimary, applyChartSettings, atr, autoscaleRange, backendDegradation, backoffDelayMs, barCacheKey, barCloseSec, beginPick, bestHit, bitmapSize, bucketStartOf, calendarPeriodFlags, candleGeometry, candleTier, chartSettingsSchema, clamp, classifyAuthAck, compactVolume, comparisonController, computePriceLevels, conflateBars, conflateItems, conflationGroupSize, createChart, createLinkGroup, createRenderBackend, darkTheme, dashPattern, decodeOrder, drawLabel, drawShape, effectiveMarkerPx, ema, emaSeries, epochMsToUtcSeconds, eventToCombo, followerIndex, followerRange, formatCombo, formatIstCrosshairLabel, formatIstDate, formatIstTime, formatIstTimeSeconds, formatSubscribe, formatUnsubscribe, formatZonedCrosshairLabel, formatZonedDate, formatZonedTime, formatZonedTimeSeconds, fromGradient, generateBars, getChartType, getIndicator, hasIndicator, inSessionAt, indicatorDefaults, indicatorStyleInputs, intervalParts, intervalToSeconds, isDailyInterval, isIntradayInterval, isKnownInterval, isNewIstDay, isNewZonedDay, isNewZonedMonth, isNewZonedPeriod, isNewZonedQuarter, isNewZonedWeek, isNewZonedYear, isRebasing, isReservedCombo, isSecondsInterval, isTickInterval, isTimeBucketed, isValidCombo, isValidTimezone, isWhitespace, istStringToUtcSeconds, lastPriceLevelFromSeriesStyle, lerp, lightTheme, mapHistoryResponse, mapOrder, mapOrderStatus, mapPosition, markerSizePx, mergeBars, nextBucketStart, niceTicks, normalizeCombo, optimalBarWidth, parseCombo, parseMessage, parseSessionSpec, parseTopic, plotStyleKeys, precisionForStep, readChartSettings, readSequence, registerChartType, registerIndicator, registerInterval, registerRenderBackend, registeredChartTypes, registeredIndicators, registeredIntervals, registeredRenderBackends, resolveCrosshairStyle, resolveGridStyle, resolveInterval, resolvePlotMargins, resolveRenderBackend, resolveScaleStyle, roundToTick, rowTimeToUtcSeconds, rsi, rsiSeries, seriesStyleForLastPriceLevel, sessionFlags, sessionStartFlags, sessionStartIndices, snapToDevicePixel, sourceValue, sourceValues, startOfZonedDay, startOfZonedMonth, startOfZonedWeek, supertrend, supertrendSeries, tableOrigin, toBar, trueRange, tryResolveInterval, unregisterInterval, unregisterRenderBackend, utcSecondsToIstDateString, utcSecondsToIstParts, utcSecondsToZonedDateString, utcSecondsToZonedParts, version, verticalGradient, watermarkRect, withAlpha, withBarCache, zoneOffsetSeconds, zonedDayIndex, zonedStringToUtcSeconds, zonedWallClockToUtcSeconds, zonedWeekIndex };
|