@orangecharts/wrun-chart-host 0.9.0 → 0.10.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 +6 -1
- package/dist/constants/feature-flags.constants.js +67 -24
- package/dist/constants/opra-compliance.constants.d.ts +3 -2
- package/dist/constants/opra-compliance.constants.js +3 -2
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
- package/dist/constants/venue-presets.constants.d.ts +20 -20
- package/dist/constants/venue-presets.constants.js +24 -26
- package/dist/host-env.d.ts +29 -5
- package/dist/host-env.js +6 -0
- package/dist/host-ports.types.d.ts +69 -15
- package/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
- package/dist/interfaces/replay.interface.d.ts +8 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +41 -4
- package/dist/kscript-data/controls/live-trades-merge.util.js +52 -7
- package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +56 -0
- package/dist/kscript-data/controls/live-trades-order-gate.util.js +107 -0
- package/dist/market-data/billing.interface.d.ts +95 -31
- package/dist/market-data/billing.interface.js +36 -5
- package/dist/market-data/venue.d.ts +88 -6
- package/dist/market-data/venues/cme.contract.copy.json +66 -0
- package/dist/market-data/venues/cme.d.ts +126 -0
- package/dist/market-data/venues/cme.js +133 -0
- package/dist/market-data/venues/index.d.ts +162 -5
- package/dist/market-data/venues/index.js +48 -6
- package/dist/settings-templates/index.js +7 -3
- package/dist/settings-templates/indicator-fields.d.ts +5 -4
- package/dist/settings-templates/indicator-fields.js +45 -6
- package/dist/settings-templates/tool-rules.d.ts +27 -17
- package/dist/settings-templates/tool-rules.js +27 -11
- package/dist/settings-templates/tool-tables.generated.js +91 -31
- package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
- package/dist/utility/chart/book-live-bucket.util.js +47 -0
- package/dist/utility/chart/index-mode-admission.util.js +15 -2
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +7 -2
- package/dist/utility/chart/kscript-live-coalesce.util.js +9 -3
- package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +54 -35
- package/dist/utility/chart/kscript-venue-policy.util.js +78 -42
- package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
- package/dist/utility/chart/market-session-schedule.util.js +16 -0
- package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
- package/dist/utility/chart/opra-read-access.leaf.js +5 -3
- package/dist/utility/chart/rth-session.util.d.ts +3 -2
- package/dist/utility/chart/rth-session.util.js +2 -1
- package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
- package/dist/utility/chart/window-geometry.leaf.js +22 -6
- package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
- package/dist/utility/chart/wrun-run-result.util.js +141 -6
- package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
- package/dist/utility/options/option-bar-anchor.util.js +340 -0
- package/dist/utility/options/option-venue.util.d.ts +18 -0
- package/dist/utility/options/option-venue.util.js +27 -0
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
- package/dist/utility/wrun/derived-roots.util.d.ts +213 -0
- package/dist/utility/wrun/derived-roots.util.js +471 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +41 -6
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
- package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
- package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +39 -10
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +64 -0
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +89 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +174 -13
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +685 -27
- package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
- package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +53 -12
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +101 -53
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
- package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
- package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
- package/dist/utility/wrun/wrun-frames.d.ts +27 -6
- package/dist/utility/wrun/wrun-frames.js +73 -10
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
- package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
- package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +13 -7
- package/dist/utility/wrun/wrun-live-intake.util.js +82 -29
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +158 -14
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +49 -10
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +65 -5
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
- package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
- package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
- package/dist/utility/wrun/wrun-option-views.util.d.ts +47 -13
- package/dist/utility/wrun/wrun-option-views.util.js +98 -26
- package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-output-style.util.js +20 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +17 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +100 -31
- package/dist/utility/wrun/wrun-overlay-run.util.js +733 -114
- package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +63 -13
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
- package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
- package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
- package/dist/utility/wrun/wrun-param-map.util.js +10 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
- package/dist/utility/wrun/wrun-param-values.util.js +4 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +12 -11
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
- package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
- package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-run-interval.util.js +9 -6
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
- package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
- package/dist/utility/wrun/wrun-socket-row-source.js +113 -8
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +5 -1
- package/dist/utility/wrun/wrun-source-rows.util.js +16 -3
- package/dist/utility/wrun/wrun-style-words.util.js +6 -4
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
- package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-tape-per-order.util.js +26 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
- package/dist/utils/replay/replay-buffer-math.js +227 -20
- package/package.json +11 -11
|
@@ -7,12 +7,15 @@
|
|
|
7
7
|
* (tests/utility/wrun/sources/option_strike_flow.boot-path.spec.ts). The class: docs/features/kscript/wrun/
|
|
8
8
|
* wrun-browser-runtime.md.
|
|
9
9
|
*/
|
|
10
|
-
import { wrunOptionFlowBarBeforeToday } from './wrun-option-contract-flow.util.js';
|
|
10
|
+
import { WRUN_OPTION_CONTRACT_FLOW_SESSION_ROWS, wrunOptionFlowBarBeforeToday } from './wrun-option-contract-flow.util.js';
|
|
11
11
|
import { wrunPresentIsPartial, wrunPresentWithPartial } from './wrun-present-bits.util.js';
|
|
12
12
|
const MINUTE_MS = 60_000;
|
|
13
13
|
const DAY_MS = 86_400_000;
|
|
14
14
|
/** The class, its lane key and its K type word (om `WRUN_OPTION_FETCH_TYPES.option_strike_flow`). */
|
|
15
15
|
export const WRUN_OPTION_STRIKE_FLOW_CLASS = 'option_strike_flow';
|
|
16
|
+
/** The ask field a budgeted run names a browser fold's contract-row cap in (FE-FOLD-CAP, OPTLOAD W3 under R2's flag;
|
|
17
|
+
* wrun-row-lanes.util `download.fold`, the worker's `wrunOptionStrikeFlowFoldPlan` `budgetRows`). */
|
|
18
|
+
export const WRUN_OPTION_STRIKE_FLOW_FOLD_BUDGET_FIELD = 'foldBudgetRows';
|
|
16
19
|
/** f64s per tuple, the `present` mask included (om `WRUN_OPTION_TUPLE_WIDTHS.option_strike_flow`). */
|
|
17
20
|
export const WRUN_OPTION_STRIKE_FLOW_WIDTH = 15;
|
|
18
21
|
/** The tuple's columns (om `WRUN_OPTION_CELL_COLUMNS.option_strike_flow`). */
|
|
@@ -110,19 +113,40 @@ export function wrunOptionStrikeFlowHorizon(extras, nowMs) {
|
|
|
110
113
|
return undefined;
|
|
111
114
|
return { servedFromMs: nowMs - reach, completeFromMs: nowMs - reach };
|
|
112
115
|
}
|
|
113
|
-
/** The tuples one SPY bar of a group holds (one 30-minute session of 13 bars measured 2026-10-19): STRIKE 357
|
|
114
|
-
* the 0DTE split), EXPIRY 75, the per-(expiry, strike) rows 2,326; 33 traded expiries
|
|
116
|
+
/** The tuples one SPY bar of a group holds (one 30-minute session of 13 bars measured 2026-10-19, `barMs`): STRIKE 357
|
|
117
|
+
* (471 with the 0DTE split), EXPIRY 75, the per-(expiry, strike) rows 2,326; 33 traded expiries; every chain. */
|
|
115
118
|
export const WRUN_OPTION_STRIKE_FLOW_BAR_TUPLES = Object.freeze({
|
|
116
119
|
strike: 357,
|
|
117
120
|
strikeSplit: 471,
|
|
118
121
|
expiry: 75,
|
|
119
122
|
expiryStrike: 2_326,
|
|
120
123
|
expiries: 33,
|
|
124
|
+
barMs: 30 * MINUTE_MS,
|
|
121
125
|
});
|
|
122
|
-
/** The
|
|
123
|
-
|
|
126
|
+
/** The share of a measured bar's tuples a bar `barMs` wide holds, 1 from 30 minutes up: a bar's distinct contracts grow
|
|
127
|
+
* slower than its width, as the contract rows one SPY bucket holds at the 1m, 5m and 1h tiers say
|
|
128
|
+
* (`WRUN_OPTION_CONTRACT_FLOW_SESSION_ROWS`: 647, 1,395 and 4,148), read on the log-log line between neighbouring
|
|
129
|
+
* tiers: a 5-minute bar 0.46, a 1-minute bar 0.21, where a straight sixth and thirtieth under-projected them. */
|
|
130
|
+
export function wrunOptionStrikeFlowBarShare(barMs) {
|
|
131
|
+
const measured = WRUN_OPTION_STRIKE_FLOW_BAR_TUPLES.barMs / MINUTE_MS;
|
|
132
|
+
const minutes = barMs / MINUTE_MS;
|
|
133
|
+
if (!(minutes > 0 && minutes < measured))
|
|
134
|
+
return 1;
|
|
135
|
+
const R = WRUN_OPTION_CONTRACT_FLOW_SESSION_ROWS;
|
|
136
|
+
// A bucket's rows, in proportion: its tier's rows a session times its minutes.
|
|
137
|
+
const rowsAt = (m) => {
|
|
138
|
+
const [m0, r0, m1, r1] = m < 5 ? [1, R['1m'], 5, 5 * R['5m']] : [5, 5 * R['5m'], 60, 60 * R['1h']];
|
|
139
|
+
return r0 * (m / m0) ** (Math.log(r1 / r0) / Math.log(m1 / m0));
|
|
140
|
+
};
|
|
141
|
+
return rowsAt(Math.max(1, minutes)) / rowsAt(measured);
|
|
142
|
+
}
|
|
143
|
+
/** The tuples a bar `barMs` wide of one acquisition is projected to hold, from its knobs over SPY's measured bars at
|
|
144
|
+
* its share of them (`wrunOptionStrikeFlowBarShare`). One width for all kept a 5-minute Strike Footprint to its newest
|
|
145
|
+
* 30 bars. The row budget's proxy, which the host raises to what the lane's reads measured. */
|
|
146
|
+
export function wrunOptionStrikeFlowTuplesPerBar(acquisition, barMs = WRUN_OPTION_STRIKE_FLOW_BAR_TUPLES.barMs) {
|
|
124
147
|
const knobs = wrunOptionStrikeFlowPayloadKnobsOf(acquisition);
|
|
125
148
|
const T = WRUN_OPTION_STRIKE_FLOW_BAR_TUPLES;
|
|
149
|
+
const share = wrunOptionStrikeFlowBarShare(barMs);
|
|
126
150
|
const sides = knobs.foldTypes ? 1 : 2;
|
|
127
151
|
const parts = knobs.splitDte ? 2 : 1;
|
|
128
152
|
const nearest = wrunOptionStrikeFlowExpiriesOf(knobs.expiries);
|
|
@@ -130,26 +154,38 @@ export function wrunOptionStrikeFlowTuplesPerBar(acquisition) {
|
|
|
130
154
|
const windowShare = knobs.strikeWindowPct !== undefined ? Math.min(1, knobs.strikeWindowPct / 25) : 1;
|
|
131
155
|
switch (knobs.group) {
|
|
132
156
|
case 'expiry':
|
|
133
|
-
return Math.ceil(T.expiry * expiryShare);
|
|
157
|
+
return Math.ceil(T.expiry * expiryShare * share);
|
|
134
158
|
case 'expiry_strike': {
|
|
135
|
-
const cells = T.expiryStrike * expiryShare * windowShare;
|
|
159
|
+
const cells = T.expiryStrike * expiryShare * windowShare * share;
|
|
136
160
|
const rows = knobs.strikeRows !== undefined ? knobs.strikeRows * 2 * Math.ceil(T.expiries * expiryShare) : Infinity;
|
|
137
161
|
return Math.ceil(Math.min(cells, rows));
|
|
138
162
|
}
|
|
139
163
|
default: {
|
|
140
164
|
const all = ((knobs.splitDte ? T.strikeSplit : T.strike) * sides) / 2;
|
|
141
165
|
const rows = knobs.strikeRows !== undefined ? knobs.strikeRows * sides * parts : Infinity;
|
|
142
|
-
return Math.ceil(Math.min(all * windowShare, rows));
|
|
166
|
+
return Math.ceil(Math.min(all * windowShare * share, rows));
|
|
143
167
|
}
|
|
144
168
|
}
|
|
145
169
|
}
|
|
146
|
-
/** The
|
|
147
|
-
*
|
|
170
|
+
/** The facets' `maxCells`: the package's most `max_cells` of the class (tuples, `WrunRowLanePlanFacts.laneMaxCells`)
|
|
171
|
+
* where it is under the knobs' projection. A bar past it refuses the run, so no bar is projected past it. */
|
|
172
|
+
export function wrunOptionStrikeFlowMaxCellsField(acquisition, laneMaxCells) {
|
|
173
|
+
return typeof laneMaxCells === 'number' &&
|
|
174
|
+
laneMaxCells >= 1 &&
|
|
175
|
+
laneMaxCells < wrunOptionStrikeFlowTuplesPerBar(acquisition)
|
|
176
|
+
? { maxCells: laneMaxCells }
|
|
177
|
+
: {};
|
|
178
|
+
}
|
|
179
|
+
/** The rows one host bar is projected to read (the lane's row budget; wrun-row-lanes.util `wrunRowLaneProjectedBarRows`
|
|
180
|
+
* raises it to what its reads measured): its projected tuples at its width, at most the acquisition's `maxCells`, none
|
|
181
|
+
* for a bar before today's first instant as the acquisition names it under `history` "today" (it reads nothing;
|
|
148
182
|
* wrun-option-contract-flow.util `wrunOptionFlowBarBeforeToday`, never dated off `nowMs`). */
|
|
149
183
|
export function wrunOptionStrikeFlowBarRows(bar, _nowMs, acquisition) {
|
|
150
184
|
if (wrunOptionFlowBarBeforeToday(bar, acquisition))
|
|
151
185
|
return 0;
|
|
152
|
-
|
|
186
|
+
const tuples = wrunOptionStrikeFlowTuplesPerBar(acquisition, bar.endMs - bar.openMs);
|
|
187
|
+
const most = acquisition.maxCells;
|
|
188
|
+
return typeof most === 'number' && most >= 1 ? Math.min(tuples, most) : tuples;
|
|
153
189
|
}
|
|
154
190
|
/** Every finite tuple a host bar row's cells hold, in order: a packed block's tuples back to back, a plain tuple as it
|
|
155
191
|
* is. A cell of another shape, and a tuple holding a value that is not finite, is skipped. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type LiveBucketVenue } from '../chart/live-bucket.util.js';
|
|
2
|
+
import { type OptionBarAnchorRead } from '../options/option-bar-anchor.util.js';
|
|
2
3
|
import { type OptionTradeDateChain, type OptionTradeDateClockRule } from '../options/option-trade-date.util.js';
|
|
3
4
|
import { type WrunOptionContractFlowRow } from './wrun-option-contract-flow.util.js';
|
|
4
5
|
import { type WrunOptionStrikeFlowGroup, type WrunOptionStrikeFlowKnobs } from './wrun-option-strike-flow-lane.util.js';
|
|
@@ -14,16 +15,21 @@ export declare const WRUN_OPTION_STRIKE_FLOW_DTE_CLASS: Readonly<{
|
|
|
14
15
|
}>;
|
|
15
16
|
/** `strike_rows`: 1 to 200 (om `WRUN_OPTION_STRIKE_ROWS_MAX`). */
|
|
16
17
|
export declare const WRUN_OPTION_STRIKE_ROWS_MAX = 200;
|
|
17
|
-
/** The scope word of each group (pb-common `OptionPrintAggScope` STRIKE 5, EXPIRY 6, EXPIRY_STRIKE 7)
|
|
18
|
+
/** The scope word of each group (pb-common `OptionPrintAggScope` STRIKE 5, EXPIRY 6, EXPIRY_STRIKE 7) and the read its
|
|
19
|
+
* grouped ask is, as the gateway registers the anchors it takes (option-bar-anchor.util). */
|
|
18
20
|
export declare const WRUN_OPTION_STRIKE_FLOW_SCOPE: Readonly<Record<WrunOptionStrikeFlowGroup, {
|
|
19
21
|
word: string;
|
|
20
22
|
id: number;
|
|
23
|
+
read: OptionBarAnchorRead;
|
|
21
24
|
}>>;
|
|
22
|
-
/** pb-common enums the request names by number (the gateway decodes JSON with encoding/json): `BarAnchor
|
|
23
|
-
* `OptionExpiryClass`, `OptionDteBucket`, `OptionType`. */
|
|
25
|
+
/** pb-common enums the request names by number (the gateway decodes JSON with encoding/json): `BarAnchor` (the anchor
|
|
26
|
+
* mirror's values, option-bar-anchor.util), `BarSpan`, `OptionExpiryClass`, `OptionDteBucket`, `OptionType`. */
|
|
24
27
|
export declare const WRUN_OPTION_READ_ENUM: Readonly<{
|
|
25
|
-
readonly anchorUtc:
|
|
26
|
-
readonly anchorUsEquityRth:
|
|
28
|
+
readonly anchorUtc: import("@orangecharts/orange-v2-pb-common").BarAnchor.UTC;
|
|
29
|
+
readonly anchorUsEquityRth: import("@orangecharts/orange-v2-pb-common").BarAnchor.US_EQUITY_RTH;
|
|
30
|
+
readonly anchorCmeSession: import("@orangecharts/orange-v2-pb-common").BarAnchor.CME_SESSION;
|
|
31
|
+
readonly anchorCmeRth: import("@orangecharts/orange-v2-pb-common").BarAnchor.CME_RTH;
|
|
32
|
+
readonly anchorCmeEnergyRth: import("@orangecharts/orange-v2-pb-common").BarAnchor.CME_ENERGY_RTH;
|
|
27
33
|
readonly spanSession: 1;
|
|
28
34
|
readonly expiryZeroDte: 1;
|
|
29
35
|
readonly expiryAfterToday: 2;
|
|
@@ -72,6 +78,9 @@ export interface WrunOptionStrikeFlowAcquisition extends WrunOptionStrikeFlowKno
|
|
|
72
78
|
/** Today's first instant as the request names it under `history` "today" (wrun-option-contract-flow.util
|
|
73
79
|
* `WRUN_OPTION_FLOW_TODAY_FIELD`: the K control's, off the chart's newest bar). */
|
|
74
80
|
todayFromMs?: number;
|
|
81
|
+
/** FE-FOLD-CAP (OPTLOAD W3, under R2's flag): the most contract rows the ask's browser fold reads, its share of the
|
|
82
|
+
* indicator's download budget (`WRUN_OPTION_STRIKE_FLOW_FOLD_BUDGET_FIELD`); absent, the source answer budget's. */
|
|
83
|
+
foldBudgetRows?: number;
|
|
75
84
|
}
|
|
76
85
|
/** The bars an ask names (both flow classes' K controls send them, option-flow-bars.util): the run's bar span and the
|
|
77
86
|
* chart's bar grid, each absent when the ask carries none. */
|
|
@@ -90,14 +99,18 @@ export declare function wrunOptionFlowClockOf(acquisition: {
|
|
|
90
99
|
coin: string;
|
|
91
100
|
}): OptionTradeDateClockRule;
|
|
92
101
|
/**
|
|
93
|
-
* How a read's rows group, on the gateway's bar rule (contract 3.2 and 3.4
|
|
102
|
+
* How a read's rows group, on the gateway's bar rule (contract 3.2 and 3.4: the anchor mirror, option-bar-anchor.util)
|
|
103
|
+
* or the chart's own landing:
|
|
94
104
|
* - `bars`: `barSeconds` on an anchor (UTC: `ts - ts % B`; US_EQUITY_RTH: the 09:30 New York lattice, buckets outside
|
|
95
|
-
* the cash session dropped
|
|
105
|
+
* the cash session dropped; CME_RTH and CME_ENERGY_RTH: a CME regular session's lattice, 09:30 to 16:15 or 09:00 to
|
|
106
|
+
* 14:30 New York, buckets outside it dropped), exactly the chart's bars;
|
|
96
107
|
* - `session`: one group per trade date: on a New York clock the regular session's (RTH buckets only, stamped at its
|
|
97
|
-
* 09:30 open), on a UTC clock the UTC date's (stamped 00:00Z)
|
|
108
|
+
* 09:30 open), on a UTC clock the UTC date's (stamped 00:00Z), on the Globex clock of a CME group venue the trade
|
|
109
|
+
* date's (CME_SESSION: every bucket of it, stamped at its 17:00 Chicago open, a weekday holiday's session booked to
|
|
110
|
+
* the next trade date);
|
|
98
111
|
* - `host`: the chart's own bars (`wrunHostBarOf`) or, with a session span on a clock the gateway draws no session
|
|
99
|
-
* for (a CME
|
|
100
|
-
* cannot draw, so they are folded in the browser.
|
|
112
|
+
* for (a CME crypto root's 16:00 roll, or a read naming no venue), the clock's trade dates stamped at each date's
|
|
113
|
+
* first instant: groups the gateway cannot draw, so they are folded in the browser.
|
|
101
114
|
*/
|
|
102
115
|
export type WrunOptionFlowGrouping = {
|
|
103
116
|
kind: 'bars';
|
|
@@ -111,13 +124,18 @@ export type WrunOptionFlowGrouping = {
|
|
|
111
124
|
session: boolean;
|
|
112
125
|
};
|
|
113
126
|
/**
|
|
114
|
-
* The grouping of one ask's window `[fromMs, toMs)` at a tier
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
127
|
+
* The grouping of one ask's window `[fromMs, toMs)` at a tier, from the anchors `read` takes on the read's venue
|
|
128
|
+
* (`exchange`, the chain's; a decider naming none is offered no CME anchor, as the gateway lays those over the CME
|
|
129
|
+
* group's rows alone): a session span groups by trade date (the anchor whose sessions are the clock's trade dates, from
|
|
130
|
+
* a tier its sessions fit), else a chart bar of a day reads its trade date's session where that session lands on it (a
|
|
131
|
+
* daily bar holding one New York regular session, the cash session's buckets alone, one UTC date, or one Globex trade
|
|
132
|
+
* date), else the chart's bars when the gateway's bars are exactly them (every tier bucket of the window lands on the
|
|
133
|
+
* host bar the gateway's bar opens on: the UTC floor; the 09:30 New York lattice of a regular-session stock chart's 45m
|
|
134
|
+
* to 12h bars, the tier dividing 30 minutes, a bucket outside the cash session reaching no bar on either side; a CME
|
|
135
|
+
* regular session's lattice on a regular-hours CME chart, the tier dividing that anchor's (15 minutes on CME_RTH, 30 on
|
|
136
|
+
* CME_ENERGY_RTH), the window on its boundaries, a bucket the anchor drops reaching no bar or falling where the chart's
|
|
137
|
+
* product holds no trading, option-bar-anchor.util `optionChartClosedAt`: a weekday product's weekend, never an
|
|
138
|
+
* always-on root's), else the chart's own bars, folded in the browser.
|
|
121
139
|
*/
|
|
122
140
|
export declare function wrunOptionFlowGrouping(args: {
|
|
123
141
|
barMs: number | undefined;
|
|
@@ -127,7 +145,49 @@ export declare function wrunOptionFlowGrouping(args: {
|
|
|
127
145
|
toMs: number;
|
|
128
146
|
session: boolean;
|
|
129
147
|
clock: OptionTradeDateClockRule;
|
|
148
|
+
/** The read's venue, the chain's exchange: every app caller names it (tests/utility/options/
|
|
149
|
+
* option-bar-anchor.class.spec.ts), so a CME chart's anchors reach every grouped read. */
|
|
150
|
+
exchange?: string;
|
|
151
|
+
/** The read the grouping is for (the strike scopes' when absent). */
|
|
152
|
+
read?: OptionBarAnchorRead;
|
|
130
153
|
}): WrunOptionFlowGrouping;
|
|
154
|
+
/**
|
|
155
|
+
* The grouping of one ask and the tier its grouped read rides (OPTLOAD W3 FE-ANCHOR): the ask's own tier wherever the
|
|
156
|
+
* gateway groups the window there (a session at the group's 30-minute view where that holds the window,
|
|
157
|
+
* `wrunOptionFlowGroupedTier`), else the coarsest of the read's tiers (`tiers`) finer than the ask's, dividing it and
|
|
158
|
+
* still holding the window's start, at which the chart's bars ARE an anchor's bars. A regular-hours CME chart's hours
|
|
159
|
+
* ride the 30-minute tier (their 13:30Z opens sit on it), which CME_RTH's 16:15 close does not divide (the gateway takes
|
|
160
|
+
* CME_RTH from tiers dividing 15 minutes alone), so they group from 5 minutes. Else `host`, at the ask's tier.
|
|
161
|
+
*/
|
|
162
|
+
export declare function wrunOptionFlowGroupedRead(args: {
|
|
163
|
+
barMs: number | undefined;
|
|
164
|
+
barGrid: LiveBucketVenue | undefined;
|
|
165
|
+
fromMs: number;
|
|
166
|
+
toMs: number;
|
|
167
|
+
session: boolean;
|
|
168
|
+
clock: OptionTradeDateClockRule;
|
|
169
|
+
exchange?: string;
|
|
170
|
+
read?: OptionBarAnchorRead;
|
|
171
|
+
/** The tier the lane asked. */
|
|
172
|
+
askTier: WrunBackendTier;
|
|
173
|
+
/** The read's tiers (the group's, `WRUN_OPTION_STRIKE_FLOW_TIERS`). */
|
|
174
|
+
tiers: readonly WrunBackendTier[];
|
|
175
|
+
/** The group's 30-minute view a session reads. */
|
|
176
|
+
sessionTier: WrunBackendTier;
|
|
177
|
+
nowMs: number;
|
|
178
|
+
}): {
|
|
179
|
+
grouping: WrunOptionFlowGrouping;
|
|
180
|
+
tier: WrunBackendTier;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* The window a grouped read of `[fromMs, toMs)` sends: on a session grouping the window widened to its anchor's session
|
|
184
|
+
* boundaries (the gateway refuses any other window; a CME trade date a weekday holiday's session is booked into opens
|
|
185
|
+
* at that session's open), else the window itself (a bar grouping was proved on it, its edges on the bars).
|
|
186
|
+
*/
|
|
187
|
+
export declare function wrunOptionFlowGroupingWindow(grouping: WrunOptionFlowGrouping, fromMs: number, toMs: number): {
|
|
188
|
+
fromMs: number;
|
|
189
|
+
toMs: number;
|
|
190
|
+
};
|
|
131
191
|
/**
|
|
132
192
|
* The widest UTC groups a read of `[fromMs, toMs)` at a tier may be summed or picked to so that its answer lands on the
|
|
133
193
|
* chart exactly as the tier's buckets do, where the chart's bars themselves are no grouping the gateway draws (an RTH
|
|
@@ -151,8 +211,9 @@ export declare function wrunOptionNestedUtcBars(args: {
|
|
|
151
211
|
barSeconds: number;
|
|
152
212
|
barAnchor: number;
|
|
153
213
|
} | undefined;
|
|
154
|
-
/** The trade-date group a bucket stamped `ts` sums into under the gateway's session (contract 3.4
|
|
155
|
-
* date's 09:30 open for a bucket inside the cash session (null outside it), on UTC
|
|
214
|
+
/** The trade-date group a bucket stamped `ts` sums into under the gateway's session on an anchor (contract 3.4, the
|
|
215
|
+
* anchor mirror): on RTH the New York date's 09:30 open for a bucket inside the cash session (null outside it), on UTC
|
|
216
|
+
* the UTC date's 00:00Z, on CME_SESSION the 17:00 Chicago open of the trade date's first session day. */
|
|
156
217
|
export declare function wrunOptionFlowSessionStampMs(ts: number, barAnchor: number): number | null;
|
|
157
218
|
/**
|
|
158
219
|
* The stamp of the group a bucket stamped `ts` sums into, on the browser's side of a grouping (the fold's): the
|
|
@@ -341,6 +402,10 @@ export type WrunOptionStrikeFlowFoldRead = WrunTierSegment;
|
|
|
341
402
|
* bars. A newest bar that cannot fit alone is skipped (a forming day read from minutes); from the first bar that fits,
|
|
342
403
|
* a bar that would pass the budget stops the walk. The kept bars are read per run of one tier (`reads`); every asked
|
|
343
404
|
* bar outside them is partial. `newerBarOpens` are the host bars after the ask, up to the clock.
|
|
405
|
+
*
|
|
406
|
+
* FE-FOLD-CAP (OPTLOAD W3, under R2's flag): `budgetRows` (the ask's `foldBudgetRows`, its share of the indicator's
|
|
407
|
+
* download budget in contract rows) caps the walk below the source answer budget; absent, the answer budget's 49,932
|
|
408
|
+
* rows a read, today's plan. `projectedRows` is what the kept bars are projected to read.
|
|
344
409
|
*/
|
|
345
410
|
export declare function wrunOptionStrikeFlowFoldPlan(args: {
|
|
346
411
|
barOpens: readonly number[];
|
|
@@ -349,11 +414,13 @@ export declare function wrunOptionStrikeFlowFoldPlan(args: {
|
|
|
349
414
|
barGrid: LiveBucketVenue | undefined;
|
|
350
415
|
nowMs: number;
|
|
351
416
|
acquisition: Readonly<Record<string, unknown>>;
|
|
417
|
+
budgetRows?: number;
|
|
352
418
|
}): {
|
|
353
419
|
reads: WrunOptionStrikeFlowFoldRead[];
|
|
354
420
|
partialBars: number[];
|
|
355
421
|
keptFromMs: number;
|
|
356
422
|
keptToMs: number;
|
|
423
|
+
projectedRows: number;
|
|
357
424
|
};
|
|
358
425
|
/** The host bars `[fromMs, toMs)` holds on the chart's grid, ascending (`liveBucketStartsInRange` over the grid). */
|
|
359
426
|
export declare function wrunOptionFlowHostBars(fromMs: number, toMs: number, barMs: number, barGrid: LiveBucketVenue | undefined): number[];
|