@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
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `tape` input source's browser-side contract (WRUN-BIG-TRADES-PLAN C1, and C-DOLLAR for the dollar floor): how a
|
|
3
3
|
* package's `inputSources.<name> = { source: "tape", min_size | min_value, history }` becomes the ONE acquisition the
|
|
4
|
-
* K_TRADES lane fetches and the live intake folds:
|
|
5
|
-
*
|
|
6
|
-
* lane fetch, so every refusal here lands by name and at zero fetches.
|
|
4
|
+
* K_TRADES large lane fetches and the live intake folds. Pure: no store, no chart, no fetch; the run pass calls it at
|
|
5
|
+
* its head, before any lane fetch, so every refusal here lands by name and at zero fetches.
|
|
7
6
|
*
|
|
8
7
|
* - A tape declares exactly ONE floor, `min_size` or `min_value`; both or neither refuses `wrun_tape_floor_invalid`
|
|
9
8
|
* naming the input. Each is a number literal or a string naming a declared numeric `param`, resolved from the run's
|
|
@@ -23,8 +22,9 @@
|
|
|
23
22
|
* - The table's own floor ($10k quote on USD-quoted markets, a contracts floor per CME Group root) is a fact a package
|
|
24
23
|
* cannot lower: a floor below it is served at the table's floor (documented, never enforced here).
|
|
25
24
|
* - `history: "0" | <duration>`: `"0"` (the default) is the live edge only; a duration `^\d+(s|m|h|d)$` seeds that much
|
|
26
|
-
* history from TRADE_LARGE
|
|
27
|
-
*
|
|
25
|
+
* history from TRADE_LARGE, counted back from the run's as-of (the server's now on a live run, the replay's present
|
|
26
|
+
* in market replay: live-trades-merge.util `SOURCE_HISTORY_AS_OF_FIELD`), at most `WRUN_TAPE_HISTORY_MAX_SEC` (30
|
|
27
|
+
* days); a zero-length spelling ("0m") is the live
|
|
28
28
|
* edge too. Anything else refuses `wrun_tape_history_invalid`. The lane serves `min(history, the chart's loaded
|
|
29
29
|
* window)`, and no more than the gateway's bar limit lets it today (`WRUN_TAPE_HISTORY_SERVED_MAX_SEC`: 15,000
|
|
30
30
|
* one-minute points, about 10.4 days; k-trades.control.ts opens the ask at the first bar after it), so the
|
|
@@ -40,17 +40,32 @@
|
|
|
40
40
|
* (the row builder's empty block). Big Trades 0.8.0 floors CME in contracts (`min_size` on `tape_contracts`, asked
|
|
41
41
|
* on size unit 3) and every other market in dollars (`min_value` on `tape`, asked on 0, 1 and 2): one acquisition
|
|
42
42
|
* on every market, two floors in the sheet.
|
|
43
|
+
* - `min_coins` (contract C-COINS item 2) is the smallest print served by its size in coins, a third floor beside the
|
|
44
|
+
* two (exactly one of the three). The run asks the dollar table, `minQuoteAmount`, at F = min_coins x L x the
|
|
45
|
+
* market's dollar unit x 0.9, L the lowest price the market traded at across the window that request reads
|
|
46
|
+
* (wrun-tape-coins.util, priced by the run pass from candles covering the window): F never exceeds min_coins x p for
|
|
47
|
+
* any price p the window traded at, so no trade of min_coins or more is dropped. Cells arrive in dollars, as on a
|
|
48
|
+
* `min_value` tape, and the acquisition keeps the coins and L beside the dollar floor (`minCoins`, `priceLow`): the
|
|
49
|
+
* live leg re-plans once the market trades below L x 0.9. No price for the window refuses the tape by name
|
|
50
|
+
* (`wrun_tape_coins_unpriced`), never a guess.
|
|
43
51
|
* The om daemon shares the vocabulary (`wrun_tape_floor_invalid`, `wrun_tape_min_size_invalid`,
|
|
44
52
|
* `wrun_tape_min_value_invalid`, `wrun_tape_history_invalid`).
|
|
45
53
|
*/
|
|
46
|
-
import { TRADES_LARGE_BAR_LIMIT_SEC
|
|
54
|
+
import { TRADES_LARGE_BAR_LIMIT_SEC } from '../../kscript-data/controls/live-trades-merge.util.js';
|
|
47
55
|
/** A tape `min_size` that resolves to nothing servable (a param the package does not declare, non-finite or not
|
|
48
56
|
* above zero). */
|
|
49
57
|
export const WRUN_TAPE_MIN_SIZE_INVALID_CODE = 'wrun_tape_min_size_invalid';
|
|
50
58
|
/** A tape `min_value` that resolves to nothing servable (a param the package does not declare, non-finite or not
|
|
51
59
|
* above zero): C-DOLLAR's refusal, naming the input and the param. */
|
|
52
60
|
export const WRUN_TAPE_MIN_VALUE_INVALID_CODE = 'wrun_tape_min_value_invalid';
|
|
53
|
-
/** A tape
|
|
61
|
+
/** A tape `min_coins` that resolves to nothing servable (C-COINS item 2, the facet's own code beside the other two). */
|
|
62
|
+
export const WRUN_TAPE_MIN_COINS_INVALID_CODE = 'wrun_tape_min_coins_invalid';
|
|
63
|
+
/** A coins tape (`min_coins`) whose request window has no price the run can read: the floor is never guessed. */
|
|
64
|
+
export const WRUN_TAPE_COINS_UNPRICED_CODE = 'wrun_tape_coins_unpriced';
|
|
65
|
+
/** The plan setting a coins tape's priced dollar floor rides under (`wrunTapeFloorSettings`): no param can be named so,
|
|
66
|
+
* and the row builder plans the tape at it as a literal floor, never bound to the coins param. */
|
|
67
|
+
export const WRUN_TAPE_COINS_PLAN_FLOOR = '@min_coins';
|
|
68
|
+
/** A tape input declaring several floors or none (C-DOLLAR, C-COINS): a tape serves exactly one floor. */
|
|
54
69
|
export const WRUN_TAPE_FLOOR_INVALID_CODE = 'wrun_tape_floor_invalid';
|
|
55
70
|
/** A dollar tape (C-DOLLAR's `min_value`) on a market whose dollar unit no read can ever prove (a quote that is no
|
|
56
71
|
* dollar, a venue or a contract with no point value): none of its prints could be valued, so the run refuses it by
|
|
@@ -76,11 +91,12 @@ export const WRUN_TAPE_HISTORY_MAX_SEC = 2_592_000;
|
|
|
76
91
|
export const WRUN_TAPE_HISTORY_SERVED_MAX_SEC = TRADES_LARGE_BAR_LIMIT_SEC;
|
|
77
92
|
const WRUN_TAPE_HISTORY_PATTERN = /^(\d+)(s|m|h|d)$/;
|
|
78
93
|
const WRUN_TAPE_HISTORY_UNIT_SEC = { s: 1, m: 60, h: 3600, d: 86_400 };
|
|
79
|
-
const WRUN_TAPE_FLOOR_FACETS = ['min_size', 'min_value'];
|
|
94
|
+
const WRUN_TAPE_FLOOR_FACETS = ['min_size', 'min_value', 'min_coins'];
|
|
80
95
|
/** Each floor facet's refusal code and the words a refusal uses for what it floors. */
|
|
81
96
|
const WRUN_TAPE_FLOOR_RULES = {
|
|
82
97
|
min_size: { code: WRUN_TAPE_MIN_SIZE_INVALID_CODE, what: 'size' },
|
|
83
98
|
min_value: { code: WRUN_TAPE_MIN_VALUE_INVALID_CODE, what: 'value' },
|
|
99
|
+
min_coins: { code: WRUN_TAPE_MIN_COINS_INVALID_CODE, what: 'size in coins' },
|
|
84
100
|
};
|
|
85
101
|
/** Whether an input source is a tape the run asks: a `tape` source the run's sheet on the chart's market did not mark
|
|
86
102
|
* `undemanded` (wrunSheetWithLaneDemand, kit 0.95.0's `needed_by` on a secondary tape). THE predicate every reader
|
|
@@ -109,7 +125,7 @@ export function parseWrunTapeHistory(metadata, inputName, history) {
|
|
|
109
125
|
}
|
|
110
126
|
return seconds;
|
|
111
127
|
}
|
|
112
|
-
/** The floor facet a tape source declares when it declares exactly one, else undefined (
|
|
128
|
+
/** The floor facet a tape source declares when it declares exactly one, else undefined (several, or none). */
|
|
113
129
|
export function wrunTapeFloorFacetOf(source) {
|
|
114
130
|
const declared = WRUN_TAPE_FLOOR_FACETS.filter((facet) => source[facet] !== undefined);
|
|
115
131
|
return declared.length === 1 ? declared[0] : undefined;
|
|
@@ -161,27 +177,35 @@ export function resolveWrunTapeMinSize(metadata, inputName, source, paramValues)
|
|
|
161
177
|
export function resolveWrunTapeMinValue(metadata, inputName, source, paramValues) {
|
|
162
178
|
return resolveWrunTapeFloorFacet(metadata, inputName, 'min_value', source.min_value, paramValues);
|
|
163
179
|
}
|
|
164
|
-
/** A tape input's one floor, by its facet: refused `wrun_tape_floor_invalid` naming the input when it declares
|
|
165
|
-
* floors or
|
|
180
|
+
/** A tape input's one floor, by its facet: refused `wrun_tape_floor_invalid` naming the input when it declares
|
|
181
|
+
* several floors or none, else by the facet's own code when the value is not servable. */
|
|
166
182
|
export function resolveWrunTapeFloor(metadata, inputName, source, paramValues) {
|
|
167
183
|
const facet = wrunTapeFloorFacetOf(source);
|
|
168
184
|
if (facet === undefined) {
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
185
|
+
const declared = WRUN_TAPE_FLOOR_FACETS.filter((key) => source[key] !== undefined);
|
|
186
|
+
const words = declared.length === 0
|
|
187
|
+
? 'no floor'
|
|
188
|
+
: declared.length === 2
|
|
189
|
+
? `both ${declared.join(' and ')}`
|
|
190
|
+
: `${declared.slice(0, -1).join(', ')} and ${declared[declared.length - 1]}`;
|
|
191
|
+
throw new Error(`WRUN ${metadata.id}: input '${inputName}' (tape) declares ${words} ` +
|
|
192
|
+
`(${WRUN_TAPE_FLOOR_INVALID_CODE}): a tape takes exactly one floor, min_size (the raw stored unit), ` +
|
|
193
|
+
'min_value (US dollars) or min_coins (coins)');
|
|
173
194
|
}
|
|
174
195
|
return { facet, value: resolveWrunTapeFloorFacet(metadata, inputName, facet, source[facet], paramValues) };
|
|
175
196
|
}
|
|
176
|
-
/** The floor an acquisition asks at, in its own unit (raw stored units under `min_size`, dollars under `min_value`
|
|
197
|
+
/** The floor an acquisition asks at, in its own unit (raw stored units under `min_size`, dollars under `min_value`
|
|
198
|
+
* and under a priced `min_coins`; a coins acquisition not priced yet asks none). */
|
|
177
199
|
export function wrunTapeFloorOf(tape) {
|
|
178
200
|
return (tape.minValue ?? tape.minSize);
|
|
179
201
|
}
|
|
180
202
|
/** The words a refusal states an acquisition's floor in: the raw number under `min_size`, a US dollar amount under
|
|
181
|
-
* `min_value` (`$500,000`). */
|
|
203
|
+
* `min_value` (`$500,000`), the coins under `min_coins` (`10`, the setting's own number). */
|
|
182
204
|
export function wrunTapeFloorWords(tape) {
|
|
183
205
|
if (tape === undefined)
|
|
184
206
|
return '0';
|
|
207
|
+
if (tape.minCoins !== undefined)
|
|
208
|
+
return String(tape.minCoins);
|
|
185
209
|
if (tape.minValue === undefined)
|
|
186
210
|
return String(tape.minSize ?? 0);
|
|
187
211
|
return `$${tape.minValue.toLocaleString('en-US', { maximumFractionDigits: 2 })}`;
|
|
@@ -208,10 +232,13 @@ export function resolveWrunTapeAcquisition(metadata, paramValues) {
|
|
|
208
232
|
const floor = resolveWrunTapeFloor(metadata, name, source, paramValues);
|
|
209
233
|
if (acquisition === undefined || first === undefined) {
|
|
210
234
|
first = floor;
|
|
235
|
+
const base = { history, historySeconds, inputNames: [name] };
|
|
211
236
|
acquisition =
|
|
212
237
|
floor.facet === 'min_size'
|
|
213
|
-
? { minSize: floor.value,
|
|
214
|
-
:
|
|
238
|
+
? { minSize: floor.value, ...base }
|
|
239
|
+
: floor.facet === 'min_value'
|
|
240
|
+
? { minValue: floor.value, ...base }
|
|
241
|
+
: { minCoins: floor.value, ...base };
|
|
215
242
|
continue;
|
|
216
243
|
}
|
|
217
244
|
if (first.facet !== floor.facet || first.value !== floor.value || acquisition.historySeconds !== historySeconds) {
|
|
@@ -246,7 +273,9 @@ export function wrunTapeFloorSettingWords(metadata) {
|
|
|
246
273
|
/**
|
|
247
274
|
* The settings a row build hands the shared host's plan for a param-bound floor
|
|
248
275
|
* (`WrunChartSourceRows.settings`): the floor the lane's acquisition was asked at (`wrunTapeFloorOf`, in its own
|
|
249
|
-
* unit), under the name of every param a tape input's floor (`min_size` or `min_value`) names
|
|
276
|
+
* unit), under the name of every param a tape input's floor (`min_size` or `min_value`) names, and a coins tape's
|
|
277
|
+
* priced dollar floor under `WRUN_TAPE_COINS_PLAN_FLOOR` whether its `min_coins` names a param or holds a literal: the
|
|
278
|
+
* plan asks it as a literal floor, so the coins param's bounds never judge a dollar number. The host resolves that
|
|
250
279
|
* floor itself from the settings it is handed (its planTapeFloors; a `min_value` tape is planned as the kit's floor
|
|
251
280
|
* facet over the dollar cells, wrun-source-rows.util `wrunPlannedSheet`), so the plan's tape ask carries the floor the
|
|
252
281
|
* run resolved from the overlay's current settings (`resolveWrunTapeAcquisition`): a full run hands its acquisition's
|
|
@@ -263,6 +292,10 @@ export function wrunTapeFloorSettings(metadata, floorValue) {
|
|
|
263
292
|
for (const source of Object.values(metadata.inputSources)) {
|
|
264
293
|
if (!isWrunAskedTapeSource(source))
|
|
265
294
|
continue;
|
|
295
|
+
if (wrunTapeFloorFacetOf(source) === 'min_coins') {
|
|
296
|
+
(settings ??= {})[WRUN_TAPE_COINS_PLAN_FLOOR] = floor;
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
266
299
|
const paramName = wrunTapeFloorParamOf(source);
|
|
267
300
|
if (paramName !== undefined)
|
|
268
301
|
(settings ??= {})[paramName] = floor;
|
|
@@ -278,25 +311,30 @@ export function wrunTapeAcquisitionFloor(acquisition) {
|
|
|
278
311
|
}
|
|
279
312
|
/**
|
|
280
313
|
* The K_TRADES payload extras of a tape acquisition (the run pass's `fetchLane('trades', 'tp', ...)`, which the run
|
|
281
|
-
* records as the lane's acquisition: the history fetch, the reconcile's re-ask
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
314
|
+
* records as the lane's acquisition: the history fetch, the reconcile's re-ask and the live fold read the SAME
|
|
315
|
+
* payload): the large lane, the declared history and the one floor. A dollar floor also carries `valuePerUnit`, the US
|
|
316
|
+
* dollars one price unit times one size unit of a live print is worth on the chart's market (the run head's
|
|
317
|
+
* `wrunMarketDollarUnit`); without it no live print can be priced and none folds (the history rows carry the gateway's
|
|
318
|
+
* own dollar value). A raw floor carries exactly what it always did, so 0.5.0's payload is unchanged. A priced coins
|
|
319
|
+
* floor rides as the dollar floor it priced, its coins and its price beside it (`minCoins`, `priceLow`, and
|
|
320
|
+
* `priceFromChart` when the chart's own candles are the market's prices: the live leg's re-plan reads them, the worker
|
|
321
|
+
* never does).
|
|
322
|
+
* Always the large lane, on every market: a market Big Trades misses needs its floor in the streamd ingest service's
|
|
323
|
+
* config, never a raw-tape read here (docs/features/indicators/big-trades.md).
|
|
291
324
|
*/
|
|
292
|
-
export function wrunTapeLaneExtras(tape, valuePerUnit
|
|
293
|
-
|
|
325
|
+
export function wrunTapeLaneExtras(tape, valuePerUnit) {
|
|
326
|
+
// A coins floor has no ask until its window is priced: an unpriced one would ride as an unfiltered tape.
|
|
327
|
+
if (tape.minCoins !== undefined && tape.minValue === undefined) {
|
|
328
|
+
throw new Error(`input '${tape.inputNames[0]}' (tape): a min_coins floor asks only once priced (${WRUN_TAPE_COINS_UNPRICED_CODE})`);
|
|
329
|
+
}
|
|
294
330
|
if (tape.minValue === undefined)
|
|
295
|
-
return { minSize: tape.minSize, history: tape.history,
|
|
331
|
+
return { minSize: tape.minSize, history: tape.history, large: true };
|
|
296
332
|
return {
|
|
297
333
|
minValue: tape.minValue,
|
|
298
334
|
...(valuePerUnit !== undefined && Number.isFinite(valuePerUnit) && valuePerUnit > 0 ? { valuePerUnit } : {}),
|
|
299
335
|
history: tape.history,
|
|
300
|
-
|
|
336
|
+
large: true,
|
|
337
|
+
...(tape.minCoins !== undefined ? { minCoins: tape.minCoins, priceLow: tape.priceLow } : {}),
|
|
338
|
+
...(tape.priceFromChart === true ? { priceFromChart: true } : {}),
|
|
301
339
|
};
|
|
302
340
|
}
|
|
@@ -27,16 +27,24 @@ export interface WrunHostBarSpan {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* The session a host bar covers when it is not its stamp to its end, under a session grid (a flow's plan, see the
|
|
30
|
-
* module header): a bar
|
|
31
|
-
* 00:00Z label at 1d, its group's first trade date at 3d, its week's Monday at 1w, its month's 1st
|
|
32
|
-
* length) runs from the
|
|
33
|
-
* starts the next bar (`
|
|
34
|
-
* a stock chart's), an intraday lattice width (its stamp is its open), a stamp the lattice
|
|
30
|
+
* module header): a bar a session lattice stamps at a day or longer (session-lattice.util, the CME family and forex:
|
|
31
|
+
* the trade date's 00:00Z label at 1d, its group's first trade date at 3d, its week's Monday at 1w, its month's 1st
|
|
32
|
+
* at a calendar length) runs from the session open before it (`venueSessionLatticeBarOpenMs`, read inside the bar) to
|
|
33
|
+
* the open that starts the next bar (`venueSessionLatticeBarEndMs`). Undefined for any other bar: no grid, a grid off
|
|
34
|
+
* every lattice (a UTC or a stock chart's), an intraday lattice width (its stamp is its open), a stamp the lattice
|
|
35
|
+
* books no row to.
|
|
35
36
|
*/
|
|
36
37
|
export declare function wrunCmeSessionBarSpan(barOpenMs: number, intervalMs: number, sessionGrid: LiveBucketVenue | null | undefined): WrunHostBarSpan | undefined;
|
|
37
38
|
/** A host bar's span: its session under a session grid (`wrunCmeSessionBarSpan`), else its stamp to its end
|
|
38
39
|
* (`wrunHostGridFetchTo`: its calendar close on a calendar chart). */
|
|
39
40
|
export declare function wrunHostBarSpanOf(barOpenMs: number, intervalMs: number, sessionGrid?: LiveBucketVenue | null): WrunHostBarSpan;
|
|
41
|
+
/** The host bars of a window that `[fromMs, toMs)` reaches, each its span (`wrunHostBarSpanOf`) cut at the next bar's
|
|
42
|
+
* stamp: a lane that marks bars by time stamps a row inside each bar it means, never by stepping the interval. */
|
|
43
|
+
export declare function wrunHostBarSpansWithin(window: {
|
|
44
|
+
barOpens: readonly number[];
|
|
45
|
+
intervalMs: number;
|
|
46
|
+
barGrid?: LiveBucketVenue | null;
|
|
47
|
+
}, fromMs: number, toMs: number): WrunHostBarSpan[];
|
|
40
48
|
/** The finest tier that fits a host bar (the one its live bar is built from), or undefined when none fits
|
|
41
49
|
* (a bar finer than every tier, or one whose open sits on no tier's grid). */
|
|
42
50
|
export declare function wrunFinestTier(tiers: readonly WrunBackendTier[], barOpenMs: number, barMs: number): WrunBackendTier | undefined;
|
|
@@ -36,8 +36,7 @@
|
|
|
36
36
|
* whose tier bucket has closed by the clock: a forming bucket is never read as the bar's state).
|
|
37
37
|
*/
|
|
38
38
|
import { barEndMs, calendarMonthsOfMs } from '../chart/calendar-interval.util.js';
|
|
39
|
-
import {
|
|
40
|
-
import { isCmeSessionLatticeVenue, liveBucketStartMs } from '../chart/live-bucket.util.js';
|
|
39
|
+
import { liveBucketStartMs, venueSessionLatticeBarEndMs, venueSessionLatticeBarOpenMs, } from '../chart/live-bucket.util.js';
|
|
41
40
|
import { wrunPartialMarkerTuple, wrunTuplesMarkedPartial } from './wrun-present-bits.util.js';
|
|
42
41
|
const DAY_MS = 86_400_000;
|
|
43
42
|
/** The span a tier must divide: the bar's own, or a day for a calendar bar (its span is no fixed number). */
|
|
@@ -63,22 +62,20 @@ function fittingTiers(tiers, barOpenMs, barMs) {
|
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
64
|
* The session a host bar covers when it is not its stamp to its end, under a session grid (a flow's plan, see the
|
|
66
|
-
* module header): a bar
|
|
67
|
-
* 00:00Z label at 1d, its group's first trade date at 3d, its week's Monday at 1w, its month's 1st
|
|
68
|
-
* length) runs from the
|
|
69
|
-
* starts the next bar (`
|
|
70
|
-
* a stock chart's), an intraday lattice width (its stamp is its open), a stamp the lattice
|
|
65
|
+
* module header): a bar a session lattice stamps at a day or longer (session-lattice.util, the CME family and forex:
|
|
66
|
+
* the trade date's 00:00Z label at 1d, its group's first trade date at 3d, its week's Monday at 1w, its month's 1st
|
|
67
|
+
* at a calendar length) runs from the session open before it (`venueSessionLatticeBarOpenMs`, read inside the bar) to
|
|
68
|
+
* the open that starts the next bar (`venueSessionLatticeBarEndMs`). Undefined for any other bar: no grid, a grid off
|
|
69
|
+
* every lattice (a UTC or a stock chart's), an intraday lattice width (its stamp is its open), a stamp the lattice
|
|
70
|
+
* books no row to.
|
|
71
71
|
*/
|
|
72
72
|
export function wrunCmeSessionBarSpan(barOpenMs, intervalMs, sessionGrid) {
|
|
73
|
-
if (!Number.isFinite(barOpenMs) || !(intervalMs >= DAY_MS)
|
|
73
|
+
if (!Number.isFinite(barOpenMs) || !(intervalMs >= DAY_MS))
|
|
74
74
|
return undefined;
|
|
75
|
-
|
|
76
|
-
if (!isCmeSessionLatticeVenue(sessionGrid))
|
|
77
|
-
return undefined;
|
|
78
|
-
const toMs = cmeSessionBarEndMs(barOpenMs, intervalMs);
|
|
75
|
+
const toMs = venueSessionLatticeBarEndMs(barOpenMs, intervalMs, sessionGrid);
|
|
79
76
|
if (toMs === null)
|
|
80
77
|
return undefined;
|
|
81
|
-
const fromMs =
|
|
78
|
+
const fromMs = venueSessionLatticeBarOpenMs(toMs - 1, intervalMs, sessionGrid);
|
|
82
79
|
return fromMs !== null && fromMs < toMs ? { fromMs, toMs } : undefined;
|
|
83
80
|
}
|
|
84
81
|
/** A host bar's span: its session under a session grid (`wrunCmeSessionBarSpan`), else its stamp to its end
|
|
@@ -89,6 +86,19 @@ export function wrunHostBarSpanOf(barOpenMs, intervalMs, sessionGrid) {
|
|
|
89
86
|
toMs: wrunHostGridFetchTo(barOpenMs, intervalMs),
|
|
90
87
|
});
|
|
91
88
|
}
|
|
89
|
+
/** The host bars of a window that `[fromMs, toMs)` reaches, each its span (`wrunHostBarSpanOf`) cut at the next bar's
|
|
90
|
+
* stamp: a lane that marks bars by time stamps a row inside each bar it means, never by stepping the interval. */
|
|
91
|
+
export function wrunHostBarSpansWithin(window, fromMs, toMs) {
|
|
92
|
+
const spans = [];
|
|
93
|
+
window.barOpens.forEach((open, at) => {
|
|
94
|
+
const span = wrunHostBarSpanOf(open, window.intervalMs, window.barGrid);
|
|
95
|
+
const next = window.barOpens[at + 1];
|
|
96
|
+
const end = next !== undefined ? Math.min(span.toMs, next) : span.toMs;
|
|
97
|
+
if (end > fromMs && span.fromMs < toMs)
|
|
98
|
+
spans.push({ fromMs: span.fromMs, toMs: end });
|
|
99
|
+
});
|
|
100
|
+
return spans;
|
|
101
|
+
}
|
|
92
102
|
/** The tiers that fit a session (its length a whole number of the tier's buckets, its open on the tier's UTC grid),
|
|
93
103
|
* finest first: on a CME session the hour and finer, never the UTC day. */
|
|
94
104
|
function sessionTiers(tiers, span) {
|
|
@@ -81,10 +81,11 @@ function tpoRowGridRefusal(name, rowHeight, from, to, price) {
|
|
|
81
81
|
}
|
|
82
82
|
function tpoFoldSpecOf(input) {
|
|
83
83
|
const sessionType = tpoPeriodWord(input.period ?? 'day');
|
|
84
|
+
// A kit TPO has no trading-hour choice and no chart session in its input: its day is the venue's, as before.
|
|
84
85
|
const customTimeRange = resolveTradingDayTpoTimeRange({
|
|
85
86
|
sessionType,
|
|
86
87
|
...(input.exchange !== undefined ? { exchange: input.exchange } : {}),
|
|
87
|
-
});
|
|
88
|
+
}, null);
|
|
88
89
|
return {
|
|
89
90
|
name: input.name,
|
|
90
91
|
rowHeight: finite(input.rowHeight) && input.rowHeight > 0 ? input.rowHeight : 1,
|
|
@@ -20,8 +20,15 @@
|
|
|
20
20
|
* A trades input pinned to another market (kit 0.77.0) reads a leg lane per
|
|
21
21
|
* (quote, market), `trades@BYBIT|BTCUSDT`: its fetch key, live lane and
|
|
22
22
|
* `tradeLegRows` key (docs: wrun-typed-inputs.md, "Coin legs").
|
|
23
|
+
*
|
|
24
|
+
* A leg lane is asked by ONE planner (`planWrunTradeLegAsk`, WRUN-PANBACK C): the
|
|
25
|
+
* whole run's window and a pan-back prefix page's ask the same request, a leg on
|
|
26
|
+
* the chart's own grid plainly and any other at the tier that fits both grids.
|
|
27
|
+
* The leg placement rules it reads (`wrunLegVenueOf`, `wrunLegStraddlesChartBars`,
|
|
28
|
+
* `wrunLegPlacementLeadMs`) are the pinned candle legs' too.
|
|
23
29
|
*/
|
|
24
30
|
import type { WrunInputSource } from '../../interfaces/wrun-runtime.interface.js';
|
|
31
|
+
import { type LiveBucketVenue } from '../chart/live-bucket.util.js';
|
|
25
32
|
/** A trades lane: one per quote. */
|
|
26
33
|
export type WrunTradesLane = 'trades' | 'trades_usd';
|
|
27
34
|
/** A trades lane's payload extras: present only on the dollar lane. */
|
|
@@ -50,3 +57,69 @@ export declare function wrunTradesLegOf(lane: string): WrunTradesLeg | undefined
|
|
|
50
57
|
export declare function isWrunTradesLegLane(value: unknown): value is WrunTradesLegLane;
|
|
51
58
|
/** A leg lane's payload extras: its market, its quote's own, and `pinnedMarket` (its market's series on any chart). */
|
|
52
59
|
export declare function wrunTradesLegExtras(lane: WrunTradesLegLane): Record<string, unknown>;
|
|
60
|
+
/** The chart a leg's ask is planned against: the run clock's bar span (the chart's interval, or the run interval's)
|
|
61
|
+
* and the chart's market and bar grid as `liveBucketVenueOf` reads them (the chart's metadata, or the market a live
|
|
62
|
+
* session recorded). */
|
|
63
|
+
export interface WrunLegAskChart {
|
|
64
|
+
intervalMs: number;
|
|
65
|
+
venue: LiveBucketVenue | null | undefined;
|
|
66
|
+
}
|
|
67
|
+
/** A leg's own bar grid: its market (the chart's own where it names none) at the chart's session. */
|
|
68
|
+
export declare function wrunLegVenueOf(chart: WrunLegAskChart, market: {
|
|
69
|
+
exchange?: unknown;
|
|
70
|
+
symbol?: unknown;
|
|
71
|
+
} | undefined): LiveBucketVenue;
|
|
72
|
+
/**
|
|
73
|
+
* Whether a leg's rows at `legMs` straddle the chart's bars (`sourceRowsStraddleHostBars`: a 24/7 market's :00 hours
|
|
74
|
+
* under a stock's 09:30-anchored bars, a crypto market's 4h bars on a CME chart's session lattice, or the reverse).
|
|
75
|
+
* Such a leg is placed on the chart's bars by the row builder alone (`wrunLegRowsOnHostBars`), so its asks ride
|
|
76
|
+
* dataFetch's native-rows path and its window opens one leg span early (`wrunLegPlacementLeadMs`): the chart's first
|
|
77
|
+
* bar is owed the row opening up to one leg span before it. A leg on the chart's own grid, or on a finer one dividing
|
|
78
|
+
* it, never straddles, and a leg coarser than the chart is never placed.
|
|
79
|
+
*/
|
|
80
|
+
export declare function wrunLegStraddlesChartBars(chart: WrunLegAskChart, legMs: number, market: {
|
|
81
|
+
exchange?: unknown;
|
|
82
|
+
symbol?: unknown;
|
|
83
|
+
} | undefined): boolean;
|
|
84
|
+
/** The span a leg's window opens before the chart's first bar: one leg span where its rows straddle the chart's bars
|
|
85
|
+
* (`wrunLegStraddlesChartBars`), else none. */
|
|
86
|
+
export declare function wrunLegPlacementLeadMs(chart: WrunLegAskChart, legMs: number, market: {
|
|
87
|
+
exchange?: unknown;
|
|
88
|
+
symbol?: unknown;
|
|
89
|
+
} | undefined): number;
|
|
90
|
+
/** The request a trades leg lane is asked with (`planWrunTradeLegAsk`). */
|
|
91
|
+
export interface WrunTradeLegAsk {
|
|
92
|
+
lane: WrunTradesLegLane;
|
|
93
|
+
/** The K control every leg rides: its market's buy and sell volume. */
|
|
94
|
+
type: 'buy_sell_volume';
|
|
95
|
+
/** The leg's payload extras (`wrunTradesLegExtras`): its market, its quote's own, `pinnedMarket`. */
|
|
96
|
+
extras: Record<string, unknown>;
|
|
97
|
+
/** The window the ask spans: the asked window on the chart's own grid; a tier ask's from one tier row early where
|
|
98
|
+
* the leg's rows straddle the chart's bars, through the last bar's close. */
|
|
99
|
+
fromMs: number;
|
|
100
|
+
toMs: number;
|
|
101
|
+
/** The tier ask (dataFetch's native-rows path at the tier that fits every chart bar and every leg bar, its payload
|
|
102
|
+
* extras naming the tier and the path), or null for a leg on the chart's own grid, asked plainly. */
|
|
103
|
+
tier: null | {
|
|
104
|
+
tierMs: number;
|
|
105
|
+
extras: Record<string, unknown>;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The request a trades leg lane is asked with over a window `[fromMs, toMs]` (the run window's first bar through its
|
|
110
|
+
* last bar's open), on the chart `chart`: the whole run's ask (wrun-overlay-run.util, the browser lanes) and a
|
|
111
|
+
* pan-back prefix page's (`acquireWrunPrefixLanePages`) alike, so a page asks a leg exactly as the whole run it stands
|
|
112
|
+
* in for would. A trades leg rides the grid-leg model: its rows stay on its own market's grid and the row builder sums
|
|
113
|
+
* them into the chart bars holding them (wrun-source-rows `tradeLegRowsOf`). On an index-mode chart or market, and
|
|
114
|
+
* wherever its rows straddle the chart's bars (`wrunLegStraddlesChartBars`), it is asked at a tier (`tier`): the
|
|
115
|
+
* native-rows path (its rows at their own stamps, never placed on the chart's bars by the fetch) at the tier that fits
|
|
116
|
+
* every chart bar and every leg bar (`indexHostFetchTierMs`: 30m under a stock's :30 hours, so each bar sums whole
|
|
117
|
+
* tier rows; the chart's interval on a timestamp-mode chart), the chart's bars asked whole (through the last bar's
|
|
118
|
+
* close, from one tier row early where the rows straddle). The tier and the path ride its acquisition, which the
|
|
119
|
+
* intake folds the live prints at and the reconcile asks again. Elsewhere (a 24/7 leg on a 24/7 chart) the ask is the
|
|
120
|
+
* chart's own window at the chart's interval (`tier` null). Undefined for a lane that names no leg market.
|
|
121
|
+
*/
|
|
122
|
+
export declare function planWrunTradeLegAsk(lane: WrunTradesLegLane, chart: WrunLegAskChart, window: {
|
|
123
|
+
fromMs: number;
|
|
124
|
+
toMs: number;
|
|
125
|
+
}): WrunTradeLegAsk | undefined;
|
|
@@ -20,7 +20,18 @@
|
|
|
20
20
|
* A trades input pinned to another market (kit 0.77.0) reads a leg lane per
|
|
21
21
|
* (quote, market), `trades@BYBIT|BTCUSDT`: its fetch key, live lane and
|
|
22
22
|
* `tradeLegRows` key (docs: wrun-typed-inputs.md, "Coin legs").
|
|
23
|
+
*
|
|
24
|
+
* A leg lane is asked by ONE planner (`planWrunTradeLegAsk`, WRUN-PANBACK C): the
|
|
25
|
+
* whole run's window and a pan-back prefix page's ask the same request, a leg on
|
|
26
|
+
* the chart's own grid plainly and any other at the tier that fits both grids.
|
|
27
|
+
* The leg placement rules it reads (`wrunLegVenueOf`, `wrunLegStraddlesChartBars`,
|
|
28
|
+
* `wrunLegPlacementLeadMs`) are the pinned candle legs' too.
|
|
23
29
|
*/
|
|
30
|
+
import { Intervals } from '../../constants/interval.constants.js';
|
|
31
|
+
import { barEndMs, isCalendarIntervalMs } from '../chart/calendar-interval.util.js';
|
|
32
|
+
import { indexHostFetchTierMs, sourceRowsStraddleHostBars } from '../chart/index-host-tier.util.js';
|
|
33
|
+
import { liveBucketVenueOf } from '../chart/live-bucket.util.js';
|
|
34
|
+
import { wrunLegRidesNativeRows } from './wrun-pin-venues.util.js';
|
|
24
35
|
export const WRUN_TRADES_LANES = {
|
|
25
36
|
trades: { key: 'bsv' },
|
|
26
37
|
trades_usd: { key: 'bsvusd', extras: { currency: 'USD' } },
|
|
@@ -56,3 +67,74 @@ export function wrunTradesLegExtras(lane) {
|
|
|
56
67
|
const leg = wrunTradesLegOf(lane);
|
|
57
68
|
return { symbol: leg.symbol, exchange: leg.exchange, ...WRUN_TRADES_LANES[leg.lane].extras, pinnedMarket: true };
|
|
58
69
|
}
|
|
70
|
+
/** The chart's exchange word, when its venue names one. */
|
|
71
|
+
function wrunLegAskChartExchange(chart) {
|
|
72
|
+
return typeof chart.venue?.exchange === 'string' ? chart.venue.exchange : undefined;
|
|
73
|
+
}
|
|
74
|
+
/** A leg's own bar grid: its market (the chart's own where it names none) at the chart's session. */
|
|
75
|
+
export function wrunLegVenueOf(chart, market) {
|
|
76
|
+
return liveBucketVenueOf({
|
|
77
|
+
exchange: market?.exchange ?? wrunLegAskChartExchange(chart),
|
|
78
|
+
symbol: market?.symbol ?? chart.venue?.symbol,
|
|
79
|
+
sessionType: chart.venue?.sessionType,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Whether a leg's rows at `legMs` straddle the chart's bars (`sourceRowsStraddleHostBars`: a 24/7 market's :00 hours
|
|
84
|
+
* under a stock's 09:30-anchored bars, a crypto market's 4h bars on a CME chart's session lattice, or the reverse).
|
|
85
|
+
* Such a leg is placed on the chart's bars by the row builder alone (`wrunLegRowsOnHostBars`), so its asks ride
|
|
86
|
+
* dataFetch's native-rows path and its window opens one leg span early (`wrunLegPlacementLeadMs`): the chart's first
|
|
87
|
+
* bar is owed the row opening up to one leg span before it. A leg on the chart's own grid, or on a finer one dividing
|
|
88
|
+
* it, never straddles, and a leg coarser than the chart is never placed.
|
|
89
|
+
*/
|
|
90
|
+
export function wrunLegStraddlesChartBars(chart, legMs, market) {
|
|
91
|
+
return (legMs > 0 &&
|
|
92
|
+
legMs <= chart.intervalMs &&
|
|
93
|
+
!isCalendarIntervalMs(legMs) &&
|
|
94
|
+
sourceRowsStraddleHostBars(chart.intervalMs, liveBucketVenueOf(chart.venue), legMs, wrunLegVenueOf(chart, market)));
|
|
95
|
+
}
|
|
96
|
+
/** The span a leg's window opens before the chart's first bar: one leg span where its rows straddle the chart's bars
|
|
97
|
+
* (`wrunLegStraddlesChartBars`), else none. */
|
|
98
|
+
export function wrunLegPlacementLeadMs(chart, legMs, market) {
|
|
99
|
+
return wrunLegStraddlesChartBars(chart, legMs, market) ? legMs : 0;
|
|
100
|
+
}
|
|
101
|
+
/** The chart's spelling of an interval span (an `Intervals.map_unit` key), the run's own: wrun-source-rows.util
|
|
102
|
+
* `wrunChartIntervalKeyOf`, which imports this module, so the word is spelled here by the same rule (the trades legs
|
|
103
|
+
* spec pins the two over every interval). */
|
|
104
|
+
function wrunLegTierIntervalKey(intervalMs) {
|
|
105
|
+
const entry = Object.entries(Intervals.map_unit).find(([, ms]) => ms === intervalMs);
|
|
106
|
+
return entry ? entry[0] : `${intervalMs}ms`;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The request a trades leg lane is asked with over a window `[fromMs, toMs]` (the run window's first bar through its
|
|
110
|
+
* last bar's open), on the chart `chart`: the whole run's ask (wrun-overlay-run.util, the browser lanes) and a
|
|
111
|
+
* pan-back prefix page's (`acquireWrunPrefixLanePages`) alike, so a page asks a leg exactly as the whole run it stands
|
|
112
|
+
* in for would. A trades leg rides the grid-leg model: its rows stay on its own market's grid and the row builder sums
|
|
113
|
+
* them into the chart bars holding them (wrun-source-rows `tradeLegRowsOf`). On an index-mode chart or market, and
|
|
114
|
+
* wherever its rows straddle the chart's bars (`wrunLegStraddlesChartBars`), it is asked at a tier (`tier`): the
|
|
115
|
+
* native-rows path (its rows at their own stamps, never placed on the chart's bars by the fetch) at the tier that fits
|
|
116
|
+
* every chart bar and every leg bar (`indexHostFetchTierMs`: 30m under a stock's :30 hours, so each bar sums whole
|
|
117
|
+
* tier rows; the chart's interval on a timestamp-mode chart), the chart's bars asked whole (through the last bar's
|
|
118
|
+
* close, from one tier row early where the rows straddle). The tier and the path ride its acquisition, which the
|
|
119
|
+
* intake folds the live prints at and the reconcile asks again. Elsewhere (a 24/7 leg on a 24/7 chart) the ask is the
|
|
120
|
+
* chart's own window at the chart's interval (`tier` null). Undefined for a lane that names no leg market.
|
|
121
|
+
*/
|
|
122
|
+
export function planWrunTradeLegAsk(lane, chart, window) {
|
|
123
|
+
const leg = wrunTradesLegOf(lane);
|
|
124
|
+
if (leg === undefined)
|
|
125
|
+
return undefined;
|
|
126
|
+
const extras = wrunTradesLegExtras(lane);
|
|
127
|
+
const tierMs = indexHostFetchTierMs(chart.intervalMs, liveBucketVenueOf(chart.venue), [wrunLegVenueOf(chart, leg)]);
|
|
128
|
+
const native = wrunLegRidesNativeRows({ market: { exchange: leg.exchange } }, wrunLegAskChartExchange(chart)) ||
|
|
129
|
+
wrunLegStraddlesChartBars(chart, tierMs, leg);
|
|
130
|
+
if (!native)
|
|
131
|
+
return { lane, type: 'buy_sell_volume', extras, fromMs: window.fromMs, toMs: window.toMs, tier: null };
|
|
132
|
+
return {
|
|
133
|
+
lane,
|
|
134
|
+
type: 'buy_sell_volume',
|
|
135
|
+
extras,
|
|
136
|
+
fromMs: window.fromMs - wrunLegPlacementLeadMs(chart, tierMs, leg),
|
|
137
|
+
toMs: barEndMs(window.toMs, chart.intervalMs),
|
|
138
|
+
tier: { tierMs, extras: { ...extras, interval: wrunLegTierIntervalKey(tierMs), nativeRows: true } },
|
|
139
|
+
};
|
|
140
|
+
}
|
|
@@ -10,5 +10,10 @@
|
|
|
10
10
|
* are style names). The kScript stand-in keys a twin's last drawing on these
|
|
11
11
|
* values, so a period change moves the key and a colour pick or a Visible
|
|
12
12
|
* flip does not. Declaration order, each name once; empty without rows.
|
|
13
|
+
*
|
|
14
|
+
* It reads the rows as handed over, on every key the stand-in builds: a
|
|
15
|
+
* caller holding a framework's reactive view hands over the plain objects
|
|
16
|
+
* (the web stand-in reads Vue's raw rows), since a row read through such a
|
|
17
|
+
* view comes back wrapped in a proxy of its own.
|
|
13
18
|
*/
|
|
14
19
|
export declare function wrunTwinComputeInputNames(settings: unknown): string[];
|
|
@@ -37,6 +37,11 @@ function nonEmptyString(value) {
|
|
|
37
37
|
* are style names). The kScript stand-in keys a twin's last drawing on these
|
|
38
38
|
* values, so a period change moves the key and a colour pick or a Visible
|
|
39
39
|
* flip does not. Declaration order, each name once; empty without rows.
|
|
40
|
+
*
|
|
41
|
+
* It reads the rows as handed over, on every key the stand-in builds: a
|
|
42
|
+
* caller holding a framework's reactive view hands over the plain objects
|
|
43
|
+
* (the web stand-in reads Vue's raw rows), since a row read through such a
|
|
44
|
+
* view comes back wrapped in a proxy of its own.
|
|
40
45
|
*/
|
|
41
46
|
export function wrunTwinComputeInputNames(settings) {
|
|
42
47
|
const rows = isRecord(settings) && Array.isArray(settings.scriptInputs) ? settings.scriptInputs : [];
|
|
@@ -49,9 +54,11 @@ export function wrunTwinComputeInputNames(settings) {
|
|
|
49
54
|
continue;
|
|
50
55
|
if (typeof row.type !== 'string' || !WRUN_TWIN_COMPUTE_ROW_TYPES.has(row.type))
|
|
51
56
|
continue;
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
if (row.type === 'select' &&
|
|
58
|
+
Array.isArray(row.options) &&
|
|
59
|
+
row.options.some((value) => !Number.isFinite(Number(value)))) {
|
|
54
60
|
continue;
|
|
61
|
+
}
|
|
55
62
|
names.add(name);
|
|
56
63
|
}
|
|
57
64
|
return [...names];
|
|
@@ -177,6 +177,15 @@ export type WrunVisibilityRule = {
|
|
|
177
177
|
prefix: string;
|
|
178
178
|
kinds: Readonly<Record<string, WrunVisibilityKindRule | 'not-drawn'>>;
|
|
179
179
|
};
|
|
180
|
+
/**
|
|
181
|
+
* The section kinds the chart draws ahead of the kit release that lists them (the rule of
|
|
182
|
+
* wrun-section-kinds.util: a new kind is drawn before the kit bump lands), none while the kit lists every kind the
|
|
183
|
+
* chart draws. This table and WRUN_CHART_SECTION_DRAWS hold them beside the kit's union, and their specs read the
|
|
184
|
+
* kit's runtime list plus these; the bump whose kit lists a kind takes it out of here (the visibility spec fails
|
|
185
|
+
* until it does).
|
|
186
|
+
*/
|
|
187
|
+
export declare const WRUN_SECTION_KINDS_AHEAD_OF_KIT: readonly [];
|
|
188
|
+
export type WrunSectionKindAheadOfKit = (typeof WRUN_SECTION_KINDS_AHEAD_OF_KIT)[number];
|
|
180
189
|
/** THE table, in Style page order (its key order is the order a sheet's targets are offered). */
|
|
181
190
|
export declare const WRUN_VISIBILITY_RULES: Readonly<{
|
|
182
191
|
readonly outputs: {
|
|
@@ -366,6 +375,10 @@ export declare const WRUN_VISIBILITY_RULES: Readonly<{
|
|
|
366
375
|
readonly prefix: "rays";
|
|
367
376
|
readonly group: "skip";
|
|
368
377
|
};
|
|
378
|
+
readonly flags: {
|
|
379
|
+
readonly prefix: "flags";
|
|
380
|
+
readonly group: "skip";
|
|
381
|
+
};
|
|
369
382
|
readonly strategy: "not-drawn";
|
|
370
383
|
readonly presentation: "not-drawn";
|
|
371
384
|
readonly stats_strip: "not-drawn";
|
|
@@ -48,6 +48,14 @@ export const WRUN_HANDLE_KIND_RULES = Object.freeze({
|
|
|
48
48
|
label: { group: 'drawing' },
|
|
49
49
|
polyline: { group: 'drawing' },
|
|
50
50
|
});
|
|
51
|
+
/**
|
|
52
|
+
* The section kinds the chart draws ahead of the kit release that lists them (the rule of
|
|
53
|
+
* wrun-section-kinds.util: a new kind is drawn before the kit bump lands), none while the kit lists every kind the
|
|
54
|
+
* chart draws. This table and WRUN_CHART_SECTION_DRAWS hold them beside the kit's union, and their specs read the
|
|
55
|
+
* kit's runtime list plus these; the bump whose kit lists a kind takes it out of here (the visibility spec fails
|
|
56
|
+
* until it does).
|
|
57
|
+
*/
|
|
58
|
+
export const WRUN_SECTION_KINDS_AHEAD_OF_KIT = Object.freeze([]);
|
|
51
59
|
/** THE table, in Style page order (its key order is the order a sheet's targets are offered). */
|
|
52
60
|
export const WRUN_VISIBILITY_RULES = Object.freeze({
|
|
53
61
|
outputs: { prefix: '', kinds: WRUN_OUTPUT_PLOT_RULES },
|
|
@@ -66,6 +74,7 @@ export const WRUN_VISIBILITY_RULES = Object.freeze({
|
|
|
66
74
|
marks: { prefix: 'marks', group: 'skip' },
|
|
67
75
|
spans: { prefix: 'spans', group: 'skip' },
|
|
68
76
|
rays: { prefix: 'rays', group: 'skip' },
|
|
77
|
+
flags: { prefix: 'flags', group: 'skip' },
|
|
69
78
|
strategy: 'not-drawn',
|
|
70
79
|
presentation: 'not-drawn',
|
|
71
80
|
stats_strip: 'not-drawn',
|