@orangecharts/wrun-chart-host 0.15.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/constants/economic.constants.d.ts +2 -0
- package/dist/constants/economic.constants.js +2 -0
- package/dist/constants/feature-flags.constants.d.ts +13 -5
- package/dist/constants/feature-flags.constants.js +76 -35
- package/dist/constants/feature-limits.constants.d.ts +72 -4
- package/dist/constants/feature-limits.constants.js +104 -24
- package/dist/constants/interval.constants.js +5 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +12 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +14 -0
- package/dist/constants/marketCapabilities.constants.d.ts +9 -0
- package/dist/constants/marketCapabilities.constants.js +39 -11
- package/dist/constants/typed-indicator-source.leaf.d.ts +7 -0
- package/dist/constants/typed-indicator-source.leaf.js +47 -0
- package/dist/constants/typed-session-history-venue.leaf.d.ts +7 -0
- package/dist/constants/typed-session-history-venue.leaf.js +9 -0
- package/dist/constants/typed-width-fold.leaf.d.ts +52 -0
- package/dist/constants/typed-width-fold.leaf.js +101 -0
- package/dist/constants/typed-width-source.leaf.d.ts +24 -0
- package/dist/constants/typed-width-source.leaf.js +126 -0
- package/dist/constants/typed-width.leaf.d.ts +57 -0
- package/dist/constants/typed-width.leaf.js +78 -0
- package/dist/host-env.d.ts +10 -0
- package/dist/host-env.js +7 -0
- package/dist/host-ports.types.d.ts +23 -17
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +35 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +66 -3
- package/dist/interfaces/wrun-runtime.interface.js +11 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +13 -0
- package/dist/kscript-data/controls/live-trades-merge.util.js +16 -1
- package/dist/market-data/billing.interface.d.ts +12 -45
- package/dist/market-data/billing.interface.js +2 -2
- package/dist/replay/replayLadder.js +7 -4
- package/dist/settings-templates/footprint-rows.d.ts +6 -0
- package/dist/settings-templates/footprint-rows.js +6 -0
- package/dist/settings-templates/frvp-fields.js +14 -0
- package/dist/settings-templates/indicator-fields.js +36 -0
- package/dist/settings-templates/tool-tables.generated.js +19 -1
- package/dist/utility/chart/__fixtures__/live-bucket-regular-golden.json +1706 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +42 -0
- package/dist/utility/chart/cache-alignment.util.js +88 -18
- package/dist/utility/chart/calendar-interval.util.d.ts +83 -1
- package/dist/utility/chart/calendar-interval.util.js +152 -4
- package/dist/utility/chart/candle-bar-end.util.d.ts +11 -4
- package/dist/utility/chart/candle-bar-end.util.js +17 -6
- package/dist/utility/chart/chart-time-domain.util.d.ts +3 -0
- package/dist/utility/chart/chart-time-domain.util.js +13 -4
- package/dist/utility/chart/feed-interval.util.d.ts +4 -2
- package/dist/utility/chart/feed-interval.util.js +5 -2
- package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +3 -1
- package/dist/utility/chart/fetch-dedupe-policy.util.js +19 -1
- package/dist/utility/chart/footprint-display-mode.util.d.ts +2 -0
- package/dist/utility/chart/footprint-display-mode.util.js +5 -0
- package/dist/utility/chart/governed-lanes-gate.util.d.ts +46 -0
- package/dist/utility/chart/governed-lanes-gate.util.js +71 -0
- package/dist/utility/chart/governed-lanes-reader-seat.d.ts +14 -0
- package/dist/utility/chart/governed-lanes-reader-seat.js +14 -0
- package/dist/utility/chart/history-wall.util.d.ts +13 -2
- package/dist/utility/chart/history-wall.util.js +11 -4
- package/dist/utility/chart/index-mode-admission.util.js +9 -1
- package/dist/utility/chart/index-mode.util.d.ts +2 -2
- package/dist/utility/chart/index-mode.util.js +12 -6
- package/dist/utility/chart/index-otc.leaf.d.ts +37 -0
- package/dist/utility/chart/index-otc.leaf.js +68 -0
- package/dist/utility/chart/interval-ladder.util.d.ts +5 -2
- package/dist/utility/chart/interval-ladder.util.js +44 -4
- package/dist/utility/chart/interval-registry.util.d.ts +22 -1
- package/dist/utility/chart/interval-registry.util.js +50 -2
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +32 -4
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +22 -5
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +10 -0
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +30 -3
- package/dist/utility/chart/kscript-legend-entries.util.d.ts +21 -4
- package/dist/utility/chart/kscript-legend-entries.util.js +27 -5
- package/dist/utility/chart/kscript-main-grid-stages.util.js +74 -24
- package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
- package/dist/utility/chart/kscript-row-name.leaf.d.ts +13 -0
- package/dist/utility/chart/kscript-row-name.leaf.js +18 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +61 -26
- package/dist/utility/chart/kscript-venue-policy.util.js +138 -37
- package/dist/utility/chart/live-bucket.util.d.ts +29 -4
- package/dist/utility/chart/live-bucket.util.js +45 -12
- package/dist/utility/chart/market-session-schedule.util.d.ts +19 -0
- package/dist/utility/chart/market-session-schedule.util.js +2 -1
- package/dist/utility/chart/market-session.util.d.ts +62 -10
- package/dist/utility/chart/market-session.util.js +93 -13
- package/dist/utility/chart/marketKind.util.d.ts +11 -12
- package/dist/utility/chart/marketKind.util.js +45 -13
- package/dist/utility/chart/mixed-mode.util.d.ts +18 -0
- package/dist/utility/chart/om-target.util.js +6 -4
- package/dist/utility/chart/price-precision.util.d.ts +20 -6
- package/dist/utility/chart/price-precision.util.js +34 -7
- package/dist/utility/chart/profile-frame-window.util.d.ts +15 -0
- package/dist/utility/chart/profile-frame-window.util.js +12 -0
- package/dist/utility/chart/rth-session.util.d.ts +3 -1
- package/dist/utility/chart/rth-session.util.js +3 -1
- package/dist/utility/chart/script-source-session.util.d.ts +43 -0
- package/dist/utility/chart/script-source-session.util.js +61 -0
- package/dist/utility/chart/typed-width-grid.util.d.ts +23 -0
- package/dist/utility/chart/typed-width-grid.util.js +203 -0
- package/dist/utility/common/transformations.util.d.ts +6 -0
- package/dist/utility/common/transformations.util.js +28 -4
- package/dist/utility/market-events/market-events.util.js +3 -0
- package/dist/utility/number-format.util.d.ts +14 -1
- package/dist/utility/number-format.util.js +22 -4
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +24 -1
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +115 -0
- package/dist/utility/v2/v2-enums.leaf.js +5 -0
- package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +2 -1
- package/dist/utility/wrun/sources/row-lanes/dark_pool.js +4 -3
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +13 -3
- package/dist/utility/wrun/wrun-batched-marks.util.js +96 -17
- package/dist/utility/wrun/wrun-canvases.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-canvases.util.js +7 -12
- package/dist/utility/wrun/wrun-cap-notice.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-cap-notice.util.js +23 -0
- package/dist/utility/wrun/wrun-card-style.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-card-style.util.js +2 -2
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +23 -8
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +24 -9
- package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-child-overlay-id.util.js +24 -0
- package/dist/utility/wrun/wrun-cloud-cme-stamp.util.d.ts +72 -0
- package/dist/utility/wrun/wrun-cloud-cme-stamp.util.js +151 -0
- package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +10 -6
- package/dist/utility/wrun/wrun-cme-root-specs.util.js +19 -13
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-color-facts.util.js +8 -5
- package/dist/utility/wrun/wrun-colour-tone.lazy.d.ts +20 -0
- package/dist/utility/wrun/wrun-colour-tone.lazy.js +23 -0
- package/dist/utility/wrun/wrun-colour-tone.util.d.ts +14 -0
- package/dist/utility/wrun/wrun-colour-tone.util.js +119 -0
- package/dist/utility/wrun/wrun-dark-pool.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-dark-pool.util.js +5 -4
- package/dist/utility/wrun/wrun-frames.d.ts +1 -1
- package/dist/utility/wrun/wrun-frames.js +2 -2
- package/dist/utility/wrun/wrun-handles.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-handles.util.js +1 -1
- package/dist/utility/wrun/wrun-host.service.d.ts +32 -2
- package/dist/utility/wrun/wrun-host.service.js +44 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +20 -0
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +85 -2
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +37 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.js +54 -0
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +1 -0
- package/dist/utility/wrun/wrun-hud-looks.util.js +6 -11
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +19 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +17 -1
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-live-patch.util.js +10 -4
- package/dist/utility/wrun/wrun-live-tick.util.js +64 -5
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +40 -6
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +2 -2
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +10 -8
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +3 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +3 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +17 -0
- package/dist/utility/wrun/wrun-overlay-run.util.js +318 -55
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-panel-mount.util.js +42 -13
- package/dist/utility/wrun/wrun-pin-venues.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-pin-venues.util.js +11 -4
- package/dist/utility/wrun/wrun-refusal.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-refusal.util.js +102 -13
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +5 -3
- package/dist/utility/wrun/wrun-registry-errors.util.js +5 -3
- package/dist/utility/wrun/wrun-row-source-factory.js +17 -1
- package/dist/utility/wrun/wrun-row-source.d.ts +8 -1
- package/dist/utility/wrun/wrun-run-health.util.js +1 -1
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +1 -1
- package/dist/utility/wrun/wrun-sandbox-row-source.js +9 -0
- package/dist/utility/wrun/wrun-session-composition.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-session-composition.util.js +3 -2
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +12 -5
- package/dist/utility/wrun/wrun-setting-words.util.js +25 -8
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +26 -1
- package/dist/utility/wrun/wrun-socket-row-source.js +125 -12
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +8 -7
- package/dist/utility/wrun/wrun-style-words.util.d.ts +31 -9
- package/dist/utility/wrun/wrun-style-words.util.js +46 -15
- package/dist/utility/wrun/wrun-trades-lane.util.js +2 -1
- package/dist/utility/wrun/wrun-trap-replay.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-trap-replay.util.js +63 -0
- package/dist/utility/wrun/wrun-volume-profile.util.js +6 -5
- package/dist/utility/wrun-display-name.util.d.ts +10 -0
- package/dist/utility/wrun-display-name.util.js +21 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +2 -0
- package/dist/utils/replay/replay-buffer-math.js +2 -0
- package/dist/workers/constants/socket-slots.d.ts +1 -1
- package/dist/workers/utils/time.worker.util.js +2 -2
- package/dist/workers/utils/volume-profile.worker.util.d.ts +9 -0
- package/dist/workers/utils/volume-profile.worker.util.js +20 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +3 -0
- package/dist/workers/wrun/wrun-abi-host.js +82 -5
- package/dist/workers/wrun/wrun-engine-handler.js +53 -4
- package/dist/workers/wrun/wrun-trap-frames.leaf.d.ts +28 -0
- package/dist/workers/wrun/wrun-trap-frames.leaf.js +108 -0
- package/package.json +11 -11
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// Bound before the fallback palette below reads the mark colours (off the boot path).
|
|
2
|
+
import './wrun-colour-tone.util.js';
|
|
3
|
+
import { WRUN_FONT_FAMILIES, isWrunColorWord, resolveWrunColorWord, wrunColorThemeOf, wrunFontFamilyCss, wrunFontWeightCss, } from './wrun-style-words.util.js';
|
|
2
4
|
// ── Word lists (the om kit's `wrun-style/widgets.ts`, restated) ──────────────
|
|
3
5
|
/** LK01: the looks, the rows of the look table. */
|
|
4
6
|
export const WRUN_HUD_LOOKS = [
|
|
@@ -534,16 +536,9 @@ export function resolveWrunHudLook(entry, options = {}) {
|
|
|
534
536
|
css,
|
|
535
537
|
};
|
|
536
538
|
}
|
|
537
|
-
/** The dark-chart palette a resolver without a chart answers `theme.down` with
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
down: '#ef5350',
|
|
541
|
-
text: '#d1d4dc',
|
|
542
|
-
muted: 'rgba(209, 212, 220, 0.55)',
|
|
543
|
-
bg: '#131722',
|
|
544
|
-
grid: '#2a2e39',
|
|
545
|
-
accent: '#ff4608',
|
|
546
|
-
};
|
|
539
|
+
/** The dark-chart palette a resolver without a chart answers `theme.down` with
|
|
540
|
+
* (the palette a chart without a theme answers). */
|
|
541
|
+
const FALLBACK_THEME = wrunColorThemeOf(undefined);
|
|
547
542
|
/**
|
|
548
543
|
* The defaults the look in force gives a tile of `kind` (undefined fields
|
|
549
544
|
* keep the kit's own drawing). `cardMark` is the card's first meter mark, the
|
|
@@ -12,6 +12,30 @@ import type { WrunRunReason } from './wrun-lifecycle.contract.js';
|
|
|
12
12
|
/** The core's `owedFullIntegration` for a wrun run: one of the reasons above,
|
|
13
13
|
* or no good result on the overlay yet. */
|
|
14
14
|
export declare function wrunRunOwesFullIntegration(reason: WrunRunReason, hasGoodResult: boolean): boolean;
|
|
15
|
+
/** What a run's drawings do to the overlay's mounted drawing set. */
|
|
16
|
+
export type WrunRunDrawingsPlan = 'replace' | 'keep-mounted';
|
|
17
|
+
/**
|
|
18
|
+
* The drawings rule of a wrun run, beside its row route (both apply routes, the rows merge and the remount, read it).
|
|
19
|
+
* A script's handles make and delete drawings over the whole history it ran on (a session level deleted after 13
|
|
20
|
+
* sessions, a gap mitigated weeks later), so only a whole-range run can produce the set the newest bar should show. A
|
|
21
|
+
* partial window (the pan wave's clamped span, a prefix page) answers rows inside that window only: its rows apply on
|
|
22
|
+
* their route, but its drawings never replace the mounted set, which stays until a whole-range result lands. A run that
|
|
23
|
+
* owes a full integration (no good result yet, or a reason that asks a new question: new settings, another market, a
|
|
24
|
+
* resume) replaces whatever its window, since the mounted set answers an old question or nothing. A redraw of the live
|
|
25
|
+
* session's own computation (its reseed, its style repaint, its TPO block refine) replaces too: the session's set is
|
|
26
|
+
* what every live tick mounts (wrun-live-tick.util hands the tick's whole result to the drawing door), so a redraw that
|
|
27
|
+
* kept the older set would leave the old look until the next tick, and on a quiet market until a whole-range run.
|
|
28
|
+
* 'keep-mounted' means the mounted set is LEFT ALONE: the adapter is handed no drawings and told so
|
|
29
|
+
* (`keepMountedDrawings`), never handed the mounted set back as input.
|
|
30
|
+
*/
|
|
31
|
+
export declare function wrunRunDrawingsPlan(input: {
|
|
32
|
+
/** The run computed a window narrower than the loaded range (`WrunRunWindow.partial`). */
|
|
33
|
+
partialWindow: boolean;
|
|
34
|
+
/** `wrunRunOwesFullIntegration` for the run. */
|
|
35
|
+
owedFullIntegration: boolean;
|
|
36
|
+
/** The result redraws the overlay's live session's own computation (`WrunIntegrateOptions.sessionRedraw`). */
|
|
37
|
+
sessionRedraw: boolean;
|
|
38
|
+
}): WrunRunDrawingsPlan;
|
|
15
39
|
export interface WrunIntegrationRouteInput {
|
|
16
40
|
reason: WrunRunReason;
|
|
17
41
|
/** The overlay shows a result an earlier run of this lane integrated. */
|
|
@@ -25,6 +25,25 @@ const WRUN_FULL_INTEGRATION_REASONS = new Set([
|
|
|
25
25
|
export function wrunRunOwesFullIntegration(reason, hasGoodResult) {
|
|
26
26
|
return !hasGoodResult || WRUN_FULL_INTEGRATION_REASONS.has(reason);
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* The drawings rule of a wrun run, beside its row route (both apply routes, the rows merge and the remount, read it).
|
|
30
|
+
* A script's handles make and delete drawings over the whole history it ran on (a session level deleted after 13
|
|
31
|
+
* sessions, a gap mitigated weeks later), so only a whole-range run can produce the set the newest bar should show. A
|
|
32
|
+
* partial window (the pan wave's clamped span, a prefix page) answers rows inside that window only: its rows apply on
|
|
33
|
+
* their route, but its drawings never replace the mounted set, which stays until a whole-range result lands. A run that
|
|
34
|
+
* owes a full integration (no good result yet, or a reason that asks a new question: new settings, another market, a
|
|
35
|
+
* resume) replaces whatever its window, since the mounted set answers an old question or nothing. A redraw of the live
|
|
36
|
+
* session's own computation (its reseed, its style repaint, its TPO block refine) replaces too: the session's set is
|
|
37
|
+
* what every live tick mounts (wrun-live-tick.util hands the tick's whole result to the drawing door), so a redraw that
|
|
38
|
+
* kept the older set would leave the old look until the next tick, and on a quiet market until a whole-range run.
|
|
39
|
+
* 'keep-mounted' means the mounted set is LEFT ALONE: the adapter is handed no drawings and told so
|
|
40
|
+
* (`keepMountedDrawings`), never handed the mounted set back as input.
|
|
41
|
+
*/
|
|
42
|
+
export function wrunRunDrawingsPlan(input) {
|
|
43
|
+
if (input.sessionRedraw)
|
|
44
|
+
return 'replace';
|
|
45
|
+
return input.partialWindow && !input.owedFullIntegration ? 'keep-mounted' : 'replace';
|
|
46
|
+
}
|
|
28
47
|
/**
|
|
29
48
|
* In order: the identity check, the unchanged-result skip (never over stale
|
|
30
49
|
* settings or an owed full integration), then the core. Its inputs: stale
|
|
@@ -76,6 +76,8 @@ import { FUNDING_INTERVAL_MAP } from '../../constants/overlay-data.constants.js'
|
|
|
76
76
|
import { liveCandleAtInterval, mergeLiveOhlcvDataPoint } from '../../kscript-data/controls/live-ohlcv-merge.util.js';
|
|
77
77
|
import { liveTradeOfPoint, mergeLiveTradesDataPoint, readLiveTradePrint, tradesBarStartMs, tradesTapeCellSize, tradesTapeFloorValuesPrints, } from '../../kscript-data/controls/live-trades-merge.util.js';
|
|
78
78
|
import { liveAmountUsd, peekOptionTradeUnits } from '../options/option-trade-units.util.js';
|
|
79
|
+
import { profileFrameLastInstantMs } from '../chart/profile-frame-window.util.js';
|
|
80
|
+
import { isInScriptSourceSession, isVolumeProfileLiveFrameInSession, tapeSourceSessionHours, } from '../chart/script-source-session.util.js';
|
|
79
81
|
import { parseWrunTapeHistory, wrunTapeHistoryOf } from './wrun-tape-source.util.js';
|
|
80
82
|
import { noteWrunCoinTapePrice } from './wrun-tape-coins.util.js';
|
|
81
83
|
import { wrunDollarUnitReader } from './wrun-dollar-unit-port.leaf.js';
|
|
@@ -695,7 +697,16 @@ rowMarket = market) {
|
|
|
695
697
|
*/
|
|
696
698
|
export function wrunTapeHostBarResolver(intervalMs, market, rowMarket = market) {
|
|
697
699
|
const grids = wrunLaneHostGridsOf('trades', intervalMs, market, rowMarket);
|
|
698
|
-
|
|
700
|
+
const hostBarOf = grids && hostBucketResolverFor(intervalMs, grids.hostBar);
|
|
701
|
+
const sessionHours = tapeSourceSessionHours(market, intervalMs, rowMarket);
|
|
702
|
+
if (sessionHours === undefined || !rowMarket)
|
|
703
|
+
return hostBarOf;
|
|
704
|
+
// The history worker serves no print outside the candle's session (script-source-session.util): no bar holds one live.
|
|
705
|
+
return (instantMs) => !isInScriptSourceSession(sessionHours, rowMarket.exchange, rowMarket.symbol, instantMs)
|
|
706
|
+
? null
|
|
707
|
+
: hostBarOf
|
|
708
|
+
? hostBarOf(instantMs)
|
|
709
|
+
: tradesBarStartMs(instantMs, intervalMs, rowMarket.exchange);
|
|
699
710
|
}
|
|
700
711
|
/** The bar a tape print folds into (`wrunTapeHostBarResolver`'s host bar, else its own grid's): the fold, the queue's
|
|
701
712
|
* loss marks and the reconcile's drops key a print here, so they name one bar. Null: no chart bar holds it. */
|
|
@@ -834,6 +845,11 @@ function foldVpPoint(rows, rowIndexOf, point, intervalMs, acquisition, market) {
|
|
|
834
845
|
if (!(gridHeight > 0))
|
|
835
846
|
return null;
|
|
836
847
|
const precision = getDecimalPlaces(gridHeight);
|
|
848
|
+
// A day-plus bar of a regular stock chart reads its session's ladder only (script-source-session.util), judged at
|
|
849
|
+
// the last instant inside the frame's window: its stamp is the window's end.
|
|
850
|
+
const lastInstantMs = profileFrameLastInstantMs(vpa);
|
|
851
|
+
if (lastInstantMs !== null && !isVolumeProfileLiveFrameInSession(market, intervalMs, lastInstantMs))
|
|
852
|
+
return null;
|
|
837
853
|
const bucket = wrunLiveBucketTs('volume_profile', tsMs, intervalMs, market);
|
|
838
854
|
if (bucket === null)
|
|
839
855
|
return null;
|
|
@@ -54,7 +54,12 @@ export declare function wrunLiveValuesEqual(a: unknown, b: unknown): boolean;
|
|
|
54
54
|
* differs from its set's first row (stamped among unstamped, or the reverse)
|
|
55
55
|
* is structural.
|
|
56
56
|
*/
|
|
57
|
-
export declare function diffWrunLiveResults(applied: WrunRunResult, next: WrunRunResult
|
|
57
|
+
export declare function diffWrunLiveResults(applied: WrunRunResult, next: WrunRunResult,
|
|
58
|
+
/** Filled with the drawings half of the verdict: whether the drawings or the drawing budget's counts changed
|
|
59
|
+
* (true whenever the diff stopped before comparing them). */
|
|
60
|
+
out?: {
|
|
61
|
+
drawingsChanged?: boolean;
|
|
62
|
+
}): WrunLiveResultChange;
|
|
58
63
|
/** The chart's bars and the run clock a result applies on. */
|
|
59
64
|
export declare function wrunLiveChartBarsOf(rows: ReadonlyArray<ArrayLike<number>>, clock: {
|
|
60
65
|
runMs: number;
|
|
@@ -130,7 +130,12 @@ function budgetCounts(budget) {
|
|
|
130
130
|
* differs from its set's first row (stamped among unstamped, or the reverse)
|
|
131
131
|
* is structural.
|
|
132
132
|
*/
|
|
133
|
-
export function diffWrunLiveResults(applied, next
|
|
133
|
+
export function diffWrunLiveResults(applied, next,
|
|
134
|
+
/** Filled with the drawings half of the verdict: whether the drawings or the drawing budget's counts changed
|
|
135
|
+
* (true whenever the diff stopped before comparing them). */
|
|
136
|
+
out) {
|
|
137
|
+
if (out)
|
|
138
|
+
out.drawingsChanged = true;
|
|
134
139
|
const before = applied;
|
|
135
140
|
const after = next;
|
|
136
141
|
const ownKeys = (record) => Object.keys(record).filter((key) => !WRUN_LIVE_DIFF_OWN_FIELDS.has(key));
|
|
@@ -141,9 +146,10 @@ export function diffWrunLiveResults(applied, next) {
|
|
|
141
146
|
for (const key of afterKeys)
|
|
142
147
|
if (!wrunLiveValuesEqual(before[key], after[key]))
|
|
143
148
|
return STRUCTURAL;
|
|
144
|
-
let changed = !wrunLiveValuesEqual(before.drawings, after.drawings)
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
let changed = !wrunLiveValuesEqual(before.drawings, after.drawings) ||
|
|
150
|
+
!wrunLiveValuesEqual(budgetCounts(before.drawingsBudget), budgetCounts(after.drawingsBudget));
|
|
151
|
+
if (out)
|
|
152
|
+
out.drawingsChanged = changed;
|
|
147
153
|
const beforeOutputs = before.outputs;
|
|
148
154
|
const afterOutputs = after.outputs;
|
|
149
155
|
if (beforeOutputs === undefined && afterOutputs === undefined)
|
|
@@ -176,7 +176,7 @@ import { ensureWrunChartHostSharedHost, wrunChartHostEnv } from '../../host-env.
|
|
|
176
176
|
import { isPackedOhlcvRows, unpackOhlcvRows } from '../../instances/script-engine-worker-ohlcv-transfer.js';
|
|
177
177
|
import { findMonday } from '../chart/titan-constants.pin.js';
|
|
178
178
|
import { Intervals } from '../../constants/interval.constants.js';
|
|
179
|
-
import { barEndMs, barStartMs, prevBarStartMs } from '../chart/calendar-interval.util.js';
|
|
179
|
+
import { barEndMs, barStartMs, fixedGridFloorDivMs, prevBarStartMs } from '../chart/calendar-interval.util.js';
|
|
180
180
|
import { isRealChartTimeRangeMs } from '../chart/chart-time-domain.util.js';
|
|
181
181
|
import { resolveV2LiveEffectiveMinIntervalMs, V2_TECHNICAL_SCRIPT_LIVE_UPDATE_MIN_MS, } from '../chart/live-cadence.util.js';
|
|
182
182
|
import { noteWrunLiveHiddenHold, noteWrunLiveHiddenReturnDrains, noteWrunLiveHiddenRun, } from './wrun-live-hidden-hold.util.js';
|
|
@@ -249,7 +249,7 @@ import { wrunLaneRefusalLeavesWindowOwed, wrunLaneRefusedCodeOf } from './wrun-l
|
|
|
249
249
|
import { WRUN_RUN_INTERVAL_ROWS_KEY, wrunRunIntervalComputeRows, wrunRunIntervalProjectionOf, wrunRunIntervalRowsThrough, wrunRunIntervalSentRow, wrunRunIntervalSessionOf, } from './wrun-run-interval-session.util.js';
|
|
250
250
|
import { WRUN_NO_READY_ROWS_CODE, wrunNothingReadyRefusal, wrunRunHealthDiagnostics } from './wrun-run-health.util.js';
|
|
251
251
|
import { attachWrunRefusal, serializeWrunRefusal, wrunOverlayEditable, wrunRefusalFor, } from './wrun-refusal.util.js';
|
|
252
|
-
import { noteWrunRunRetained, trimWrunRunDrawings } from './wrun-cap-notice.util.js';
|
|
252
|
+
import { noteWrunDrawingsSameAs, noteWrunRunRetained, trimWrunRunDrawings } from './wrun-cap-notice.util.js';
|
|
253
253
|
import { evictWrunRetainedOutputRows, ringWrunRunRetained, trimWrunRetainedCanvasLanes, wrunRetainedCanvasSources, wrunStrategyOnRows, } from './wrun-run-retained.util.js';
|
|
254
254
|
import { projectWrunRefusal, retractWrunRefusal, wrunRefusalRetractionCount } from './wrun-refusal-surface.util.js';
|
|
255
255
|
import { advanceWrunInputCarry, buildWrunInputTailRows, planWrunPinnedWires, wrunDeclaredSourceLanes, wrunDemandedSourceClass, wrunFormingBucketStart, wrunAskWirePieces, wrunChartIntervalKeyOf, wrunPinnedLegTierMs, wrunSourceVerdictWhole, wrunLaneAcquisitionIntervalMs, wrunLegRowHostBar, wrunLegRowVenue, wrunPinnedLegFetchSuffix, wrunTradeLegIntervals, wrunWireRowPieces, wrunChartCandleRows, wrunChartCandleRowsWithin, } from './wrun-source-rows.util.js';
|
|
@@ -1407,7 +1407,7 @@ function wrunPinnedLegCloseAt(leg, context, atMs) {
|
|
|
1407
1407
|
const { market } = context;
|
|
1408
1408
|
const settleMs = wrunLegCloseSettleMs(leg, market?.exchange, market?.sessionType);
|
|
1409
1409
|
const fromMs = atMs - settleMs;
|
|
1410
|
-
const open = leg.legMs === Intervals.WEEK ? findMonday(fromMs) :
|
|
1410
|
+
const open = leg.legMs === Intervals.WEEK ? findMonday(fromMs) : fixedGridFloorDivMs(fromMs, leg.legMs);
|
|
1411
1411
|
const closeMs = wrunLegBarCloseAt(leg, market?.exchange, fromMs, market?.sessionType, market?.symbol, context.intervalMs);
|
|
1412
1412
|
return (closeMs ?? open + leg.legMs) + settleMs;
|
|
1413
1413
|
}
|
|
@@ -1853,6 +1853,38 @@ async function extendWrunReplayRowLanes(context, owed, cursorTs) {
|
|
|
1853
1853
|
ledger.inFlight = false;
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
|
+
/**
|
|
1857
|
+
* Whether a socket row source's live frame was computed over CME data: its governed mark (`WrunRowFrame.governed`, the
|
|
1858
|
+
* reply's `wrunGoverned`) names the CME plane. Fail closed: a frame carrying a mark that is not a record reads as
|
|
1859
|
+
* marked. A frame with no mark reads unmarked (the source carries a run's mark onto every later frame itself).
|
|
1860
|
+
*/
|
|
1861
|
+
function wrunLiveFrameReadsCme(frame) {
|
|
1862
|
+
if (!Object.hasOwn(frame, 'governed'))
|
|
1863
|
+
return false;
|
|
1864
|
+
const governed = frame.governed;
|
|
1865
|
+
if (governed === undefined || governed === null)
|
|
1866
|
+
return false;
|
|
1867
|
+
if (typeof governed !== 'object' || Array.isArray(governed))
|
|
1868
|
+
return true;
|
|
1869
|
+
return governed.cme !== undefined;
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* Stamp the overlay a CME-marked live frame lands on (wrun-cloud-cme-stamp.util `stampWrunHostedCme`), unless its
|
|
1873
|
+
* result stamped it already. False when the stamp's module does not load or the stamp cannot be written: the frame is
|
|
1874
|
+
* skipped (fail closed).
|
|
1875
|
+
*/
|
|
1876
|
+
async function stampWrunLiveFrameCme(chartIndex, indicatorId, meta, owns) {
|
|
1877
|
+
try {
|
|
1878
|
+
const { stampWrunHostedCme, wrunOverlayCmeStamped } = await import('./wrun-cloud-cme-stamp.util.js');
|
|
1879
|
+
if (wrunOverlayCmeStamped(meta))
|
|
1880
|
+
return true;
|
|
1881
|
+
return await stampWrunHostedCme(chartIndex, indicatorId, meta, owns);
|
|
1882
|
+
}
|
|
1883
|
+
catch (error) {
|
|
1884
|
+
console.warn(`[wrun] the CME stamp of '${indicatorId}' did not load; its live frame is skipped:`, error);
|
|
1885
|
+
return false;
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1856
1888
|
/**
|
|
1857
1889
|
* A socket row source's live frames (WRUN-PARITY-PLAN C7, plan row 18), the drain's integrate of every
|
|
1858
1890
|
* frame folded since the last one (`queueWrunSourceLiveFrame`): the bars the cloud moved enter the live
|
|
@@ -1911,6 +1943,24 @@ export async function integrateWrunOverlayLiveFrame(indicatorId, frame, cellRows
|
|
|
1911
1943
|
return;
|
|
1912
1944
|
if (!wrunLiveTickEligible(context, generation))
|
|
1913
1945
|
return;
|
|
1946
|
+
// The CME twin (wrun-cloud-cme-stamp.util, the AI boundary that never opens): a frame the cloud computed over CME
|
|
1947
|
+
// (its governed mark names the plane, or a mark that cannot be read) is stamped before anything of it lands,
|
|
1948
|
+
// whoever wrote the script and whatever lane ran it, and a frame whose stamp cannot be written is skipped (fail
|
|
1949
|
+
// closed). An overlay its result stamped already is not written again. A frame never clears the stamp.
|
|
1950
|
+
// The stamp's module loads only for a marked frame (a frame of a run that reads no CME never pulls it in); one
|
|
1951
|
+
// that does not load fails the frame like a stamp that cannot be written.
|
|
1952
|
+
const readsCme = wrunLiveFrameReadsCme(frame);
|
|
1953
|
+
if (readsCme) {
|
|
1954
|
+
const owns = () => wrunLiveTickEligible(context, generation) &&
|
|
1955
|
+
tc.metadata?.includes(meta) === true;
|
|
1956
|
+
if (!(await stampWrunLiveFrameCme(context.chartIndex, indicatorId, meta, owns)))
|
|
1957
|
+
return;
|
|
1958
|
+
if (!wrunLiveTickEligible(context, generation))
|
|
1959
|
+
return;
|
|
1960
|
+
}
|
|
1961
|
+
// The session reads CME from here: its debug lines and its exports state it (the console provenance).
|
|
1962
|
+
if (readsCme)
|
|
1963
|
+
context.cmeRead = true;
|
|
1914
1964
|
// A frame with the mark names the receipt of the rows it carries (contract opra-server-lanes C4): the legend's
|
|
1915
1965
|
// served word follows it from this tick on, and a frame naming no tier leaves none (never the account's tier).
|
|
1916
1966
|
// The session reads OPRA from here: its debug lines state it (the console provenance).
|
|
@@ -3151,7 +3201,12 @@ function applyWrunLiveRunResult(context, tc, meta, runResult, projection) {
|
|
|
3151
3201
|
const bars = wrunLiveChartBarsOf(chartRows, clock);
|
|
3152
3202
|
const outcome = withWrunOverlayExecutionMeasure(chartIndex, indicatorId, 'wrun-live-tick', () => {
|
|
3153
3203
|
const applied = context.repaintOwed ? undefined : context.liveApplied;
|
|
3154
|
-
const
|
|
3204
|
+
const verdict = {};
|
|
3205
|
+
const change = applied && bars ? diffWrunLiveResults(applied.result, runResult, verdict) : undefined;
|
|
3206
|
+
// The drawings verdict travels with the drawings array as a token (wrun-cap-notice.util): equal drawings
|
|
3207
|
+
// under no owed repaint inherit the applied set's token, so the drawing door can skip its pass; anything else
|
|
3208
|
+
// gets a new token and the door runs in full.
|
|
3209
|
+
noteWrunDrawingsSameAs(runResult.drawings, applied && bars && verdict.drawingsChanged === false ? applied.result.drawings : undefined);
|
|
3155
3210
|
if (applied && bars && change?.kind === 'unchanged' && wrunLiveChartBarsEqual(applied.bars, bars)) {
|
|
3156
3211
|
return 'unchanged';
|
|
3157
3212
|
}
|
|
@@ -5583,7 +5638,11 @@ function publishWrunDebugTick(context, outputRows) {
|
|
|
5583
5638
|
return;
|
|
5584
5639
|
const store = wrunChartHostEnv().chart.chartStore();
|
|
5585
5640
|
// The session's own console provenance (the run that installed it), never the chart's market now.
|
|
5586
|
-
store.setIndicatorPrintOutputs(context.chartIndex, context.indicatorId, selectWrunDebugLines(context.metadata, outputRows), {
|
|
5641
|
+
store.setIndicatorPrintOutputs(context.chartIndex, context.indicatorId, selectWrunDebugLines(context.metadata, outputRows), {
|
|
5642
|
+
opra: context.opraRead === true,
|
|
5643
|
+
...(context.cmeRead === true ? { cme: true } : {}),
|
|
5644
|
+
...(context.indexOtcRead === true ? { indexOtc: true } : {}),
|
|
5645
|
+
});
|
|
5587
5646
|
}
|
|
5588
5647
|
export function __resetWrunLiveTickForTests() {
|
|
5589
5648
|
for (const state of tickStates.values()) {
|
|
@@ -116,12 +116,38 @@ const VOLUME_COLUMN = 5;
|
|
|
116
116
|
const UNKNOWN_SIZE_UNIT = WRUN_MARKET_SIZE_UNITS.indexOf('unknown');
|
|
117
117
|
const COINS_SIZE_UNIT = WRUN_MARKET_SIZE_UNITS.indexOf('coins');
|
|
118
118
|
const CONTRACTS_SIZE_UNIT = WRUN_MARKET_SIZE_UNITS.indexOf('contracts');
|
|
119
|
+
/** A candle's length: the chart's interval, or where that is not known the smallest step between two of the candles
|
|
120
|
+
* (a step is never shorter than a candle). Infinity for rows with no step. */
|
|
121
|
+
function wrunCandleBarMs(rows, intervalMs) {
|
|
122
|
+
if (intervalMs !== undefined && Number.isFinite(intervalMs) && intervalMs > 0)
|
|
123
|
+
return intervalMs;
|
|
124
|
+
let smallest = Infinity;
|
|
125
|
+
for (let at = rows.length - 1; at > 0; at -= 1) {
|
|
126
|
+
const step = Number(rows[at][0]) - Number(rows[at - 1][0]);
|
|
127
|
+
if (step > 0 && step < smallest)
|
|
128
|
+
smallest = step;
|
|
129
|
+
}
|
|
130
|
+
return smallest;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* What the step between two candles counts for on the market's own clock (BT-CLOSED-DAYS): the step less the whole
|
|
134
|
+
* days of its idle part, the time after the earlier candle closed. A market that closes for whole days (a weekend, a
|
|
135
|
+
* holiday) reopens that many days late: a stock's weekend counts as its weeknight, a futures weekend as its daily
|
|
136
|
+
* break, a day chart's Friday to Monday as one day. Idle time under a day stays whole (a quiet market's own time, a
|
|
137
|
+
* nightly close), and so does the day between two day candles (no idle part).
|
|
138
|
+
*/
|
|
139
|
+
function wrunTradingClockStep(step, barMs) {
|
|
140
|
+
const idle = step - barMs;
|
|
141
|
+
return idle >= DAY_MS ? step - Math.floor(idle / DAY_MS) * DAY_MS : step;
|
|
142
|
+
}
|
|
119
143
|
/**
|
|
120
144
|
* A candle-volume measure per day, from the chart's own candles (ascending, the newest the forming one, which is left
|
|
121
145
|
* out: its volume is partial): `barValue` of the closed candles opening in the 24 hours before the newest one's open,
|
|
122
146
|
* summed and scaled to a day by the span they cover (a fine chart loads less than a day: 500 one-minute candles count
|
|
123
|
-
* 499 minutes; a gap where nothing traded counts as covered time with no volume).
|
|
124
|
-
* (
|
|
147
|
+
* 499 minutes; a gap where nothing traded counts as covered time with no volume). The 24 hours run on the market's
|
|
148
|
+
* own clock (`wrunTradingClockStep`): whole days it stood closed are no part of them, so the day read on a Monday
|
|
149
|
+
* morning is Friday afternoon and Monday morning, never Sunday. One closed candle longer than a day (1W, 1M) is
|
|
150
|
+
* prorated by its length, the gap to the next open held to the candle's length. Undefined when the closed candles
|
|
125
151
|
* cover under an hour or hold no volume.
|
|
126
152
|
*/
|
|
127
153
|
function wrunDailyCandleSum(rows, intervalMs, barValue) {
|
|
@@ -132,22 +158,30 @@ function wrunDailyCandleSum(rows, intervalMs, barValue) {
|
|
|
132
158
|
const lastClosedOpen = Number(rows[last - 1][0]);
|
|
133
159
|
if (!Number.isFinite(newestOpen) || !Number.isFinite(lastClosedOpen))
|
|
134
160
|
return undefined;
|
|
135
|
-
const barMs =
|
|
161
|
+
const barMs = wrunCandleBarMs(rows, intervalMs);
|
|
136
162
|
const lastSpan = Math.min(newestOpen - lastClosedOpen, barMs);
|
|
137
163
|
if (lastSpan > DAY_MS) {
|
|
138
164
|
const volume = barValue(rows[last - 1]);
|
|
139
165
|
return Number.isFinite(volume) && volume > 0 ? (volume * DAY_MS) / lastSpan : undefined;
|
|
140
166
|
}
|
|
141
|
-
|
|
167
|
+
// Walk back from the newest open, each candle placed by the clock time since it opened. The walk ends at the first
|
|
168
|
+
// candle that opened over a day before (the day is then whole), or at the oldest candle (the day is what they cover).
|
|
169
|
+
let covered = 0;
|
|
170
|
+
let whole = false;
|
|
142
171
|
let volume = 0;
|
|
143
172
|
for (let at = last - 1; at >= 0; at -= 1) {
|
|
144
|
-
|
|
173
|
+
const step = wrunTradingClockStep(Number(rows[at + 1][0]) - Number(rows[at][0]), barMs);
|
|
174
|
+
if (!(step >= 0 && covered + step <= DAY_MS)) {
|
|
175
|
+
whole = true;
|
|
145
176
|
break;
|
|
177
|
+
}
|
|
178
|
+
covered += step;
|
|
146
179
|
const bar = barValue(rows[at]);
|
|
147
180
|
if (Number.isFinite(bar) && bar > 0)
|
|
148
181
|
volume += bar;
|
|
149
182
|
}
|
|
150
|
-
|
|
183
|
+
if (whole)
|
|
184
|
+
covered = DAY_MS;
|
|
151
185
|
if (!(covered >= HOUR_MS) || !(volume > 0))
|
|
152
186
|
return undefined;
|
|
153
187
|
return (volume * DAY_MS) / covered;
|
|
@@ -70,8 +70,8 @@ interface WrunMarketSizeChart {
|
|
|
70
70
|
* now), and `isCurrent` says the run is still the overlay's own (its chart and mount stand). After each await, in the
|
|
71
71
|
* task that keeps and writes, the chart still names that market (a switch during the directory's answer moves it, and
|
|
72
72
|
* neither the mount nor the refusal attempt sees a switch), and the verdict that reads the candles reads them only
|
|
73
|
-
* while they were loaded for it (`
|
|
74
|
-
* its rows replace the old market's). A fact it cannot prove reads as a transient skip: no memo, no write.
|
|
73
|
+
* while they were loaded for it (the host's `mainRowsLoadedFor`: the symbol pipeline stamps the new market's metadata
|
|
74
|
+
* before its rows replace the old market's). A fact it cannot prove reads as a transient skip: no memo, no write.
|
|
75
75
|
*/
|
|
76
76
|
export declare function reconcileWrunMarketSizeDefaults(args: {
|
|
77
77
|
chartIndex: number;
|
|
@@ -247,8 +247,8 @@ function wrunMarketSizeUnprovenFacts(families) {
|
|
|
247
247
|
* now), and `isCurrent` says the run is still the overlay's own (its chart and mount stand). After each await, in the
|
|
248
248
|
* task that keeps and writes, the chart still names that market (a switch during the directory's answer moves it, and
|
|
249
249
|
* neither the mount nor the refusal attempt sees a switch), and the verdict that reads the candles reads them only
|
|
250
|
-
* while they were loaded for it (`
|
|
251
|
-
* its rows replace the old market's). A fact it cannot prove reads as a transient skip: no memo, no write.
|
|
250
|
+
* while they were loaded for it (the host's `mainRowsLoadedFor`: the symbol pipeline stamps the new market's metadata
|
|
251
|
+
* before its rows replace the old market's). A fact it cannot prove reads as a transient skip: no memo, no write.
|
|
252
252
|
*/
|
|
253
253
|
export async function reconcileWrunMarketSizeDefaults(args) {
|
|
254
254
|
const { chartIndex, indicatorId, tc, meta, sheet, market, isCurrent } = args;
|
|
@@ -311,8 +311,8 @@ export async function reconcileWrunMarketSizeDefaults(args) {
|
|
|
311
311
|
? wrunMarketSizeFactsNow(families, {
|
|
312
312
|
tc,
|
|
313
313
|
chartMetadata: market.read() ?? undefined,
|
|
314
|
-
|
|
315
|
-
|
|
314
|
+
// The host's own answer, for the chart as it reads now (`keyed()`: still the keyed market).
|
|
315
|
+
rowsOwn: dataFetching?.mainRowsLoadedFor(chartIndex, market.read()) ?? false,
|
|
316
316
|
ownCandles: formula === undefined,
|
|
317
317
|
exchange,
|
|
318
318
|
symbol,
|
|
@@ -477,12 +477,14 @@ function wrunChartFormulaOf(exchange, symbol, transformations) {
|
|
|
477
477
|
* The facts of the keyed market, read in the caller's task once the chart is proven on that market: the size unit once
|
|
478
478
|
* the directory placed it, the venue's candle volume unit (`ownCandles`: a formula chart's candles are no market's),
|
|
479
479
|
* the market's dollar unit (the market facts, `wrunMarketDollarUnit`), and the chart's own candles while they were
|
|
480
|
-
* loaded for the keyed market (`
|
|
481
|
-
*
|
|
482
|
-
*
|
|
480
|
+
* loaded for the keyed market (`rowsOwn`: the host's answer, its data-fetching port's `mainRowsLoadedFor`; the package
|
|
481
|
+
* never compares the market's spelling with the loader's itself, since a US stock on Trades reads its tape's candles
|
|
482
|
+
* and the two never match there). Candles loaded for another market are never read: the volume verdict that would
|
|
483
|
+
* read them reads `unproven` (the candles not yet the market's own, never its own too few), and no carry prices with
|
|
484
|
+
* them. The option verdict reads no candles, so it stands then.
|
|
483
485
|
*/
|
|
484
486
|
function wrunMarketSizeFactsNow(families, facts) {
|
|
485
|
-
const rowsOwn = facts
|
|
487
|
+
const { rowsOwn } = facts;
|
|
486
488
|
const rows = rowsOwn && (families.volume !== undefined || families.coins !== undefined)
|
|
487
489
|
? wrunChartCandleRows(facts.tc)
|
|
488
490
|
: [];
|
|
@@ -350,6 +350,9 @@ export interface WrunOverlayLiveContext {
|
|
|
350
350
|
* chart, or one whose lanes read the CME plane): every debug line its ticks and reseeds publish states it. No
|
|
351
351
|
* cloud frame raises it (the Cloud lane never reads CME). */
|
|
352
352
|
cmeRead?: true;
|
|
353
|
+
/** The session reads the index and yield venue's data (the console provenance of the run that installed it,
|
|
354
|
+
* `computed.indexOtc`): every debug line its ticks and reseeds publish states it. No cloud frame raises it. */
|
|
355
|
+
indexOtcRead?: true;
|
|
353
356
|
/** The delayed CME legs its legend names (the installing run's `computed.cmeDelayed`). */
|
|
354
357
|
cmeDelayed?: ReadonlyArray<{
|
|
355
358
|
symbol: string;
|
|
@@ -84,6 +84,7 @@ import { closeWrunRefusalAttempts, concludeWrunRefusalAttempt, liveWrunRefusalAt
|
|
|
84
84
|
import { attachWrunRefusal, stampWrunRefusalTelemetry } from './wrun-refusal.util.js';
|
|
85
85
|
import { wrunRunFailedIdentityOf } from './wrun-cap-notice.util.js';
|
|
86
86
|
import { __resetWrunHistoryAsOfForTests, forgetWrunHistoryAsOf } from './wrun-history-as-of.util.js';
|
|
87
|
+
import { releaseWrunTrapSeedsFor } from './wrun-trap-replay.util.js';
|
|
87
88
|
import { effectiveChartSessionType } from '../chart/effective-chart-session.util.js';
|
|
88
89
|
import { wrunMainCandleSourceOf } from './run-schedule/wrun-own-candles.util.js';
|
|
89
90
|
import { hasWrunChartHostEnv, wrunChartHostEnv } from '../../host-env.js';
|
|
@@ -617,6 +618,8 @@ function releaseWrunOverlayLiveSession(indicatorId, mode) {
|
|
|
617
618
|
drivers.delete(indicatorId);
|
|
618
619
|
// The overlay's history session goes with it: an overlay mounted again pins its lanes afresh.
|
|
619
620
|
forgetWrunHistoryAsOf(indicatorId);
|
|
621
|
+
// A trap replay seed the overlay parked goes with it: nothing replays an overlay that left its chart.
|
|
622
|
+
releaseWrunTrapSeedsFor(indicatorId);
|
|
620
623
|
// The overlay's refusal attempts and verdicts go with it: a settlement
|
|
621
624
|
// landing after this claims nothing, and a later tenant starts clean.
|
|
622
625
|
if (chartIndex !== undefined)
|
|
@@ -235,6 +235,14 @@ export interface WrunRunComputedFor {
|
|
|
235
235
|
* type. Synchronous over what it reads, so the caller judges in the same task as the act the verdict guards.
|
|
236
236
|
*/
|
|
237
237
|
export declare function wrunRunSupersededReason(run: WrunRunComputedFor): WrunRunSupersededReason | undefined;
|
|
238
|
+
/** The trap row of an editor draft run that carried a replay seed (wrun-trap-replay.util: a full run or a live start
|
|
239
|
+
* that trapped in the sandbox): the seed parks under a token the row carries in `details.trap.token`, which the
|
|
240
|
+
* editor's replay controller takes it by. Any other row (a published Indicator, an app layer, no seed) as it is, and
|
|
241
|
+
* nothing parks for it. */
|
|
242
|
+
export declare function wrunTrapRowWithReplayToken(trap: RuntimeDiagnostic, error: unknown, overlay: {
|
|
243
|
+
indicatorId: string;
|
|
244
|
+
settings: unknown;
|
|
245
|
+
}): RuntimeDiagnostic;
|
|
238
246
|
/**
|
|
239
247
|
* Where a run stands when it fails (the `stage` of `wrun-run-failed`): its head (the holds, the walls, the market
|
|
240
248
|
* reads), its lanes (the plans and the fetches of the browser lanes), the compute (the sandbox worker, or the row
|
|
@@ -267,6 +275,8 @@ export declare function surfaceWrunRunFailureOnLegend(chartIndex: number, indica
|
|
|
267
275
|
opra?: boolean;
|
|
268
276
|
/** The same for the CME plane (`computed.cme`): its runtime trap row carries the CME mark. */
|
|
269
277
|
cme?: boolean;
|
|
278
|
+
/** The same for the index and yield venue (`computed.indexOtc`): its runtime trap row carries the venue's mark. */
|
|
279
|
+
indexOtc?: boolean;
|
|
270
280
|
/** The run's refusal context (the run pass builds it from the chart it ran on). */
|
|
271
281
|
refusalContext?: WrunRefusalContext;
|
|
272
282
|
/** The attempt token the run resolved before its first await; absent or null: no toast. */
|
|
@@ -1169,6 +1179,13 @@ export type WrunIntegrateOptions = Omit<WrunOverlayResultOptions, 'builtIn'> & {
|
|
|
1169
1179
|
pictureIdentity: WrunPictureIdentity | undefined;
|
|
1170
1180
|
/** The full run's route facts; absent, the result remounts (a reseed, a direct caller). */
|
|
1171
1181
|
integration?: WrunIntegrationFacts;
|
|
1182
|
+
/** The drawings rule's facts for a caller without route facts that integrates a run's own rows again (the TPO block
|
|
1183
|
+
* refine of a run no live session owns): that run's reason and good-result fact, so the refine keeps or replaces
|
|
1184
|
+
* the mounted drawings exactly as its run did (wrunRunDrawingsPlan). */
|
|
1185
|
+
drawingsRun?: Pick<WrunIntegrationFacts, 'reason' | 'hasGoodResult'>;
|
|
1186
|
+
/** The result redraws the live session's own computation (its reseed, its style repaint, its TPO block refine:
|
|
1187
|
+
* the set every live tick mounts): its drawings replace the mounted set whatever its window (wrunRunDrawingsPlan). */
|
|
1188
|
+
sessionRedraw?: boolean;
|
|
1172
1189
|
/** A settings gesture's preview (the style patch's session repaint, wrun-style-preview.util): the overlay's
|
|
1173
1190
|
* settings are never written (no legend palette, no stats strip stamp), so nothing a preview paints reaches its
|
|
1174
1191
|
* engine copy; the gesture's commit or the cancel's repaint stamps them. */
|