@orangecharts/wrun-chart-host 0.11.0 → 0.14.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 +1 -0
- package/dist/constants/feature-flags.constants.d.ts +3 -4
- package/dist/constants/feature-flags.constants.js +34 -52
- package/dist/constants/feature-limits.constants.d.ts +1 -1
- package/dist/constants/feature-limits.constants.js +5 -4
- package/dist/constants/interval.constants.d.ts +7 -0
- package/dist/constants/interval.constants.js +7 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
- package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
- package/dist/constants/stocks-compliance.constants.d.ts +15 -0
- package/dist/constants/stocks-compliance.constants.js +15 -0
- package/dist/host-env.d.ts +55 -3
- package/dist/host-env.js +6 -0
- package/dist/host-ports.types.d.ts +36 -3
- package/dist/index.d.ts +18 -0
- package/dist/index.js +19 -0
- package/dist/indicators/controls/tpo-session.util.d.ts +78 -15
- package/dist/indicators/controls/tpo-session.util.js +320 -242
- package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
- package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
- package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
- package/dist/interfaces/cme-realtime.interface.js +2 -1
- package/dist/interfaces/feed.interface.d.ts +15 -1
- package/dist/interfaces/replay.interface.d.ts +5 -0
- package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
- package/dist/interfaces/stocks-realtime.interface.js +5 -4
- package/dist/interfaces/wrun-runtime.interface.d.ts +97 -19
- package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
- package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
- package/dist/market-data/billing.interface.d.ts +9 -1
- package/dist/market-data/venue.d.ts +1 -1
- package/dist/market-data/venues/index.d.ts +4 -4
- package/dist/market-data/venues/stocks.contract.copy.json +4 -4
- package/dist/market-data/venues/stocks.d.ts +4 -4
- package/dist/market-data/venues/stocks.js +15 -13
- package/dist/settings-templates/frvp-fields.d.ts +12 -1
- package/dist/settings-templates/frvp-fields.js +15 -4
- package/dist/settings-templates/index.js +12 -5
- package/dist/settings-templates/indicator-fields.js +28 -2
- package/dist/settings-templates/tool-rules.d.ts +17 -8
- package/dist/settings-templates/tool-rules.js +15 -8
- package/dist/settings-templates/tool-tables.generated.js +4 -2
- package/dist/utility/auth/server-clock.util.d.ts +3 -1
- package/dist/utility/auth/server-clock.util.js +3 -1
- package/dist/utility/chart/book-live-bucket.util.js +2 -2
- package/dist/utility/chart/cache-alignment.util.d.ts +15 -7
- package/dist/utility/chart/cache-alignment.util.js +14 -7
- package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
- package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
- package/dist/utility/chart/cme-session-bucket.util.js +25 -332
- package/dist/utility/chart/continuous-contracts.util.js +6 -5
- package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
- package/dist/utility/chart/display-offset.leaf.js +41 -0
- package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
- package/dist/utility/chart/effective-chart-session.util.js +13 -5
- package/dist/utility/chart/feed-interval.util.d.ts +6 -20
- package/dist/utility/chart/feed-interval.util.js +13 -22
- package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
- package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
- package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
- package/dist/utility/chart/host-bar-placement.util.js +8 -2
- package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
- package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
- package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
- package/dist/utility/chart/indicator-run-interval.util.js +21 -12
- package/dist/utility/chart/interval-registry.util.d.ts +1 -1
- package/dist/utility/chart/interval-registry.util.js +1 -1
- package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
- package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
- package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
- package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
- package/dist/utility/chart/live-bucket.util.d.ts +39 -17
- package/dist/utility/chart/live-bucket.util.js +103 -57
- package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
- package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
- package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
- package/dist/utility/chart/market-session-schedule.util.js +39 -1
- package/dist/utility/chart/market-session.util.d.ts +136 -0
- package/dist/utility/chart/market-session.util.js +341 -0
- package/dist/utility/chart/market-sessions.util.d.ts +83 -0
- package/dist/utility/chart/market-sessions.util.js +220 -0
- package/dist/utility/chart/om-panel.util.d.ts +5 -3
- package/dist/utility/chart/om-panel.util.js +42 -7
- package/dist/utility/chart/om-target.util.d.ts +14 -1
- package/dist/utility/chart/om-target.util.js +22 -5
- package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
- package/dist/utility/chart/opra-read-access.leaf.js +22 -0
- package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
- package/dist/utility/chart/profile-row-height.util.js +74 -37
- package/dist/utility/chart/rth-session.util.d.ts +55 -20
- package/dist/utility/chart/rth-session.util.js +94 -46
- package/dist/utility/chart/session-interval.util.d.ts +2 -1
- package/dist/utility/chart/session-interval.util.js +1 -3
- package/dist/utility/chart/session-lattice.util.d.ts +150 -0
- package/dist/utility/chart/session-lattice.util.js +488 -0
- package/dist/utility/chart/trading-day.util.d.ts +40 -2
- package/dist/utility/chart/trading-day.util.js +84 -7
- package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
- package/dist/utility/chart/us-equities-session.util.js +44 -15
- package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
- package/dist/utility/chart/window-geometry.leaf.js +57 -8
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
- package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
- package/dist/utility/chart/wrun-run-result.util.d.ts +29 -12
- package/dist/utility/chart/wrun-run-result.util.js +89 -25
- package/dist/utility/common/time.util.js +5 -4
- package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
- package/dist/utility/market-events/earnings-scope.util.js +17 -9
- package/dist/utility/market-events/market-events.util.d.ts +14 -7
- package/dist/utility/market-events/market-events.util.js +30 -17
- package/dist/utility/number-format.util.d.ts +14 -21
- package/dist/utility/number-format.util.js +38 -24
- package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
- package/dist/utility/options/option-venue-disclosure.util.js +71 -11
- package/dist/utility/options/option-venue.util.d.ts +1 -1
- package/dist/utility/options/option-venue.util.js +1 -1
- package/dist/utility/pool-symbol.leaf.d.ts +7 -0
- package/dist/utility/pool-symbol.leaf.js +50 -5
- package/dist/utility/stocks/stock-display.util.d.ts +15 -0
- package/dist/utility/stocks/stock-display.util.js +37 -0
- package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
- package/dist/utility/v2/gate-plane.util.d.ts +6 -0
- package/dist/utility/v2/gate-plane.util.js +11 -1
- package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
- package/dist/utility/v2/gate-session-latch.util.js +3 -3
- package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
- package/dist/utility/v2/governed-tier.leaf.js +17 -16
- package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
- package/dist/utility/v2/stocks-governed.util.js +14 -0
- package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
- package/dist/utility/v2/v2-enums.leaf.js +458 -0
- package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
- package/dist/utility/wrun/derived-roots.leaf.js +27 -1
- package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
- package/dist/utility/wrun/derived-roots.util.js +97 -56
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
- package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
- package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
- package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
- package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
- package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
- package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
- package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
- package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
- package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
- package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
- package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
- package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
- package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
- package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +41 -22
- package/dist/utility/wrun/wrun-batched-marks.util.js +255 -59
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
- package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
- package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
- package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
- package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
- package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
- package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-canvases.util.js +7 -3
- package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
- package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
- package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
- package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
- package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
- package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
- package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
- package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
- package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
- package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
- package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
- package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
- package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
- package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
- package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
- package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
- package/dist/utility/wrun/wrun-host.service.js +137 -27
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
- package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
- package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
- package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
- package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
- package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
- package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
- package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
- package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
- package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
- package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
- package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
- package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
- package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
- package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
- package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
- package/dist/utility/wrun/wrun-live-tick.util.js +648 -97
- package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
- package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
- package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
- package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
- package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
- package/dist/utility/wrun/wrun-option-views.util.js +5 -2
- package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
- package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +75 -11
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +176 -43
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
- package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +239 -24
- package/dist/utility/wrun/wrun-overlay-run.util.js +2204 -405
- package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-panel-mount.util.js +20 -14
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
- package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
- package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
- package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
- package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
- package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
- package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
- package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
- package/dist/utility/wrun/wrun-refusal.util.js +103 -16
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
- package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
- package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
- package/dist/utility/wrun/wrun-run-health.util.d.ts +89 -2
- package/dist/utility/wrun/wrun-run-health.util.js +204 -1
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
- package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
- package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
- package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -3
- package/dist/utility/wrun/wrun-script-inputs.util.js +51 -13
- package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
- package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
- package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
- package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
- package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
- package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
- package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
- package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
- package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
- package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
- package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
- package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
- package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
- package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
- package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
- package/dist/utility/wrun/wrun-visibility-table.js +9 -0
- package/dist/utility/wrun/wrun-volume-profile.util.js +44 -32
- package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
- package/dist/utils/replay/replay-buffer-math.js +60 -30
- package/dist/workers/constants/socket-slots.d.ts +11 -7
- package/dist/workers/constants/socket-slots.js +6 -5
- package/package.json +11 -11
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Order flow from a session on a script overlay (web: docs/features/session-feed/README.md, "Order flow"): where a
|
|
3
|
+
* run reads its tape and trades rows, an overlay the host's session owns reads OpenMarket's rows before the seam and
|
|
4
|
+
* the session's from it. The host composes (`WrunChartHostEnv.session`, optional); this module decides where.
|
|
5
|
+
*
|
|
6
|
+
* The session never writes a lane buffer: the context's buffers, watermarks, fed marks, coverage and reconciles keep
|
|
7
|
+
* OpenMarket's rows exactly. Only the rows a compute reads are composed, at the read points (the full run's and the
|
|
8
|
+
* reseed's row build, the drain's tail build), and only when every lane the composition would feed is one it can
|
|
9
|
+
* value on the chart's own market: a session's prints are contracts on that market, so a contracts lane composes as
|
|
10
|
+
* they are, and the dollar trades lane prices each side of a bar as OpenMarket's history does (contracts x the root's
|
|
11
|
+
* point value x that side's (high + low + close) / 3) where the point value is known (`wrunSessionDollarPointValue`).
|
|
12
|
+
*/
|
|
13
|
+
import { wrunChartHostEnv, hasWrunChartHostEnv } from '../../host-env.js';
|
|
14
|
+
import { wrunCmeDollarPointValue } from './wrun-cme-root-specs.util.js';
|
|
15
|
+
import { wrunDeclaredSourceLanes } from './wrun-source-rows.util.js';
|
|
16
|
+
import { wrunTradesLegOf } from './wrun-trades-lane.util.js';
|
|
17
|
+
/** The market placeholders a lane's payload names when it reads the chart's own market (`fetchLane`). */
|
|
18
|
+
const CURRENT_EXCHANGE = 'currentExchange';
|
|
19
|
+
const CURRENT_SYMBOL = 'currentSymbol';
|
|
20
|
+
function asksOwnMarket(acquisition, market) {
|
|
21
|
+
const exchange = acquisition.exchange;
|
|
22
|
+
const symbol = acquisition.symbol;
|
|
23
|
+
const ownExchange = exchange === undefined || exchange === CURRENT_EXCHANGE || exchange === market?.exchange;
|
|
24
|
+
const ownSymbol = symbol === undefined || symbol === CURRENT_SYMBOL || symbol === market?.symbol;
|
|
25
|
+
return ownExchange && ownSymbol;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The one rule for the dollar lane: the US dollars one contract of the chart's market is worth per whole point of its
|
|
29
|
+
* price (CME_ROOT_SPECS: NQ1! and NQZ6 read NQ, 20) on a CME Group futures market whose root is quoted in US dollars,
|
|
30
|
+
* so a side of a session-fed bar prices at contracts x this x (high + low + close) / 3. Undefined everywhere else (a
|
|
31
|
+
* root off the table, a cents-quoted grain, an option contract, a market off the CME family): a script declaring the
|
|
32
|
+
* dollar lane there is ineligible and reads OpenMarket's rows whole.
|
|
33
|
+
*/
|
|
34
|
+
export function wrunSessionDollarPointValue(market) {
|
|
35
|
+
return wrunCmeDollarPointValue(market) ?? undefined;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Whether a session may compose this run's lanes: a dollar trades lane only where a print can be valued
|
|
39
|
+
* (`wrunSessionDollarPointValue`), no trades leg on the chart's own market (its rows would read OpenMarket's beside a
|
|
40
|
+
* session-fed trades lane), a tape asked by contract size (`minSize`, never a dollar or coins floor) on the chart's
|
|
41
|
+
* market, a trades lane in contracts on the chart's market, and a dollar trades lane asked in USD on the chart's
|
|
42
|
+
* market. A lane never asked has no payload and composes nothing, so it refuses nothing.
|
|
43
|
+
*/
|
|
44
|
+
export function wrunSessionCompositionEligible(view) {
|
|
45
|
+
const declared = wrunDeclaredSourceLanes(view.metadata);
|
|
46
|
+
if (declared.has('trades_usd') && wrunSessionDollarPointValue(view.market) === undefined)
|
|
47
|
+
return false;
|
|
48
|
+
for (const lane of declared) {
|
|
49
|
+
const leg = wrunTradesLegOf(lane);
|
|
50
|
+
if (leg !== undefined && leg.exchange === view.market?.exchange && leg.symbol === view.market?.symbol)
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
const tape = view.acquisition.tape;
|
|
54
|
+
if (tape !== undefined) {
|
|
55
|
+
if (typeof tape.minSize !== 'number' || tape.minValue !== undefined || tape.minCoins !== undefined)
|
|
56
|
+
return false;
|
|
57
|
+
if (!asksOwnMarket(tape, view.market))
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
const trades = view.acquisition.trades;
|
|
61
|
+
if (trades !== undefined) {
|
|
62
|
+
if (trades.currency !== undefined && trades.currency !== 'Coin')
|
|
63
|
+
return false;
|
|
64
|
+
if (!asksOwnMarket(trades, view.market))
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
const dollars = view.acquisition.trades_usd;
|
|
68
|
+
if (dollars !== undefined) {
|
|
69
|
+
if (dollars.currency !== 'USD' || wrunSessionDollarPointValue(view.market) === undefined)
|
|
70
|
+
return false;
|
|
71
|
+
if (!asksOwnMarket(dollars, view.market))
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
/** The host's session seams, or undefined: a host without them (the sandbox worker, the phone app, every spec env
|
|
77
|
+
* that sets none) composes nothing, and every read point reads its buffers as before. */
|
|
78
|
+
export function wrunHostSessionSeams() {
|
|
79
|
+
return hasWrunChartHostEnv() ? wrunChartHostEnv().session : undefined;
|
|
80
|
+
}
|
|
81
|
+
/** The token the host's session holds for the overlay now (its order-flow generation while owned), else null. */
|
|
82
|
+
export function wrunSessionCompositionToken(indicatorId) {
|
|
83
|
+
return wrunHostSessionSeams()?.compositionToken(indicatorId) ?? null;
|
|
84
|
+
}
|
|
85
|
+
/** Sessions a reseed landed on while the host's session changed owner: the revision that change owes (from the old
|
|
86
|
+
* seam) stays owed past the landing. Empty unless a session owns an overlay, so the cold path never reads it. */
|
|
87
|
+
const compositionRevisionsKept = new WeakSet();
|
|
88
|
+
/**
|
|
89
|
+
* Lands a reseed's owed marks against the composition it read: the token it composed under still the host's, it
|
|
90
|
+
* served them (true: the caller clears them); an owner change since (a hand-back, a new seam) owes a revision its
|
|
91
|
+
* rows never read, kept for the next drain (false), and the drain's own clearing skips it once.
|
|
92
|
+
*/
|
|
93
|
+
export function wrunReseedServedComposition(indicatorId, context, composedToken) {
|
|
94
|
+
if (composedToken === wrunSessionCompositionToken(indicatorId)) {
|
|
95
|
+
// Served: an earlier landing's kept mark (one no drain took, a recovery's reseed) is served with it.
|
|
96
|
+
compositionRevisionsKept.delete(context);
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
compositionRevisionsKept.add(context);
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
/** Whether the last reseed of `context` kept an owner change's revision owed (read once: the drain clears none). */
|
|
103
|
+
export function takeWrunCompositionRevisionKept(context) {
|
|
104
|
+
return compositionRevisionsKept.delete(context);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The rows a compute reads, composed where the host's session owns the overlay. Cold path first: no seams, or no
|
|
108
|
+
* token (nothing owns the overlay), answers `sources` itself, so every read point is byte-identical to before.
|
|
109
|
+
*/
|
|
110
|
+
export function composeWrunSessionSources(input, sources) {
|
|
111
|
+
const seams = wrunHostSessionSeams();
|
|
112
|
+
if (seams === undefined)
|
|
113
|
+
return { sources, token: null };
|
|
114
|
+
const token = seams.compositionToken(input.indicatorId);
|
|
115
|
+
if (token === null)
|
|
116
|
+
return { sources, token };
|
|
117
|
+
if (sources.tapeRows === undefined &&
|
|
118
|
+
sources.buySellVolumeRows === undefined &&
|
|
119
|
+
sources.buySellVolumeUsdRows === undefined) {
|
|
120
|
+
return { sources, token };
|
|
121
|
+
}
|
|
122
|
+
if (!wrunSessionCompositionEligible(input.lanes))
|
|
123
|
+
return { sources, token };
|
|
124
|
+
const tapeAcquisition = input.lanes.acquisition.tape;
|
|
125
|
+
const grid = {
|
|
126
|
+
chartIndex: input.chartIndex,
|
|
127
|
+
intervalMs: input.intervalMs,
|
|
128
|
+
exchange: input.lanes.market?.exchange ?? '',
|
|
129
|
+
market: input.lanes.market?.symbol ?? '',
|
|
130
|
+
// The chart's session (the field wrunLiveBucketTs('trades') keys on): an RTH pane's buckets and seam bar sit on
|
|
131
|
+
// the RTH-anchored grid, never the exchange's full-session lattice.
|
|
132
|
+
...(input.lanes.market?.sessionType !== undefined ? { sessionType: input.lanes.market.sessionType } : {}),
|
|
133
|
+
floor: typeof tapeAcquisition?.minSize === 'number' ? tapeAcquisition.minSize : 0,
|
|
134
|
+
// The wrun tape asks the large-print table on every market (wrunTapeLaneExtras).
|
|
135
|
+
large: tapeAcquisition?.large !== false,
|
|
136
|
+
};
|
|
137
|
+
const tapeRows = sources.tapeRows !== undefined
|
|
138
|
+
? seams.composeLaneRows(input.indicatorId, 'tape', sources.tapeRows, grid)
|
|
139
|
+
: undefined;
|
|
140
|
+
const buySellVolumeRows = sources.buySellVolumeRows !== undefined
|
|
141
|
+
? seams.composeLaneRows(input.indicatorId, 'trades', sources.buySellVolumeRows, grid)
|
|
142
|
+
: undefined;
|
|
143
|
+
// The dollar lane rides the same grid plus the point value that prices its bars; none known, it stays OpenMarket's.
|
|
144
|
+
const pointValue = wrunSessionDollarPointValue(input.lanes.market);
|
|
145
|
+
const buySellVolumeUsdRows = sources.buySellVolumeUsdRows !== undefined && pointValue !== undefined
|
|
146
|
+
? seams.composeLaneRows(input.indicatorId, 'trades_usd', sources.buySellVolumeUsdRows, {
|
|
147
|
+
...grid,
|
|
148
|
+
pointValue,
|
|
149
|
+
})
|
|
150
|
+
: undefined;
|
|
151
|
+
if (tapeRows === sources.tapeRows &&
|
|
152
|
+
buySellVolumeRows === sources.buySellVolumeRows &&
|
|
153
|
+
(buySellVolumeUsdRows === undefined || buySellVolumeUsdRows === sources.buySellVolumeUsdRows)) {
|
|
154
|
+
return { sources, token };
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
sources: {
|
|
158
|
+
...sources,
|
|
159
|
+
...(tapeRows !== undefined ? { tapeRows } : {}),
|
|
160
|
+
...(buySellVolumeRows !== undefined ? { buySellVolumeRows } : {}),
|
|
161
|
+
...(buySellVolumeUsdRows !== undefined ? { buySellVolumeUsdRows } : {}),
|
|
162
|
+
},
|
|
163
|
+
token,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** The live context's lanes view (its sheet, its recorded acquisitions, the chart's market at its run). */
|
|
167
|
+
export function wrunSessionLanesOfContext(context) {
|
|
168
|
+
return { metadata: context.metadata, acquisition: context.acquisition, market: context.market };
|
|
169
|
+
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* wrun-dialog-rows); without them a choice prints its label as the author
|
|
15
15
|
* wrote it, a word all the same.
|
|
16
16
|
*/
|
|
17
|
+
import { type DisplayOffset } from '../chart/display-offset.leaf.js';
|
|
17
18
|
import type { WrunScriptInputDeclaration } from './wrun-script-inputs.util.js';
|
|
18
19
|
/** What a decode needs to know about a setting: its kind and, for a choice, its option values and labels. */
|
|
19
20
|
export interface WrunWordsShape {
|
|
@@ -38,8 +39,9 @@ export interface WrunSettingWords {
|
|
|
38
39
|
chart?: string;
|
|
39
40
|
/** The line styles by their platform word (solid, dashed, dotted). */
|
|
40
41
|
lineStyles?: Readonly<Record<string, string>>;
|
|
41
|
-
/** The zone a time reads in, ms east of UTC
|
|
42
|
-
|
|
42
|
+
/** The zone a time reads in, ms east of UTC: a fixed shift, or the shift at each instant (each time reads its
|
|
43
|
+
* own, a zone moves its clock); UTC when absent. */
|
|
44
|
+
zoneOffsetMs?: DisplayOffset;
|
|
43
45
|
}
|
|
44
46
|
/** A choice label as the viewer reads it: a platform word ("chart", a line
|
|
45
47
|
* style) in the viewer's language when the surface passes its words, any
|
|
@@ -72,12 +74,13 @@ export declare function minutesToClock(minutes: number): string;
|
|
|
72
74
|
* from midnight; undefined for anything else. */
|
|
73
75
|
export declare function clockToMinutes(text: string): number | undefined;
|
|
74
76
|
/** Epoch seconds as the "YYYY-MM-DDTHH:MM" wall time a datetime-local field
|
|
75
|
-
* holds, in the zone `
|
|
76
|
-
*
|
|
77
|
+
* holds, in the zone `offset` east of UTC (fixed, or read at this instant
|
|
78
|
+
* for a zone that moves its clock; read with UTC getters, never the
|
|
79
|
+
* browser's zone); '' (an empty field) for an unset time. A sheet
|
|
77
80
|
* declares a time that may be off with `default: 0` (no date picked: the
|
|
78
81
|
* script's own fallback, such as the first expiry), so 0, a negative and a
|
|
79
82
|
* non-finite value are no instant, never the epoch's date (31/12/1969 west
|
|
80
83
|
* of UTC). Every time text reads through here, the field and the words. */
|
|
81
|
-
export declare function epochToLocalInput(seconds: number,
|
|
82
|
-
/** A time value as people read it: its date and clock in the zone `
|
|
83
|
-
export declare function describeTime(value: unknown,
|
|
84
|
+
export declare function epochToLocalInput(seconds: number, offset?: DisplayOffset): string;
|
|
85
|
+
/** A time value as people read it: its date and clock in the zone `offset` east of UTC at that time, '' when unset. */
|
|
86
|
+
export declare function describeTime(value: unknown, offset?: DisplayOffset): string;
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setting words: a wrun setting as the words a person reads, the ONE decode
|
|
3
|
+
* every text surface goes through (docs/features/kscript/wrun/wrun-typed-inputs.md,
|
|
4
|
+
* "Setting words"). wrun stores a choice as a code: a select its option value
|
|
5
|
+
* (a timeframe is a position in its sheet's word list, so "2" is 5m on one
|
|
6
|
+
* sheet and 15m on another), a multi a bitmask, a time epoch seconds, a
|
|
7
|
+
* session's start and end minutes after midnight. A surface hands the
|
|
8
|
+
* setting's shape and its stored value here and prints what comes back; it
|
|
9
|
+
* never decodes a code on its own.
|
|
10
|
+
*
|
|
11
|
+
* Pure and worker-safe: no i18n. The boot path reaches it through its door
|
|
12
|
+
* (wrun-setting-words.lazy.ts, bound below as this module evaluates). A
|
|
13
|
+
* surface that localizes passes the platform words (wrunSettingWordsFor,
|
|
14
|
+
* wrun-dialog-rows); without them a choice prints its label as the author
|
|
15
|
+
* wrote it, a word all the same.
|
|
16
|
+
*/
|
|
17
|
+
import { displayWallMs } from '../chart/display-offset.leaf.js';
|
|
1
18
|
import { WRUN_TIMEFRAME_WORDS, wrunSelectOptionValue } from './wrun-color-settings.util.js';
|
|
2
19
|
import { bindWrunSettingWords } from './wrun-setting-words.lazy.js';
|
|
3
20
|
const CHART_WORD = WRUN_TIMEFRAME_WORDS[0];
|
|
@@ -162,23 +179,24 @@ export function clockToMinutes(text) {
|
|
|
162
179
|
return hours * 60 + mins;
|
|
163
180
|
}
|
|
164
181
|
/** Epoch seconds as the "YYYY-MM-DDTHH:MM" wall time a datetime-local field
|
|
165
|
-
* holds, in the zone `
|
|
166
|
-
*
|
|
182
|
+
* holds, in the zone `offset` east of UTC (fixed, or read at this instant
|
|
183
|
+
* for a zone that moves its clock; read with UTC getters, never the
|
|
184
|
+
* browser's zone); '' (an empty field) for an unset time. A sheet
|
|
167
185
|
* declares a time that may be off with `default: 0` (no date picked: the
|
|
168
186
|
* script's own fallback, such as the first expiry), so 0, a negative and a
|
|
169
187
|
* non-finite value are no instant, never the epoch's date (31/12/1969 west
|
|
170
188
|
* of UTC). Every time text reads through here, the field and the words. */
|
|
171
|
-
export function epochToLocalInput(seconds,
|
|
189
|
+
export function epochToLocalInput(seconds, offset = 0) {
|
|
172
190
|
if (!Number.isFinite(seconds) || seconds <= 0)
|
|
173
191
|
return '';
|
|
174
|
-
const wall = new Date(seconds * 1000
|
|
192
|
+
const wall = new Date(displayWallMs(offset, seconds * 1000));
|
|
175
193
|
if (Number.isNaN(wall.getTime()))
|
|
176
194
|
return '';
|
|
177
195
|
const pad = (n) => String(n).padStart(2, '0');
|
|
178
196
|
return `${wall.getUTCFullYear()}-${pad(wall.getUTCMonth() + 1)}-${pad(wall.getUTCDate())}T${pad(wall.getUTCHours())}:${pad(wall.getUTCMinutes())}`;
|
|
179
197
|
}
|
|
180
|
-
/** A time value as people read it: its date and clock in the zone `
|
|
181
|
-
export function describeTime(value,
|
|
182
|
-
return epochToLocalInput(Number(value),
|
|
198
|
+
/** A time value as people read it: its date and clock in the zone `offset` east of UTC at that time, '' when unset. */
|
|
199
|
+
export function describeTime(value, offset = 0) {
|
|
200
|
+
return epochToLocalInput(Number(value), offset).replace('T', ' ');
|
|
183
201
|
}
|
|
184
202
|
bindWrunSettingWords({ wrunCodedWords, wrunRowWordsShapes });
|
|
@@ -179,6 +179,21 @@
|
|
|
179
179
|
* Any other class refuses by name (fail closed), matching the daemon's
|
|
180
180
|
* serving-gate behavior for unserved classes.
|
|
181
181
|
*
|
|
182
|
+
* Market pins on typed feeds and the book (U9e, wrun-pinned-lanes.util): a
|
|
183
|
+
* secondary `book`, `oi`, `funding` or `liquidations` input pinned to one
|
|
184
|
+
* whole market (`symbol` AND `exchange`) reads a lane of its own there
|
|
185
|
+
* (`pinnedLaneRows`, keyed `<class>@<exchange>|<symbol>`), in its class's row
|
|
186
|
+
* dialect on the chart's bars: the shared host's foreign ask of the class is
|
|
187
|
+
* answered from the lane of the ask's market, never from the chart's own lane
|
|
188
|
+
* (an own book and a pinned book in one package read one lane each). It takes
|
|
189
|
+
* no interval of its own (one equal to the chart's is the chart's grid) and no
|
|
190
|
+
* view. Which classes a pin is served on is ONE table every gate reads
|
|
191
|
+
* (`WRUN_BROWSER_PINNED_LANE_CLASSES`: this planner's refusal, the push
|
|
192
|
+
* intake's eligibility and the run's admission); a pin on any other class
|
|
193
|
+
* (`implied_volatility`, `skew`, `volume_profile`, `tape`, ...) refuses by
|
|
194
|
+
* name: "the chart reads <class> on its own market only; a market pin on it
|
|
195
|
+
* is not served yet".
|
|
196
|
+
*
|
|
182
197
|
* Scalar missingness honors the declared `missing` policy: absent = 'carry'
|
|
183
198
|
* (the latest eligible value forward-fills; until every carry input has a
|
|
184
199
|
* first value the row abstains, absent from the rows), 'nan' delivers NaN,
|
|
@@ -310,10 +325,13 @@
|
|
|
310
325
|
* The builders take a `clock: { intervalMs, nowMs }` whenever a leg or a
|
|
311
326
|
* typed pin exists and refuse to guess without one (an open-stamped coarse
|
|
312
327
|
* leg is exactly the lookahead leak the clock prevents). Refused by name
|
|
313
|
-
* before any fetch: a market pin on
|
|
314
|
-
*
|
|
315
|
-
* input
|
|
316
|
-
*
|
|
328
|
+
* before any fetch: a market pin on a class the one table leaves out (the
|
|
329
|
+
* chart reads it on its own market only; the served pins are a secondary
|
|
330
|
+
* `ohlcv` input's leg, a trades leg, a lane stream's leg and a secondary
|
|
331
|
+
* book, oi, funding or liquidations input's lane), a half pin, a pin on the
|
|
332
|
+
* primary input (it follows the chart's market; an `odds` input is the
|
|
333
|
+
* exception, it pins its own Polymarket market, primary included), an
|
|
334
|
+
* interval or a view on a pinned typed feed, a finer pin, a leg that is not a whole
|
|
317
335
|
* multiple of the chart interval (7 days for WEEK), a pin on a celled,
|
|
318
336
|
* `time`, trades, liquidations, implied_volatility or skew input, an
|
|
319
337
|
* interval pin on the primary input (index 0), an interval the vocabulary
|
|
@@ -334,6 +352,7 @@
|
|
|
334
352
|
* `time`, the bucket open itself) until a pan-back loads the rest, and the
|
|
335
353
|
* tail build gives the same answer.
|
|
336
354
|
*/
|
|
355
|
+
import { type KScriptWorkerPackedOhlcvRows } from '../../instances/script-engine-worker-ohlcv-transfer.js';
|
|
337
356
|
import { type WrunPinnedInterval } from './wrun-pinned-interval.util.js';
|
|
338
357
|
import { type LiveBucketVenue } from '../chart/live-bucket.util.js';
|
|
339
358
|
import { type WrunBarVenue } from '../chart/wrun-bar-session-facts.util.js';
|
|
@@ -383,25 +402,13 @@ export declare function wrunChartCandleRows(tc: {
|
|
|
383
402
|
}>;
|
|
384
403
|
} | null | undefined): number[][];
|
|
385
404
|
/**
|
|
386
|
-
* Why `rows` are not the chart's candles at `intervalMs
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
* three of four 300 ms storms, Ichimoku Cloud and EMA). The full run asks this before it plans and
|
|
392
|
-
* waits for the next chart trigger instead (`WrunNoBarsError`), as for no rows at all.
|
|
393
|
-
*
|
|
394
|
-
* Judged on the newest rows alone (a chart holds one interval at a time):
|
|
395
|
-
* - `mixed-phase`: the rows open on three or more phases of the interval (4h bars on a 1d chart
|
|
396
|
-
* open on six); a DST shift moves a session-bound venue's bars by one phase, never two;
|
|
397
|
-
* - `coarser`: every spacing between the newest rows is at least two and a half intervals (1d
|
|
398
|
-
* bars on a 4h chart); a session-bound venue's overnight or weekend gap is one spacing among
|
|
399
|
-
* several, never all of them.
|
|
400
|
-
* A calendar interval (1M, 3M, 6M, 1Y) opens on the 1st of a month at no fixed phase, a non-time
|
|
401
|
-
* interval has no grid, and a chart of fewer rows than the check reads (a new listing, a spec's
|
|
402
|
-
* three-row chart) leaves nothing to judge: all pass.
|
|
405
|
+
* Why `rows` are not the chart's candles at `intervalMs` yet, judged on the bar grid `venue` keeps (`live-bucket.util`),
|
|
406
|
+
* or null when they are: a run planned between an interval switch's cached paint and its commit would read the previous
|
|
407
|
+
* interval's bars, so the full run waits for the next chart trigger instead (`WrunNoBarsError`). `mixed-phase` names
|
|
408
|
+
* finer bars, `coarser` bars that skip the chart's own on every spacing. A calendar or non-time interval, or fewer rows
|
|
409
|
+
* than the check reads, pass.
|
|
403
410
|
*/
|
|
404
|
-
export declare function wrunChartRowsOffIntervalGrid(rows: ReadonlyArray<ArrayLike<number>>, intervalMs: number): 'mixed-phase' | 'coarser' | null;
|
|
411
|
+
export declare function wrunChartRowsOffIntervalGrid(rows: ReadonlyArray<ArrayLike<number>>, intervalMs: number, venue?: LiveBucketVenue | null): 'mixed-phase' | 'coarser' | null;
|
|
405
412
|
/**
|
|
406
413
|
* The rows of a `wrunChartCandleRows` array from `fromMs` through `toMs`, with its recorded
|
|
407
414
|
* missing bars strictly between the first and the last row kept: a clamped run window (the full
|
|
@@ -429,9 +436,12 @@ export declare function wrunDemandedSourceClass(source: Pick<WrunInputSource, 's
|
|
|
429
436
|
* C1.4): the dollar lane `trades_usd` (rows `buySellVolumeUsdRows`) for
|
|
430
437
|
* `currency: "USD"`, the coin lane `trades` (the chart's own buy/sell lane)
|
|
431
438
|
* otherwise, and a trades input pinned to one whole market its quote's leg lane
|
|
432
|
-
* there (kit 0.77.0, `trades@BYBIT|BTCUSDT`);
|
|
433
|
-
*
|
|
434
|
-
*
|
|
439
|
+
* there (kit 0.77.0, `trades@BYBIT|BTCUSDT`); a book, oi, funding or
|
|
440
|
+
* liquidations input pinned to one whole market reads that class's lane there
|
|
441
|
+
* (U9e, wrun-pinned-lanes.util, `book@COINBASE|BTC-USD`); none for an
|
|
442
|
+
* undemanded input (wrunDemandedSourceClass) or a trades half pin (refused by
|
|
443
|
+
* name). The one rule the full run's lane fetches, the live intake and the
|
|
444
|
+
* reconcile share.
|
|
435
445
|
*/
|
|
436
446
|
export declare function wrunSourceLane(source: Pick<WrunInputSource, 'source' | 'currency' | 'undemanded' | 'symbol' | 'exchange' | 'follow'> | undefined): string | undefined;
|
|
437
447
|
/** Every lane a sheet's inputs read (wrunSourceLane), declaration order kept. */
|
|
@@ -459,6 +469,11 @@ export interface WrunChartSourceRows {
|
|
|
459
469
|
* lane's acquisition, `wrunLaneAcquisitionIntervalMs`), so every row nests inside one chart bar; a lane without
|
|
460
470
|
* one rides the chart's interval. */
|
|
461
471
|
tradeLegIntervals?: Readonly<Record<string, number>>;
|
|
472
|
+
/** The pinned lanes (U9e, wrun-pinned-lanes.util) by lane id (`book@COINBASE|BTC-USD`, `oi@BINANCE_FUTURES|BTCUSDT`):
|
|
473
|
+
* the rows of a book, oi, funding or liquidations input pinned to another market, in the dialect of the chart's own
|
|
474
|
+
* lane of the class, on the chart's bars. The shared host's foreign ask of the class reads the lane of its market; a
|
|
475
|
+
* lane never asked holds none (its inputs read their fill), and no ask reads the chart's own lane in its place. */
|
|
476
|
+
pinnedLaneRows?: Readonly<Record<string, ReadonlyArray<ArrayLike<number>>>>;
|
|
462
477
|
/** kScript open_interest lane rows [ts, open, high, low, close]; optional
|
|
463
478
|
* when no `oi` input is declared. */
|
|
464
479
|
openInterestRows?: ReadonlyArray<ArrayLike<number>>;
|
|
@@ -616,6 +631,12 @@ export declare function wrunCalendarRowBounds(intervalMs: number): WrunLegRowBou
|
|
|
616
631
|
export interface WrunAlignClock {
|
|
617
632
|
intervalMs: number;
|
|
618
633
|
nowMs: number;
|
|
634
|
+
/** The instant a declared history (a leg's `bars`) counts back from when it is not `nowMs`
|
|
635
|
+
* (wrun-history-as-of.util): a live session's earliest lane pin, its first run's now, or a
|
|
636
|
+
* replay's present. Absent, or not earlier than `nowMs`, the clock reads exactly as `nowMs`. A
|
|
637
|
+
* full build splits at it (`buildWrunInputRows`): the rows the as-of closed align under it, so
|
|
638
|
+
* the leg core counts each backlog back from it, and the rows after them align under `nowMs`. */
|
|
639
|
+
historyAsOfMs?: number;
|
|
619
640
|
}
|
|
620
641
|
/** The typed-feed classes an own-market interval pin buckets by the clock
|
|
621
642
|
* (no extra fetch: the lane's own rows). */
|
|
@@ -1032,6 +1053,33 @@ export declare function wrunBrowserRunWireCaps(): string[];
|
|
|
1032
1053
|
* read the one lane its class rides, an unasked one none (`wrunUnaskedCelledInput`; the class guard walks this set,
|
|
1033
1054
|
* tests/utility/wrun/wrun-source-rows.lane-demand.spec.ts). */
|
|
1034
1055
|
export declare const WRUN_LANE_CELL_CLASSES: ReadonlySet<string>;
|
|
1056
|
+
/** The call that made a run (`wrunHostRunOf`): a full build, a carry advance, a tail build, the one run
|
|
1057
|
+
* `buildWrunInputRowsAndCarry` shares between its rows and its carry, or the advance that recovers a combined build's
|
|
1058
|
+
* carry after what the build read moved during the awaits before its install (the host's `carryWithBuild` guard). */
|
|
1059
|
+
export type WrunWindowConversionSite = 'build' | 'advance' | 'tail' | 'combined' | 'recovered';
|
|
1060
|
+
/**
|
|
1061
|
+
* The page's full-window conversions by site: every run made with no carry to start after (`cellsAfterTs` absent),
|
|
1062
|
+
* which adapts every celled lane row of the window (the book's cells, the profile's, the finer candles') where a tail
|
|
1063
|
+
* adapts the rows past its carry alone. A reseed or a full run makes two on the two-step path (its build, then its
|
|
1064
|
+
* carry advanced from the empty seed) and one on the combined one, plus one under `recovered` when the combined
|
|
1065
|
+
* build's carry was recomputed because a closed candle or a leg record moved during the awaits before its install.
|
|
1066
|
+
* Page-wide, read by the dev rig probes (`__wrunRegistry.windowConversions`, `__wrunDev.windowConversions`).
|
|
1067
|
+
*/
|
|
1068
|
+
export type WrunWindowConversionCounts = Record<WrunWindowConversionSite, number>;
|
|
1069
|
+
/** A copy of the page's full-window conversion counts (above). */
|
|
1070
|
+
export declare function wrunWindowConversionCounts(): WrunWindowConversionCounts;
|
|
1071
|
+
/** The overlay a packed book block was fetched for. */
|
|
1072
|
+
export interface WrunBookLaneOwner {
|
|
1073
|
+
chartIndex: number;
|
|
1074
|
+
indicatorId: string;
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* A lane's packed transfer as the run reads it (WRUN-PANBACK-2 S2). A K_ORDERBOOK lane (`orderbook`) keeps the worker's
|
|
1078
|
+
* block: its rows are zero-copy views of the transferred buffer (`packedOhlcvRowViews`, the zero padding past a shorter
|
|
1079
|
+
* row cut off by its length), recorded with the overlay that fetched them, so no row of the lane becomes a plain array
|
|
1080
|
+
* and the book adapter reads the block where it stands. Every other lane unpacks to plain rows, as before.
|
|
1081
|
+
*/
|
|
1082
|
+
export declare function wrunPackedLaneRows(type: string, payload: KScriptWorkerPackedOhlcvRows, owner: WrunBookLaneOwner): ArrayLike<number>[];
|
|
1035
1083
|
/**
|
|
1036
1084
|
* The state the aligner holds between builds (the shared host's `WrunInputCarry`): the newest row
|
|
1037
1085
|
* folded in, each carry input's newest finite value, each forming fold's bucket, each leg's
|
|
@@ -1054,9 +1102,25 @@ export declare function emptyWrunInputCarry(): WrunInputCarry;
|
|
|
1054
1102
|
* session venue or a daily-landed lane, where it walks the chart's own rows too
|
|
1055
1103
|
* (`wrunNeedsChartPrimary`). `clock` is required when any input pins a leg, a typed feed or a daily
|
|
1056
1104
|
* lane (the as-of alignment), and carries the chart's exact interval: a calendar chart is known by
|
|
1057
|
-
* it.
|
|
1105
|
+
* it. A clock naming an as-of earlier than its now (`historyAsOfMs`: a live session's pin, a replay's
|
|
1106
|
+
* present) splits the build there (`wrunAlignHostRows`), so each declared depth counts back from it.
|
|
1058
1107
|
*/
|
|
1059
1108
|
export declare function buildWrunInputRows(metadata: WrunIndicatorMetadata, sources: WrunChartSourceRows, clock?: WrunAlignClock): WrunInputRow[];
|
|
1109
|
+
/**
|
|
1110
|
+
* `buildWrunInputRows` and the carry seed a session takes from it, from ONE conversion of the window's lanes: the rows
|
|
1111
|
+
* exactly as `buildWrunInputRows(metadata, sources, clock)` builds them, and the carry exactly as
|
|
1112
|
+
* `advanceWrunInputCarry(metadata, emptyWrunInputCarry(), rows.slice(0, -1), sources, clock)` advances it (a full run's
|
|
1113
|
+
* and a reseed's seed). That advance runs `wrunHostRunOf` again with the build's own arguments: the empty seed names no
|
|
1114
|
+
* `throughTs`, so no lane row is skipped, and rows to advance over are the chart rows' own (its replay branch), so it
|
|
1115
|
+
* converts every celled lane row of the window a second time. Here the carry advances on the build's run instead.
|
|
1116
|
+
*
|
|
1117
|
+
* The run reads the sources once, as they stand at the call: a caller that awaits before it seeds the carry (the
|
|
1118
|
+
* worker's answer) gets the carry of the rows it evaluated, never of buffers rewritten in place meanwhile.
|
|
1119
|
+
*/
|
|
1120
|
+
export declare function buildWrunInputRowsAndCarry(metadata: WrunIndicatorMetadata, sources: WrunChartSourceRows, clock?: WrunAlignClock): {
|
|
1121
|
+
rows: WrunInputRow[];
|
|
1122
|
+
carry: WrunInputCarry;
|
|
1123
|
+
};
|
|
1060
1124
|
/**
|
|
1061
1125
|
* The TAIL of the full build: the input rows for every primary bar at or after `fromTs`, resumed
|
|
1062
1126
|
* from `carrySeed` (the state after every bar strictly before `fromTs`, see
|
|
@@ -1069,9 +1133,11 @@ export declare function buildWrunInputTailRows(metadata: WrunIndicatorMetadata,
|
|
|
1069
1133
|
* full build holds after them (the host's `advanceWrunCarry`: the aligner's own pass replayed
|
|
1070
1134
|
* through the last closed row over the same rows and clock; with no rows handed in, a plan that
|
|
1071
1135
|
* reads no leg advances from the rows' carry values alone). Returns a NEW carry; the seed is never
|
|
1072
|
-
* mutated.
|
|
1136
|
+
* mutated. From the empty seed, a clock naming an as-of advances the way the full build aligned
|
|
1137
|
+
* (`wrunHistoryAsOfSplit`): under the as-of through the split, then under the clock. `site` names the conversion
|
|
1138
|
+
* count it moves (`advance`, or `recovered` for the advance that replaces a combined build's moved carry).
|
|
1073
1139
|
*/
|
|
1074
|
-
export declare function advanceWrunInputCarry(metadata: WrunIndicatorMetadata, seed: WrunInputCarry, closedRows: readonly WrunInputRow[], sources?: Partial<WrunChartSourceRows>, clock?: WrunAlignClock): WrunInputCarry;
|
|
1140
|
+
export declare function advanceWrunInputCarry(metadata: WrunIndicatorMetadata, seed: WrunInputCarry, closedRows: readonly WrunInputRow[], sources?: Partial<WrunChartSourceRows>, clock?: WrunAlignClock, site?: 'advance' | 'recovered'): WrunInputCarry;
|
|
1075
1141
|
/** init()'s positional argument block: declared param defaults overlaid with
|
|
1076
1142
|
* any user-provided values by param name (wrunParamValuesFromSettings reads
|
|
1077
1143
|
* them off the overlay's settings, a colour as its packed number). Every
|