@orangecharts/wrun-chart-host 0.3.0 → 0.5.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 +23 -6
- package/dist/constants/exchange-names.leaf.d.ts +8 -0
- package/dist/constants/exchange-names.leaf.js +101 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +15 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +40 -0
- package/dist/constants/opra-compliance.constants.d.ts +19 -0
- package/dist/constants/opra-compliance.constants.js +19 -0
- package/dist/constants/replay-ladder.leaf.d.ts +30 -0
- package/dist/constants/replay-ladder.leaf.js +99 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +168 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.js +398 -0
- package/dist/constants/scriptEditor/converted-script-id.leaf.d.ts +8 -0
- package/dist/constants/scriptEditor/converted-script-id.leaf.js +10 -0
- package/dist/constants/scriptEditor/execution.constants.d.ts +4 -0
- package/dist/constants/scriptEditor/execution.constants.js +14 -0
- package/dist/constants/wrun-prefix-safe.constants.d.ts +23 -0
- package/dist/constants/wrun-prefix-safe.constants.js +26 -0
- package/dist/host-env.d.ts +321 -24
- package/dist/host-env.js +15 -0
- package/dist/host-ports.types.d.ts +857 -35
- package/dist/index.d.ts +149 -2
- package/dist/index.js +149 -2
- package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +31 -0
- package/dist/instances/script-engine-worker-ohlcv-transfer.js +164 -0
- package/dist/interfaces/market-event.interface.d.ts +231 -0
- package/dist/interfaces/market-event.interface.js +15 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +70 -134
- package/dist/interfaces/opra-realtime.interface.js +34 -59
- package/dist/interfaces/replay.interface.d.ts +285 -0
- package/dist/interfaces/replay.interface.js +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +1 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.js +93 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +5 -1
- package/dist/kscript-data/controls/live-trades-merge.util.js +2 -2
- package/dist/market-data/billing.interface.d.ts +219 -0
- package/dist/market-data/billing.interface.js +58 -0
- package/dist/market-data/venue-governed.util.d.ts +2 -0
- package/dist/market-data/venue-governed.util.js +10 -0
- package/dist/market-data/venue.d.ts +122 -0
- package/dist/market-data/venue.js +1 -0
- package/dist/market-data/venues/index.d.ts +97 -0
- package/dist/market-data/venues/index.js +33 -0
- package/dist/market-data/venues/opra.contract.copy.json +35 -0
- package/dist/market-data/venues/opra.d.ts +70 -0
- package/dist/market-data/venues/opra.js +74 -0
- package/dist/replay/replayIndicatorRows.d.ts +31 -0
- package/dist/replay/replayIndicatorRows.js +117 -0
- package/dist/replay/replayLadder.d.ts +85 -0
- package/dist/replay/replayLadder.js +388 -0
- package/dist/utility/auth/server-clock.util.d.ts +81 -0
- package/dist/utility/auth/server-clock.util.js +238 -0
- package/dist/utility/chart/builtin-identity.util.d.ts +18 -0
- package/dist/utility/chart/builtin-identity.util.js +51 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +454 -0
- package/dist/utility/chart/cache-alignment.util.js +926 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +15 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.js +22 -0
- package/dist/utility/chart/chart-mount-epoch.util.d.ts +5 -0
- package/dist/utility/chart/chart-mount-epoch.util.js +29 -0
- package/dist/utility/chart/chart-time-domain.util.d.ts +12 -0
- package/dist/utility/chart/chart-time-domain.util.js +23 -0
- package/dist/utility/chart/color-customization.leaf.d.ts +10 -0
- package/dist/utility/chart/color-customization.leaf.js +16 -0
- package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
- package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
- package/dist/utility/chart/footprint-tick-grid.util.d.ts +106 -0
- package/dist/utility/chart/footprint-tick-grid.util.js +167 -0
- package/dist/utility/chart/gesture-timing.leaf.d.ts +29 -0
- package/dist/utility/chart/gesture-timing.leaf.js +29 -0
- package/dist/utility/chart/governed-contract-coin.util.d.ts +22 -0
- package/dist/utility/chart/governed-contract-coin.util.js +39 -0
- package/dist/utility/chart/host-bar-placement.util.d.ts +107 -0
- package/dist/utility/chart/host-bar-placement.util.js +447 -0
- package/dist/utility/chart/index-host-tier.util.d.ts +31 -0
- package/dist/utility/chart/index-host-tier.util.js +118 -0
- package/dist/utility/chart/index-mode-admission.util.d.ts +34 -0
- package/dist/utility/chart/index-mode-admission.util.js +67 -0
- package/dist/utility/chart/indicator-error-message.util.d.ts +35 -0
- package/dist/utility/chart/indicator-error-message.util.js +44 -0
- package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
- package/dist/utility/chart/indicator-run-interval.util.js +268 -0
- package/dist/utility/chart/kscript-apply-fingerprint.util.d.ts +65 -0
- package/dist/utility/chart/kscript-apply-fingerprint.util.js +357 -0
- package/dist/utility/chart/kscript-chart-flush.leaf.d.ts +22 -0
- package/dist/utility/chart/kscript-chart-flush.leaf.js +13 -0
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +6 -0
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +27 -0
- package/dist/utility/chart/kscript-integration-decision.leaf.d.ts +89 -0
- package/dist/utility/chart/kscript-integration-decision.leaf.js +80 -0
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +76 -0
- package/dist/utility/chart/kscript-live-coalesce.util.js +156 -0
- package/dist/utility/chart/kscript-live-rest-pace.util.d.ts +34 -0
- package/dist/utility/chart/kscript-live-rest-pace.util.js +134 -0
- package/dist/utility/chart/kscript-live-source-identity.util.d.ts +98 -0
- package/dist/utility/chart/kscript-live-source-identity.util.js +121 -0
- package/dist/utility/chart/kscript-mounted-plot-set.leaf.d.ts +48 -0
- package/dist/utility/chart/kscript-mounted-plot-set.leaf.js +145 -0
- package/dist/utility/chart/kscript-perf-tracker.util.d.ts +243 -0
- package/dist/utility/chart/kscript-perf-tracker.util.js +522 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +43 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.js +471 -0
- package/dist/utility/chart/kscript-run-result-equality.util.d.ts +38 -0
- package/dist/utility/chart/kscript-run-result-equality.util.js +89 -0
- package/dist/utility/chart/kscript-settings-revision.leaf.d.ts +2 -0
- package/dist/utility/chart/kscript-settings-revision.leaf.js +12 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +63 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.js +68 -0
- package/dist/utility/chart/kscript-source-retention.util.d.ts +134 -0
- package/dist/utility/chart/kscript-source-retention.util.js +218 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +57 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.js +61 -0
- package/dist/utility/chart/kscript-titancharts-preparation.util.d.ts +15 -0
- package/dist/utility/chart/kscript-titancharts-preparation.util.js +376 -0
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +9 -0
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +130 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +217 -0
- package/dist/utility/chart/kscript-venue-policy.util.js +324 -0
- package/dist/utility/chart/live-cadence.util.d.ts +38 -0
- package/dist/utility/chart/live-cadence.util.js +37 -0
- package/dist/utility/chart/live-feed-series-match.leaf.d.ts +13 -0
- package/dist/utility/chart/live-feed-series-match.leaf.js +21 -0
- package/dist/utility/chart/local-engine-self-heal-backoff.util.d.ts +46 -0
- package/dist/utility/chart/local-engine-self-heal-backoff.util.js +46 -0
- package/dist/utility/chart/local-engine-uninit.leaf.d.ts +21 -0
- package/dist/utility/chart/local-engine-uninit.leaf.js +22 -0
- package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +62 -0
- package/dist/utility/chart/local-kscript-source-revalidation.util.js +123 -0
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +214 -0
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +376 -0
- package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.d.ts +85 -0
- package/dist/utility/chart/local-technical-script-live-apply-coalescer.util.js +197 -0
- package/dist/utility/chart/local-technical-script-range.leaf.d.ts +72 -0
- package/dist/utility/chart/local-technical-script-range.leaf.js +126 -0
- package/dist/utility/chart/mixed-mode.util.d.ts +167 -0
- package/dist/utility/chart/mixed-mode.util.js +139 -0
- package/dist/utility/chart/ohlcv-row-readiness.util.d.ts +36 -0
- package/dist/utility/chart/ohlcv-row-readiness.util.js +90 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +19 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.js +32 -0
- package/dist/utility/chart/overlay-execution-guard-key.leaf.d.ts +8 -0
- package/dist/utility/chart/overlay-execution-guard-key.leaf.js +10 -0
- package/dist/utility/chart/price-precision.util.d.ts +40 -0
- package/dist/utility/chart/price-precision.util.js +70 -0
- package/dist/utility/chart/profile-block-size.util.d.ts +64 -0
- package/dist/utility/chart/profile-block-size.util.js +141 -0
- package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.d.ts +11 -0
- package/dist/utility/chart/protected-kscript-degenerate-rows.leaf.js +29 -0
- package/dist/utility/chart/protected-kscript-empty-output.util.d.ts +28 -0
- package/dist/utility/chart/protected-kscript-empty-output.util.js +84 -0
- package/dist/utility/chart/run-interval-unservable.leaf.d.ts +9 -0
- package/dist/utility/chart/run-interval-unservable.leaf.js +20 -0
- package/dist/utility/chart/run-interval-warmup.leaf.d.ts +19 -0
- package/dist/utility/chart/run-interval-warmup.leaf.js +35 -0
- package/dist/utility/chart/titan-constants.pin.d.ts +9 -5
- package/dist/utility/chart/titan-constants.pin.js +18 -5
- package/dist/utility/chart/warmup-backfill-retry.leaf.d.ts +9 -0
- package/dist/utility/chart/warmup-backfill-retry.leaf.js +9 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
- package/dist/utility/chart/window-geometry.leaf.js +391 -0
- package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
- package/dist/utility/chart/window-owner.leaf.js +24 -0
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +11 -2
- package/dist/utility/chart/wrun-bar-session-facts.util.js +10 -3
- package/dist/utility/chart/wrun-run-result.util.d.ts +5 -1
- package/dist/utility/chart/wrun-run-result.util.js +20 -14
- package/dist/utility/common/data-processing.util.d.ts +138 -0
- package/dist/utility/common/data-processing.util.js +346 -0
- package/dist/utility/common/visible-timeout.util.d.ts +13 -4
- package/dist/utility/common/visible-timeout.util.js +23 -8
- package/dist/utility/exchange-format.leaf.d.ts +1 -0
- package/dist/utility/exchange-format.leaf.js +47 -0
- package/dist/utility/html-escape.leaf.d.ts +11 -0
- package/dist/utility/html-escape.leaf.js +20 -0
- package/dist/utility/market-events/earnings-scope.util.d.ts +60 -0
- package/dist/utility/market-events/earnings-scope.util.js +92 -0
- package/dist/utility/market-events/market-events.util.d.ts +147 -0
- package/dist/utility/market-events/market-events.util.js +392 -0
- package/dist/utility/market-events/zoned-clock.util.d.ts +1 -0
- package/dist/utility/market-events/zoned-clock.util.js +11 -0
- package/dist/utility/options/option-venue-disclosure.util.d.ts +43 -0
- package/dist/utility/options/option-venue-disclosure.util.js +56 -0
- package/dist/utility/scriptEditor/package-semver.util.d.ts +51 -0
- package/dist/utility/scriptEditor/package-semver.util.js +120 -0
- package/dist/utility/scriptEditor/temp-script-id.util.d.ts +18 -0
- package/dist/utility/scriptEditor/temp-script-id.util.js +25 -0
- package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.d.ts +20 -0
- package/dist/utility/symbol-selection/markets-request-from-symbols.leaf.js +81 -0
- package/dist/utility/v2/governed-tier.leaf.d.ts +103 -0
- package/dist/utility/v2/governed-tier.leaf.js +113 -0
- package/dist/utility/watchlist/import/import-request.leaf.d.ts +10 -0
- package/dist/utility/watchlist/import/import-request.leaf.js +10 -0
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +43 -15
- package/dist/utility/wrun/sources/lanes/option_daily.js +78 -20
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +14 -10
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +5 -4
- package/dist/utility/wrun/sources/lanes/series.js +2 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +22 -3
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +38 -7
- package/dist/utility/wrun/sources/registry.js +31 -1
- package/dist/utility/wrun/sources/row-lane-registry.js +5 -5
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +75 -20
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +57 -47
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +36 -4
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +6 -12
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +37 -3
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +128 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +233 -51
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +0 -8
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +26 -24
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +85 -104
- package/dist/utility/wrun/wrun-alert-outputs.registry.d.ts +166 -0
- package/dist/utility/wrun/wrun-alert-outputs.registry.js +219 -0
- package/dist/utility/wrun/wrun-bar-count.util.d.ts +83 -0
- package/dist/utility/wrun/wrun-bar-count.util.js +259 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-chart-context-names.util.js +186 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +253 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +731 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.d.ts +28 -0
- package/dist/utility/wrun/wrun-cloud-opra-stamp.util.js +45 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +18 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +47 -0
- package/dist/utility/wrun/wrun-deadline.util.js +2 -1
- package/dist/utility/wrun/wrun-debug-output.util.d.ts +39 -0
- package/dist/utility/wrun/wrun-debug-output.util.js +63 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +113 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.js +181 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +43 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +158 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +181 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.js +357 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.d.ts +16 -0
- package/dist/utility/wrun/wrun-draw-skipped.leaf.js +16 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-earnings-facts.util.js +131 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-first-run-depth.util.js +118 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-gate-plane-readers.util.js +31 -0
- package/dist/utility/wrun/wrun-held-lanes.util.d.ts +32 -0
- package/dist/utility/wrun/wrun-held-lanes.util.js +94 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-host-visible-clock.util.js +17 -0
- package/dist/utility/wrun/wrun-host.service.d.ts +266 -0
- package/dist/utility/wrun/wrun-host.service.js +655 -0
- package/dist/utility/wrun/wrun-inert-legend.util.d.ts +33 -0
- package/dist/utility/wrun/wrun-inert-legend.util.js +125 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +155 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +450 -0
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +51 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +59 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.d.ts +8 -0
- package/dist/utility/wrun/wrun-latest-history.leaf.js +8 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.d.ts +12 -0
- package/dist/utility/wrun/wrun-legend-hover.lazy.js +96 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +21 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-live-hidden-hold.util.js +13 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +374 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +2027 -0
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-live-patch.util.js +523 -0
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +619 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +4974 -0
- package/dist/utility/wrun/wrun-loading-owner.util.d.ts +58 -0
- package/dist/utility/wrun/wrun-loading-owner.util.js +89 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.d.ts +29 -0
- package/dist/utility/wrun/wrun-official-scope.leaf.js +36 -0
- package/dist/utility/wrun/wrun-oi-lane.util.d.ts +27 -0
- package/dist/utility/wrun/wrun-oi-lane.util.js +42 -0
- package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +29 -10
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +29 -10
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-options-stop.util.js +123 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +719 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +1180 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +50 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +131 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +118 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +466 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.d.ts +45 -0
- package/dist/utility/wrun/wrun-overlay-metadata.util.js +112 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +971 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +858 -0
- package/dist/utility/wrun/wrun-overlay-run.util.js +11013 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +392 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +2346 -0
- package/dist/utility/wrun/wrun-param-map.util.d.ts +19 -4
- package/dist/utility/wrun/wrun-param-map.util.js +40 -47
- package/dist/utility/wrun/wrun-param-values.util.d.ts +9 -3
- package/dist/utility/wrun/wrun-param-values.util.js +5 -5
- package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
- package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
- package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +93 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.js +484 -0
- package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +114 -0
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +486 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +317 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.js +630 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +73 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +380 -0
- package/dist/utility/wrun/wrun-refusal-text.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-refusal-text.util.js +40 -0
- package/dist/utility/wrun/wrun-replay-lane.util.d.ts +139 -0
- package/dist/utility/wrun/wrun-replay-lane.util.js +520 -0
- package/dist/utility/wrun/wrun-replay-rows.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-replay-rows.util.js +172 -0
- package/dist/utility/wrun/wrun-row-source-factory.d.ts +53 -0
- package/dist/utility/wrun/wrun-row-source-factory.js +435 -0
- package/dist/utility/wrun/wrun-run-cells.util.d.ts +36 -0
- package/dist/utility/wrun/wrun-run-cells.util.js +46 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +133 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.js +121 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +98 -0
- package/dist/utility/wrun/wrun-run-interval.util.js +207 -0
- package/dist/utility/wrun/wrun-run-retained.util.d.ts +122 -0
- package/dist/utility/wrun/wrun-run-retained.util.js +255 -0
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +184 -0
- package/dist/utility/wrun/wrun-sandbox-row-source.js +444 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +4 -4
- package/dist/utility/wrun/wrun-series-stream.util.d.ts +86 -0
- package/dist/utility/wrun/wrun-series-stream.util.js +537 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.d.ts +21 -0
- package/dist/utility/wrun/wrun-sheet-remembered.util.js +36 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.d.ts +7 -0
- package/dist/utility/wrun/wrun-signal-sound-reasons.leaf.js +12 -0
- package/dist/utility/wrun/wrun-socket-row-source.js +4 -2
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +175 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +294 -8
- package/dist/utility/wrun/wrun-stats-strip.util.d.ts +46 -0
- package/dist/utility/wrun/wrun-stats-strip.util.js +87 -0
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +163 -0
- package/dist/utility/wrun/wrun-table-chrome.util.js +557 -0
- package/dist/utility/wrun/wrun-text-params.util.d.ts +11 -6
- package/dist/utility/wrun/wrun-text-params.util.js +19 -30
- package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +64 -0
- package/dist/utility/wrun/wrun-transient-rerun.util.js +317 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-twin-lookback.util.js +43 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.d.ts +41 -0
- package/dist/utility/wrun/wrun-warmup-head-store.util.js +120 -0
- package/dist/utility/wrun-alert-params.leaf.d.ts +24 -0
- package/dist/utility/wrun-alert-params.leaf.js +24 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +148 -0
- package/dist/utils/replay/replay-buffer-math.js +684 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +190 -0
- package/dist/workers/wrun/wrun-abi-host.js +1201 -0
- package/dist/workers/wrun/wrun-engine-handler.d.ts +37 -0
- package/dist/workers/wrun/wrun-engine-handler.js +211 -0
- package/package.json +3 -3
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The interval an overlay asks on an index-mode host (`indexHostFetchTierMs`) and whether a source's rows straddle the
|
|
3
|
+
* host's bars (`sourceRowsStraddleHostBars`), with the bar-grid probes behind both (a summer and a winter day, memoized
|
|
4
|
+
* by the grid inputs). Out of `src/utility/chart/overlay-grid-rule.util.ts`, which re-exports both, so the run pass,
|
|
5
|
+
* a chart-host package module from 0.5.0, reads them (the leaf method).
|
|
6
|
+
*/
|
|
7
|
+
import { Intervals } from '../../constants/interval.constants.js';
|
|
8
|
+
import { wrunTierFitsBar } from '../wrun/wrun-tier-grid.util.js';
|
|
9
|
+
import { checkIsIndexMode } from './index-mode.util.js';
|
|
10
|
+
import { liveBucketStartMs, liveBucketStartsInRange } from './live-bucket.util.js';
|
|
11
|
+
import { isIntradayIntervalMs } from './rth-session.util.js';
|
|
12
|
+
import { usEquitiesSessionConfig } from './us-equities-session.util.js';
|
|
13
|
+
// The natively served tiers an overlay may ask in place of the chart interval
|
|
14
|
+
// (every preset is rolled up from these), coarsest first. Each divides the one
|
|
15
|
+
// before it, so the finer of two fitting tiers fits both grids.
|
|
16
|
+
const HOST_FETCH_TIERS_MS = ['4h', '1h', '30m', '15m', '5m', '1m'].map((label) => Intervals.map_unit[label]);
|
|
17
|
+
// A New York summer weekday and a winter one: the 09:30 anchor sits at 13:30Z
|
|
18
|
+
// in EDT and 14:30Z in EST, and the tier must fit the bars in both, so what an
|
|
19
|
+
// overlay asks (and caches) never moves with the season.
|
|
20
|
+
const TIER_PROBE_DAYS_MS = [Date.UTC(2026, 6, 15), Date.UTC(2026, 0, 14)];
|
|
21
|
+
const DAY_MS = 86_400_000;
|
|
22
|
+
const TIER_MEMO_MAX = 64;
|
|
23
|
+
const gridProbeByKey = new Map();
|
|
24
|
+
const fetchTierByGrids = new Map();
|
|
25
|
+
/** The inputs `liveBucketStartMs` reads for a venue at an interval (the extended-hours option included). */
|
|
26
|
+
function gridKeyOf(intervalMs, venue) {
|
|
27
|
+
return [
|
|
28
|
+
intervalMs,
|
|
29
|
+
venue?.exchange,
|
|
30
|
+
venue?.symbol,
|
|
31
|
+
venue?.sessionType,
|
|
32
|
+
venue?.transformations,
|
|
33
|
+
usEquitiesSessionConfig.extendedHoursEnabled,
|
|
34
|
+
].join('|');
|
|
35
|
+
}
|
|
36
|
+
function probeGrid(intervalMs, venue, key) {
|
|
37
|
+
// Probing two sessions costs milliseconds (zone math per probe), and every
|
|
38
|
+
// fetch, cache key and paint of an overlay asks again: memo by the grid inputs.
|
|
39
|
+
const memo = gridProbeByKey.get(key);
|
|
40
|
+
if (memo)
|
|
41
|
+
return memo;
|
|
42
|
+
const opens = TIER_PROBE_DAYS_MS.flatMap((dayMs) => liveBucketStartsInRange(dayMs, dayMs + DAY_MS - 1, intervalMs, venue ?? undefined));
|
|
43
|
+
const fits = (tierMs) => opens.every((open) => wrunTierFitsBar({ ms: tierMs }, open, intervalMs));
|
|
44
|
+
const tierMs = opens.length === 0 || fits(intervalMs)
|
|
45
|
+
? intervalMs
|
|
46
|
+
: (HOST_FETCH_TIERS_MS.find((candidate) => candidate < intervalMs && fits(candidate)) ?? intervalMs);
|
|
47
|
+
if (gridProbeByKey.size >= TIER_MEMO_MAX)
|
|
48
|
+
gridProbeByKey.clear();
|
|
49
|
+
const probe = { opens, tierMs };
|
|
50
|
+
gridProbeByKey.set(key, probe);
|
|
51
|
+
return probe;
|
|
52
|
+
}
|
|
53
|
+
function sameOpens(a, b) {
|
|
54
|
+
return a.length === b.length && a.every((open, i) => open === b[i]);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The interval an overlay asks on an index-mode host (stocks, forex,
|
|
58
|
+
* commodities, dex): the chart interval itself, except where a bar grid the
|
|
59
|
+
* overlay meets opens intraday bars off the chart interval's UTC grid (a
|
|
60
|
+
* regular-session stock's 09:30-anchored 45m to 12h bars), on the host or on
|
|
61
|
+
* a leg (`legVenues`: the series the overlay fetches, each keyed by its own
|
|
62
|
+
* venue). Each grid's fitting tier is the coarsest natively served tier that
|
|
63
|
+
* fits every bar it opens on a summer and a winter day (`wrunTierFitsBar`:
|
|
64
|
+
* the tier divides the bar and the bar opens on the tier's grid): 30m under
|
|
65
|
+
* :30 hourly bars, 15m under 45m bars, the chart interval on the UTC grid.
|
|
66
|
+
* The overlay asks the finest of them (the host's and each leg's), so every
|
|
67
|
+
* host bar AND every leg bar is a whole number of tier buckets and
|
|
68
|
+
* `placeRowsInHostBars` merges exactly. A leg list whose every leg opens on
|
|
69
|
+
* the host's own bars (stock vs stock in one session) asks the chart
|
|
70
|
+
* interval: its bars already are the host's. Without legs (flows over 24/7
|
|
71
|
+
* venues) the host grid decides. Daily and longer intervals, and every host
|
|
72
|
+
* that is not index-mode, ask the chart interval.
|
|
73
|
+
*/
|
|
74
|
+
export function indexHostFetchTierMs(intervalMs, hostVenue, legVenues) {
|
|
75
|
+
const exchange = typeof hostVenue?.exchange === 'string' ? hostVenue.exchange : undefined;
|
|
76
|
+
if (!isIntradayIntervalMs(intervalMs) || !checkIsIndexMode(exchange))
|
|
77
|
+
return intervalMs;
|
|
78
|
+
const hostKey = gridKeyOf(intervalMs, hostVenue);
|
|
79
|
+
const legKeys = (legVenues ?? []).map((leg) => gridKeyOf(intervalMs, leg));
|
|
80
|
+
const memoKey = [hostKey, ...legKeys].join('#');
|
|
81
|
+
const memo = fetchTierByGrids.get(memoKey);
|
|
82
|
+
if (memo !== undefined)
|
|
83
|
+
return memo;
|
|
84
|
+
const host = probeGrid(intervalMs, hostVenue, hostKey);
|
|
85
|
+
const legs = (legVenues ?? []).map((leg, i) => probeGrid(intervalMs, leg, legKeys[i]));
|
|
86
|
+
const tierMs = legs.length > 0 && legs.every((leg) => sameOpens(leg.opens, host.opens))
|
|
87
|
+
? intervalMs
|
|
88
|
+
: legs.reduce((finest, leg) => Math.min(finest, leg.tierMs), host.tierMs);
|
|
89
|
+
if (fetchTierByGrids.size >= TIER_MEMO_MAX)
|
|
90
|
+
fetchTierByGrids.clear();
|
|
91
|
+
fetchTierByGrids.set(memoKey, tierMs);
|
|
92
|
+
return tierMs;
|
|
93
|
+
}
|
|
94
|
+
const straddleByGrids = new Map();
|
|
95
|
+
/**
|
|
96
|
+
* Whether a source's rows (its venue's bars at `rowSpanMs`) straddle the
|
|
97
|
+
* host's bars at `intervalMs`: some host bar of a summer or a winter probe day
|
|
98
|
+
* opens inside a source row rather than on a row's open (a stock's 13:30Z
|
|
99
|
+
* hours over a 24/7 source's :00 hours, or the reverse on a crypto chart).
|
|
100
|
+
* Then the row closing first inside a host bar opens before that bar, so a
|
|
101
|
+
* fetch placed by last instant (`PlaceRowsInHostBarsOptions.rowSpanMs`) asks
|
|
102
|
+
* one source span early to hold the first bar's row. A source on the host's
|
|
103
|
+
* own grid, or a finer grid dividing it, never straddles.
|
|
104
|
+
*/
|
|
105
|
+
export function sourceRowsStraddleHostBars(intervalMs, hostVenue, rowSpanMs, sourceVenue) {
|
|
106
|
+
if (!(intervalMs > 0) || !(rowSpanMs > 0))
|
|
107
|
+
return false;
|
|
108
|
+
const hostKey = gridKeyOf(intervalMs, hostVenue);
|
|
109
|
+
const memoKey = `${hostKey}#${gridKeyOf(rowSpanMs, sourceVenue)}`;
|
|
110
|
+
const memo = straddleByGrids.get(memoKey);
|
|
111
|
+
if (memo !== undefined)
|
|
112
|
+
return memo;
|
|
113
|
+
const straddles = probeGrid(intervalMs, hostVenue, hostKey).opens.some((open) => liveBucketStartMs(open, rowSpanMs, sourceVenue ?? undefined) !== open);
|
|
114
|
+
if (straddleByGrids.size >= TIER_MEMO_MAX)
|
|
115
|
+
straddleByGrids.clear();
|
|
116
|
+
straddleByGrids.set(memoKey, straddles);
|
|
117
|
+
return straddles;
|
|
118
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** The kScript source types the dispatcher serves on an index-mode payload exchange. */
|
|
2
|
+
export declare function isKScriptTypeServedOnIndexMode(kScriptType: string): boolean;
|
|
3
|
+
/** Whether a lane is served on a market, and when not, by which fact: the dispatcher's index-mode
|
|
4
|
+
* admission, the market-kind table, or the coin table (with the coins the lane serves). */
|
|
5
|
+
export type WrunLaneService = {
|
|
6
|
+
served: true;
|
|
7
|
+
} | {
|
|
8
|
+
served: false;
|
|
9
|
+
reason: 'index-mode' | 'market-kind';
|
|
10
|
+
} | {
|
|
11
|
+
served: false;
|
|
12
|
+
reason: 'coin';
|
|
13
|
+
coins: readonly string[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The capability verdict for one lane on a market (`type` the lane's fetch type, `coin` the
|
|
17
|
+
* chart's coin): a native-rows ask is always served; then the index-mode admission
|
|
18
|
+
* (`'K_' + type.toUpperCase()`), the market-kind table, the coin table. An absent exchange reads
|
|
19
|
+
* as not index-mode and of no kind; an absent or empty coin cannot be judged and is served (the
|
|
20
|
+
* fetch decides).
|
|
21
|
+
*/
|
|
22
|
+
export declare function wrunLaneServiceOnMarket({ type, exchange, coin, nativeRows, }: {
|
|
23
|
+
type: string;
|
|
24
|
+
exchange: string | undefined;
|
|
25
|
+
coin?: string;
|
|
26
|
+
nativeRows?: boolean;
|
|
27
|
+
}): WrunLaneService;
|
|
28
|
+
/** Whether the chart's fetch serves a lane's type on a market (`wrunLaneServiceOnMarket`). */
|
|
29
|
+
export declare function wrunLaneServedOnMarket(args: {
|
|
30
|
+
type: string;
|
|
31
|
+
exchange: string | undefined;
|
|
32
|
+
coin?: string;
|
|
33
|
+
nativeRows?: boolean;
|
|
34
|
+
}): boolean;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The capability evidence for "this market has no such feed" (contract C3): the dispatcher's
|
|
3
|
+
* index-mode admission (`dataFetch` in titan-charts.ts) as ONE shared predicate, so a refusal
|
|
4
|
+
* calls a feed missing only where the chart's fetch never serves it, never from an empty window.
|
|
5
|
+
*
|
|
6
|
+
* On an index-mode payload exchange (stocks, forex, commodities, index venues, DEX pools) the
|
|
7
|
+
* dispatcher answers `[]` to every kScript source type but candles and buy/sell volume; a
|
|
8
|
+
* native-rows ask is exempt (its series is not the index-mode market's). A browser-run Indicator's
|
|
9
|
+
* governed options chain is one: the run asks a CME or OPRA chain on the native-rows path (it rides
|
|
10
|
+
* its plane's own reader), so an OpenMarket package's chain on a US stock or ETF chart passes, and a
|
|
11
|
+
* package that is not OpenMarket's own never reaches it (the run refuses it by name first, the OPRA
|
|
12
|
+
* wall; wrun-input-requirements.util `wrunUnservedLanes` with `nativeLanes`).
|
|
13
|
+
*
|
|
14
|
+
* Two market facts narrow it for a browser-run Indicator's lanes (`wrunLaneServiceOnMarket`):
|
|
15
|
+
* - the market-kind table: forex and commodities trade no volume the chart can split, keep no
|
|
16
|
+
* book and list no options, so they serve no volume profile, buy/sell volume, order book,
|
|
17
|
+
* implied volatility or skew, whatever the index-mode admission lets through;
|
|
18
|
+
* - the coin table: the option-summary lanes (implied volatility, skew) hold a series for the
|
|
19
|
+
* coins `WRUN_OPTION_SUMMARY_COINS` lists (BTC and ETH) and no other.
|
|
20
|
+
* The dispatcher's own admission (`isKScriptTypeServedOnIndexMode`) stays as it is.
|
|
21
|
+
*/
|
|
22
|
+
import { checkIsIndexMode } from './index-mode.util.js';
|
|
23
|
+
import { checkIsForexOrCommodity } from './marketKind.util.js';
|
|
24
|
+
import { WRUN_OPTION_SUMMARY_COINS, WRUN_OPTION_SUMMARY_LANES } from '../wrun/wrun-option-summary-lane.util.js';
|
|
25
|
+
/** The kScript source types the dispatcher serves on an index-mode payload exchange. */
|
|
26
|
+
export function isKScriptTypeServedOnIndexMode(kScriptType) {
|
|
27
|
+
return kScriptType === 'K_OHLCV' || kScriptType === 'K_BUY_SELL_VOLUME';
|
|
28
|
+
}
|
|
29
|
+
/** The lane fetch types a forex or commodity market never serves (the market-kind table). */
|
|
30
|
+
const FOREX_COMMODITY_UNSERVED_TYPES = new Set([
|
|
31
|
+
'volume_profile',
|
|
32
|
+
'buy_sell_volume',
|
|
33
|
+
'orderbook',
|
|
34
|
+
WRUN_OPTION_SUMMARY_LANES.implied_volatility.type,
|
|
35
|
+
WRUN_OPTION_SUMMARY_LANES.skew.type,
|
|
36
|
+
]);
|
|
37
|
+
/** The lane fetch types served for some coins only, and those coins (the coin table). */
|
|
38
|
+
const COIN_SERVED_TYPES = Object.freeze({
|
|
39
|
+
[WRUN_OPTION_SUMMARY_LANES.implied_volatility.type]: WRUN_OPTION_SUMMARY_COINS,
|
|
40
|
+
[WRUN_OPTION_SUMMARY_LANES.skew.type]: WRUN_OPTION_SUMMARY_COINS,
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* The capability verdict for one lane on a market (`type` the lane's fetch type, `coin` the
|
|
44
|
+
* chart's coin): a native-rows ask is always served; then the index-mode admission
|
|
45
|
+
* (`'K_' + type.toUpperCase()`), the market-kind table, the coin table. An absent exchange reads
|
|
46
|
+
* as not index-mode and of no kind; an absent or empty coin cannot be judged and is served (the
|
|
47
|
+
* fetch decides).
|
|
48
|
+
*/
|
|
49
|
+
export function wrunLaneServiceOnMarket({ type, exchange, coin, nativeRows, }) {
|
|
50
|
+
if (nativeRows === true)
|
|
51
|
+
return { served: true };
|
|
52
|
+
if (checkIsIndexMode(exchange) && !isKScriptTypeServedOnIndexMode('K_' + type.toUpperCase())) {
|
|
53
|
+
return { served: false, reason: 'index-mode' };
|
|
54
|
+
}
|
|
55
|
+
if (FOREX_COMMODITY_UNSERVED_TYPES.has(type) && checkIsForexOrCommodity(exchange)) {
|
|
56
|
+
return { served: false, reason: 'market-kind' };
|
|
57
|
+
}
|
|
58
|
+
const coins = COIN_SERVED_TYPES[type];
|
|
59
|
+
const word = typeof coin === 'string' ? coin.trim().toUpperCase() : '';
|
|
60
|
+
if (coins !== undefined && word !== '' && !coins.includes(word))
|
|
61
|
+
return { served: false, reason: 'coin', coins };
|
|
62
|
+
return { served: true };
|
|
63
|
+
}
|
|
64
|
+
/** Whether the chart's fetch serves a lane's type on a market (`wrunLaneServiceOnMarket`). */
|
|
65
|
+
export function wrunLaneServedOnMarket(args) {
|
|
66
|
+
return wrunLaneServiceOnMarket(args).served;
|
|
67
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Change-only errorMessage stamps.
|
|
3
|
+
*
|
|
4
|
+
* The fetch pipeline stamps `errorMessage` transiently on hot paths (every
|
|
5
|
+
* non-polling indicator fetch entry and terminal, every diagnostics write),
|
|
6
|
+
* almost always with a value identical to what the overlay already holds.
|
|
7
|
+
* Each write walks the engine's updateSettings (legend rebuild, and a
|
|
8
|
+
* scheduled forced paint on engines without the errorMessage door skip), so
|
|
9
|
+
* during a fetch volley the identical stamps alone re-arm a forced paint
|
|
10
|
+
* every display frame. This helper writes ONLY on a value change.
|
|
11
|
+
*
|
|
12
|
+
* Equality is judged over the union of keys of both values (show/text plus
|
|
13
|
+
* chip extras like severity, hostCard, count, tooltip, details, source: an
|
|
14
|
+
* ownership or count transition always writes), with `show` coerced to
|
|
15
|
+
* boolean and `text` defaulting to '' so an ABSENT stored value equals a
|
|
16
|
+
* `{show:false}` clear. Everything the comparator cannot positively judge
|
|
17
|
+
* fails open (writes): non-primitive members, a malformed non-object value
|
|
18
|
+
* on either side, an overlay not yet mounted in metadata.
|
|
19
|
+
*
|
|
20
|
+
* Loading, gap-filling, and gap-detection never read errorMessage; skipped
|
|
21
|
+
* writes are value-identical by construction, so every visible transition
|
|
22
|
+
* writes exactly as before.
|
|
23
|
+
*/
|
|
24
|
+
import type { WrunChartHandle } from '../../host-ports.types.js';
|
|
25
|
+
export interface IndicatorErrorMessageValue {
|
|
26
|
+
show?: unknown;
|
|
27
|
+
text?: unknown;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
export declare function indicatorErrorMessagesEqual(a: IndicatorErrorMessageValue | null | undefined, b: IndicatorErrorMessageValue | null | undefined): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Stamp `errorMessage` on the overlay only when the value actually changed.
|
|
33
|
+
* Returns true when a write happened.
|
|
34
|
+
*/
|
|
35
|
+
export declare function updateIndicatorErrorMessageIfChanged(tc: WrunChartHandle | undefined | null, indicatorId: string, next: IndicatorErrorMessageValue): boolean;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function normalized(value) {
|
|
2
|
+
const source = value && typeof value === 'object' ? value : {};
|
|
3
|
+
const out = { ...source };
|
|
4
|
+
out.show = Boolean(source.show);
|
|
5
|
+
out.text = source.text ?? '';
|
|
6
|
+
return out;
|
|
7
|
+
}
|
|
8
|
+
export function indicatorErrorMessagesEqual(a, b) {
|
|
9
|
+
// A malformed (non-null, non-object) value cannot be judged: fail open so
|
|
10
|
+
// the write replaces it instead of a skip preserving garbage.
|
|
11
|
+
if (a !== null && a !== undefined && typeof a !== 'object')
|
|
12
|
+
return false;
|
|
13
|
+
if (b !== null && b !== undefined && typeof b !== 'object')
|
|
14
|
+
return false;
|
|
15
|
+
const na = normalized(a);
|
|
16
|
+
const nb = normalized(b);
|
|
17
|
+
const union = new Set([...Object.keys(na), ...Object.keys(nb)]);
|
|
18
|
+
for (const key of union) {
|
|
19
|
+
const av = na[key];
|
|
20
|
+
const bv = nb[key];
|
|
21
|
+
const aEmpty = av === null || av === undefined;
|
|
22
|
+
const bEmpty = bv === null || bv === undefined;
|
|
23
|
+
if (aEmpty && bEmpty)
|
|
24
|
+
continue;
|
|
25
|
+
// Strict equality; non-primitives can never be === across writers, so a
|
|
26
|
+
// structured value fails open and writes.
|
|
27
|
+
if (av !== bv)
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Stamp `errorMessage` on the overlay only when the value actually changed.
|
|
34
|
+
* Returns true when a write happened.
|
|
35
|
+
*/
|
|
36
|
+
export function updateIndicatorErrorMessageIfChanged(tc, indicatorId, next) {
|
|
37
|
+
if (!tc)
|
|
38
|
+
return false;
|
|
39
|
+
const meta = tc.metadata.find((m) => m?.id === indicatorId);
|
|
40
|
+
if (meta && indicatorErrorMessagesEqual(meta.settings?.errorMessage, next))
|
|
41
|
+
return false;
|
|
42
|
+
tc.updateSettings(indicatorId, { errorMessage: next });
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { BuiltinInputReader } from '../../constants/scriptEditor/builtin-script-snippets.js';
|
|
2
|
+
/**
|
|
3
|
+
* Built-ins whose `timeframe` input runs the engine at that interval: every built-in template with
|
|
4
|
+
* the input, the 14 classics (P2, 2026-10-03) and the 14 TradingView staples (2026-10-04), each
|
|
5
|
+
* pinned by tests/utility/chart/indicator-run-interval.parity.spec.ts against its own chart at that
|
|
6
|
+
* interval. A built-in without the input (Zig Zag, Pivot Points, Volume Bubbles) and every
|
|
7
|
+
* community script run at the chart's interval.
|
|
8
|
+
*/
|
|
9
|
+
export declare const NATIVE_RUN_INTERVAL_SUBTYPES: ReadonlySet<string>;
|
|
10
|
+
/**
|
|
11
|
+
* The lookback, in run bars, a converted built-in's chart path computes over where the engine's
|
|
12
|
+
* declared lookback misses a term. The declaration pass reports the deepest single input of each
|
|
13
|
+
* function it sees (MACD's slow period, the Ichimoku lagging span, the stochastic %K window, one
|
|
14
|
+
* Wilder period for ADX), not the chain the template runs: MACD's signal EMA runs over the slow
|
|
15
|
+
* EMA, Ichimoku displaces its spans past the lagging window, the stochastic smooths %K and then
|
|
16
|
+
* %D (and an oscillator smoothing after that), ADX averages period DX values that each need
|
|
17
|
+
* period true ranges. The warm-up (run-interval-engine.util) takes the deeper of this and the
|
|
18
|
+
* declared lookback, so every other converted built-in, whose declaration is right (a period, a
|
|
19
|
+
* volume MA length, none for the path-dependent ADL, OBV and PSAR, which read the warm-up floor),
|
|
20
|
+
* needs no entry. Mirrors WRUN_RUN_INTERVAL_TWINS (wrun-run-interval.util) with the templates' input
|
|
21
|
+
* names. `inputs` reads each input as set on the overlay, else as the template declares it, else 0.
|
|
22
|
+
*
|
|
23
|
+
* The staples (measured against the declaration pass, 2026-10-04): the pass does not trace an input
|
|
24
|
+
* into atr(), wpr() or highestbars(), so Supertrend, Keltner's ATR bands, Williams %R and Aroon
|
|
25
|
+
* declare nothing for it; an offset reads the line that many bars back (Donchian, WMA, VWMA); Hull
|
|
26
|
+
* runs its outer average over round(sqrt(period)) hull inputs; the Stochastic RSI chains the RSI,
|
|
27
|
+
* its stochastic window and the K and D averages. ATR, CMF, Momentum, ROC and the Awesome
|
|
28
|
+
* Oscillator declare their own lookback right. Supertrend is path-dependent beyond its ATR (its
|
|
29
|
+
* bands and trend carry from the first loaded bar), like PSAR.
|
|
30
|
+
*/
|
|
31
|
+
export declare const NATIVE_RUN_INTERVAL_LOOKBACK_BARS: Readonly<Record<string, (inputs: BuiltinInputReader) => number>>;
|
|
32
|
+
export interface OverlayRunInterval {
|
|
33
|
+
/** Chart interval key the engine runs at ("1h", "1d"). */
|
|
34
|
+
interval: string;
|
|
35
|
+
intervalMs: number;
|
|
36
|
+
/**
|
|
37
|
+
* On: every chart bar shows the last run bar that closed before it. Off: the same, except the
|
|
38
|
+
* chart bars of the newest run bar's bucket show that (forming) bar.
|
|
39
|
+
*/
|
|
40
|
+
waitForClose: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The run bars ride the CME session lattice: the chart's venue is one the gateway rolls up on it
|
|
43
|
+
* (CME, CBOT, NYMEX, COMEX; overlayWrunRunInterval sets it, for the wrun twins only). A run bar's
|
|
44
|
+
* span is then read on the session calendar (runBarSpan): at 4h, 1D and 1W its session bar's
|
|
45
|
+
* open and close, a 1D bar stamped 00:00Z of its trade date after its 17:00 Chicago open the
|
|
46
|
+
* evening before, a 1W bar on the Monday after its Sunday open; at the widths that divide an hour
|
|
47
|
+
* the lattice is the plain grid. A session gap (the daily halt, a weekend, a holiday) holds no run
|
|
48
|
+
* bar of its own (nextRunBarCloseMs). Data, never a function: the stamp rides contexts and
|
|
49
|
+
* results. Absent everywhere else.
|
|
50
|
+
*/
|
|
51
|
+
sessionLattice?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/** What a run bar's span reads: the run interval and whether its bars ride the CME session lattice. */
|
|
54
|
+
export type RunBarCalendar = Pick<OverlayRunInterval, 'intervalMs' | 'sessionLattice'>;
|
|
55
|
+
/** A run bar's span: it takes trades from `open` until `close`. */
|
|
56
|
+
export interface RunBarSpan {
|
|
57
|
+
open: number;
|
|
58
|
+
close: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The [open, close) of the run bar stamped `stamp`: `[stamp, stamp + intervalMs)`, or on the CME
|
|
62
|
+
* session lattice its session bar's (cmeSessionBarOpenMs, cmeSessionBarEndMs: a 1D bar stamped at
|
|
63
|
+
* 00:00Z of its trade date opens at the 17:00 Chicago open before it and closes at the next one).
|
|
64
|
+
* A stamp the lattice books no bar to (a width that divides an hour, a regular-hours bar, a time
|
|
65
|
+
* that is no run bar's) reads the plain span.
|
|
66
|
+
*/
|
|
67
|
+
export declare function runBarSpan(stamp: number, run: RunBarCalendar): RunBarSpan;
|
|
68
|
+
/**
|
|
69
|
+
* The close of the run bar after the one stamped `stamp`: from there on a chart bar shows a run bar
|
|
70
|
+
* later than it. Plain, the next run bar opens at its close (`stamp + 2 * intervalMs`). On the
|
|
71
|
+
* session lattice a gap (the daily halt, a weekend, a holiday) holds no run bar, so the next one is
|
|
72
|
+
* the run bar of the first chart bar (`chartTimes`, ascending) at or after its close: that chart
|
|
73
|
+
* bar's session bar when `stamp` is one, else the run bar it opens (a session reopens on a run
|
|
74
|
+
* bar's open, a regular-hours one included). Infinity when no chart bar reaches that close.
|
|
75
|
+
*/
|
|
76
|
+
export declare function nextRunBarCloseMs(stamp: number, chartTimes: readonly number[], run: RunBarCalendar): number;
|
|
77
|
+
export interface RunIntervalInput {
|
|
78
|
+
/** The overlay's `settings.subType` ("RSI"). */
|
|
79
|
+
subType: unknown;
|
|
80
|
+
/** The overlay's settings: input values live flat under each input's name. */
|
|
81
|
+
settings: unknown;
|
|
82
|
+
/** The chart's interval, as a key ("5m") or milliseconds. */
|
|
83
|
+
chartInterval: unknown;
|
|
84
|
+
/** Market replay keeps the template path. */
|
|
85
|
+
replay?: boolean;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The run interval a Timeframe option label ("1h", "1D") selects on a chart of `chartInterval`:
|
|
89
|
+
* coarser than the chart, else null (the chart's own interval, an unknown label, "chart"). Shared
|
|
90
|
+
* by the kScript built-ins (resolveRunInterval) and their wrun Indicators (wrun-run-interval.util).
|
|
91
|
+
*/
|
|
92
|
+
export declare function runIntervalOfTimeframeLabel(label: unknown, chartInterval: unknown): Pick<OverlayRunInterval, 'interval' | 'intervalMs'> | null;
|
|
93
|
+
/**
|
|
94
|
+
* Whether a Timeframe option label selects the chart's own interval or a finer one. Such a
|
|
95
|
+
* selection means "chart" (HTF-NATIVE-PLAN.md D3a): the resolver below answers null for it, and the
|
|
96
|
+
* engine must see `timeframe: "chart"` too (chartIntervalEngineMetadata), or the template's
|
|
97
|
+
* selected-timeframe branch calls htf() with an interval below its base and the engine throws on
|
|
98
|
+
* every update ("htf() timeframe 900000ms must be >= base interval 3600000ms": a 15m selection
|
|
99
|
+
* on a 1h chart froze the line at its last good run, Kyle's 2026-10-03 INT dump). Their wrun twins
|
|
100
|
+
* read it too (wrunTimeframeIsChartOrFiner, wrun-run-interval.util).
|
|
101
|
+
*/
|
|
102
|
+
export declare function timeframeIsChartOrFiner(label: unknown, chartInterval: unknown): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* The interval an overlay's engine runs at when it is coarser than the chart's, else null (the
|
|
105
|
+
* overlay runs at the chart's interval, as before). A selection at or below the chart's interval
|
|
106
|
+
* is the chart's own, so it takes the plain chart path too.
|
|
107
|
+
*/
|
|
108
|
+
export declare function resolveRunInterval(input: RunIntervalInput): OverlayRunInterval | null;
|
|
109
|
+
/** The settings the engine sees for a run-interval overlay: the template takes its plain chart path. */
|
|
110
|
+
export declare function engineSettingsForRunInterval<T extends object>(settings: T): T & {
|
|
111
|
+
timeframe: 'chart';
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Projects run-interval rows (oldest first, `row[0]` = the run bar's stamp, its open off the
|
|
115
|
+
* session lattice) onto the chart's bars: one row per chart time, with the cells of the run row that
|
|
116
|
+
* bar shows. Each run bar's span is read by runBarSpan (`sessionLattice`: the CME session calendar).
|
|
117
|
+
*
|
|
118
|
+
* Wait for close on: a chart bar shows the last run bar that closed at or before it
|
|
119
|
+
* (`close <= chartTime`, plain `stamp + runMs`), so a 5m bar in hour b shows hour b - 1. Off: the
|
|
120
|
+
* same, except the chart bars inside the newest run row's span show that row (the forming bar,
|
|
121
|
+
* live; on the lattice from its session open, before a 1D or 1W stamp). Chart bars before the first
|
|
122
|
+
* shown row get NaN cells. Run rows before the first chart bar (the warm-up) are dropped.
|
|
123
|
+
*/
|
|
124
|
+
export declare function projectRunRowsOntoChart(rows: readonly (readonly unknown[] | null | undefined)[], chartTimes: readonly number[], runMs: number, waitForClose: boolean, sessionLattice?: boolean): unknown[][];
|
|
125
|
+
/**
|
|
126
|
+
* The chart time a run-bar time anchor (a drawing point at a run bar's stamp) lands on: where that
|
|
127
|
+
* bar's value first shows (its close with wait for close on, its open with it off, read by
|
|
128
|
+
* runBarSpan), clamped to the chart's loaded bars.
|
|
129
|
+
*/
|
|
130
|
+
export declare function projectRunTimeOntoChart(runTime: number, chartTimes: readonly number[], runMs: number, waitForClose: boolean, sessionLattice?: boolean): number;
|