Sessions and units
param.session declares a window on the 24-hour clock in its zone, and unit on a number puts a unit picker in the field.
What it is
param.session(name, "HH:MM-HH:MM", { tz }) declares a window on the
24-hour clock and the zone it is written in. A window may wrap midnight
("22:00-04:00"). Per bar, inSession(...) says whether the bar's open
sits inside the window, with daylight saving applied per bar from the
zone's own rule.
unit: ["price", "ticks", "%", "atr"] on a number puts a unit picker in
the field, listing the units in your order; unit_default names the one
picked at first (the first listed when absent). unitToPrice(...) then
turns the number into a price distance per bar.
Declare it
// session: a window in its zone.
param.session("rth", "09:30-16:00", { tz: "America/New_York", label: "Active hours" });
// number with a unit picker: the value and the unit's code.
param.number("offset", 0.0, { min: -100, max: 100, unit: ["price", "ticks", "%", "atr"], unit_default: "%" });
// A bounded int drawn as a slider: the ATR an atr-unit offset scales by.
param.int("atr_length", 14, { min: 2, max: 50, slider: true, label: "ATR length" });
// The tick size, written by the chart into a hidden setting.
market.tick_size();tz is param.session only: the zone the window is written in, one of
these, each with its own daylight-saving rule:
| Index | tz | Standard offset | Daylight saving (one hour ahead) |
|---|---|---|---|
| 0 | UTC (the default) | UTC+0 | none |
| 1 | America/ | UTC-5 | second Sunday of March to first Sunday of November |
| 2 | America/Chicago | UTC-6 | second Sunday of March to first Sunday of November |
| 3 | Europe/London | UTC+0 | last Sunday of March to last Sunday of October |
| 4 | Europe/Berlin | UTC+1 | last Sunday of March to last Sunday of October |
| 5 | Asia/Tokyo | UTC+9 | none |
| 6 | Asia/Hong_Kong | UTC+8 | none |
| 7 | Asia/Singapore | UTC+8 | none |
| 8 | Australia/ | UTC+10 | first Sunday of October to first Sunday of April |
| 9 | Asia/Kolkata | UTC+5:30 | none |
| 10 | America/ | UTC-8 | second Sunday of March to first Sunday of November |
| 11 | America/Toronto | UTC-5 | second Sunday of March to first Sunday of November |
| 12 | America/ | UTC-6 | none |
| 13 | America/ | UTC-3 | none |
| 14 | America/ | UTC-3 | none |
| 15 | Europe/Paris | UTC+1 | last Sunday of March to last Sunday of October |
| 16 | Europe/ | UTC+1 | last Sunday of March to last Sunday of October |
| 17 | Europe/Zurich | UTC+1 | last Sunday of March to last Sunday of October |
| 18 | Europe/Madrid | UTC+1 | last Sunday of March to last Sunday of October |
| 19 | Europe/Rome | UTC+1 | last Sunday of March to last Sunday of October |
| 20 | Europe/ | UTC+1 | last Sunday of March to last Sunday of October |
| 21 | Europe/Oslo | UTC+1 | last Sunday of March to last Sunday of October |
| 22 | Europe/ | UTC+1 | last Sunday of March to last Sunday of October |
| 23 | Europe/Warsaw | UTC+1 | last Sunday of March to last Sunday of October |
| 24 | Europe/Helsinki | UTC+2 | last Sunday of March to last Sunday of October |
| 25 | Europe/Athens | UTC+2 | last Sunday of March to last Sunday of October |
| 26 | Europe/Istanbul | UTC+3 | none |
| 27 | Europe/Moscow | UTC+3 | none |
| 28 | Asia/Jerusalem | UTC+2 | Friday before the last Sunday of March to last Sunday of October |
| 29 | Asia/Riyadh | UTC+3 | none |
| 30 | Asia/Dubai | UTC+4 | none |
| 31 | Africa/ | UTC+2 | none |
| 32 | Asia/Karachi | UTC+5 | none |
| 33 | Asia/Bangkok | UTC+7 | none |
| 34 | Asia/Jakarta | UTC+7 | none |
| 35 | Asia/ | UTC+7 | none |
| 36 | Asia/ | UTC+8 | none |
| 37 | Asia/Shanghai | UTC+8 | none |
| 38 | Asia/Taipei | UTC+8 | none |
| 39 | Asia/Manila | UTC+8 | none |
| 40 | Asia/Seoul | UTC+9 | none |
| 41 | Pacific/ | UTC+12 | last Sunday of September to first Sunday of April |
The dialog shows each zone by its city (SESSION_TZ_LABELS: New York,
Kolkata, Sao Paulo, ...). The list only grows at its end: a saved
setting stores the index p_<name>_tz() reads, so the first nine never
move and a new zone is appended. A tz outside the list refuses the build
and names every id.
unit and unit_default belong to one number field (int, number,
price): a range's two ends have no unit picker. market.tick_size()
declares the tick size as a hidden setting the host writes before
onStart(); market.price_precision() does the same for the price
decimals, and market.zone() for the market's own time zone as an index
into this same list (Chart context says who fills what).
What the dialog draws
Read it in onStart()
A session is three readers: p_<name>_start() and p_<name>_end()
(minutes from midnight) and p_<name>_tz() (the zone's index). The index
is what p_<name>_tz() reads and what inSession takes;
SESSION_TZ_IDS and SESSION_TZ_LABELS hold the ids and the dialog's
words in the same order. The rules are compiled into the module, so a
session reads the same in your browser, on OpenMarket's servers and in
an alert. The bar's open is bar.time()
(Time and sessions).
A unit pick reaches the module as a code that never changes with the
order you list: price 0, ticks 1, % 2, atr 3, read through
p_<name>_unit() beside p_<name>(). The tick size is read through
p_market_tick_size(), the price decimals through
p_market_price_precision().
function onStart(): void {
offset = p_offset();
offsetUnit = i32(p_offset_unit());
atr = new Atr(i32(p_atr_length()));
tick = p_market_tick_size();
sessionStart = p_rth_start();
sessionEnd = p_rth_end();
zone = i32(p_rth_tz());
}Per bar, inSession(barOpenSec, startMin, endMin, zone) answers whether
the bar's open sits inside the window, and unitToPrice(value, unit, close, tick, atr) turns the number into a price distance: ticks
multiplies by the tick size, % takes that percent of close, atr
multiplies by the ATR you pass, and price is the value as it is.
const atrValue = atr.update(bar.high(), bar.low(), close);
// The offset in the unit the dialog picked, as a price distance.
if (isFinite(basis)) basis += unitToPrice(offset, offsetUnit, close, tick, atrValue);
active = inSession(t, sessionStart, sessionEnd, zone) && multiHas(dayMask, weekday);Chart context
Numbers about the chart and its market reach your file before the first
bar: the bar interval, the price decimals, the tick size, the chart's
colours, and the market's kind, point value, time zone, quote currency
(The market's facts) and the minute its trade day
opens (Venue trade day). Declare the ones you need at
the top level and read them in onStart(). Wherever the indicator runs, it
gets the numbers that place can know, and 0 for the rest.
// A close line with a corner readout of the three facts the host writes before the first bar.
chart.interval_sec();
market.price_precision();
market.tick_size();
output("close_line", line, overlay, { color: "#94a3b8" });
string("facts", { max_bytes: 96 });
render.table("corner", { rows: 1, cols: 1, cells: ["facts"], position: "top_left" });
let intervalSec: f64 = 0;
let decimals: i32 = 0;
let tick: f64 = 0;
function onStart(): void {
intervalSec = p_chart_interval_sec();
decimals = i32(p_market_price_precision());
tick = p_market_tick_size();
}
function onBar(): void {
const close = bar.close();
if (isNaN(close)) return;
out_close_line(close);
sb_clear();
sb_text("bar ");
// 0 means the host did not fill the fact.
if (intervalSec > 0) sb_duration(intervalSec); else sb_text("unknown");
sb_text(", close ");
sb_f64(close, decimals);
sb_text(tick > 0 ? ", tick known" : ", tick unknown");
str_facts_sb();
}On a 15-minute BTC chart the readout says bar 15m, the close at the
chart's own decimals, and tick unknown.
Who fills what
| Declare | Read with | On the chart | On OpenMarket's servers and in alerts | Where there is no chart |
|---|---|---|---|---|
chart. | p_ | the bar interval in seconds (a 15-minute chart reads 900) | the chart's number, carried with the indicator | the interval of the bars it runs on |
market. | p_ | the chart's price decimals | the chart's number | the most decimals the market's candle prices carry, at most 10; 0 when it reads no candles of that market |
market. | p_ | the market's tick where the market publishes one (CME markets), else 0 | the chart's number | 0, until market data carries tick sizes |
chart. | i32( | the background colour, packed | the chart's number | 0 |
chart. | i32( | the text colour, packed | the chart's number | 0 |
market. | i32( | what the chart's market trades | the chart's number | what the market directory says the market trades |
market. | p_ | the money one point of price is worth on one contract | the chart's number | 1 for a market priced per unit (a coin, a perpetual, a stock), 0 on a CME futures market, whose multiplier is not known there |
market. | i32( | the market's exchange time zone | the chart's number | New York for US stocks, indices and forex, Chicago for CME, London for the London metals, else 0 (UTC) |
market. | i32( | whether prices are in US dollars | the chart's number | from the market's quote currency |
market. | p_ | the minute the market's trade day opens on its clock | yes: the hosted worker, the registry and Enterprise select the wrun8 pair (@openmarket/ 5.24.0, 2026-10-13) | 1020 on CME futures (17:00 Chicago) and on forex (17:00 New York), else 0 (midnight) |
- Read 0 as "unknown".
unitToPriceleaves a ticks value as it is when the tick is 0, and aBucketrefuses its span when the interval is 0. The zone and the session open are the exceptions: the zone's 0 is UTC and the session open's 0 is midnight, also where either is unknown. - These are hidden settings: the settings dialog never shows them, and the number the host writes always wins over anything passed under the same name.
- Each one counts toward the 128 settings.
The interval and the colours
// The bar interval and the chart's two colours, written by the chart into hidden settings.
chart.interval_sec();
chart.bg_color();
chart.fg_color();chart.interval_sec()is the chart's bar interval in seconds, read throughp_chart_interval_sec()and available from the first bar (a 15-minute chart reads 900); 0 only when the interval is unknown.chart.bg_color()is the chart's background, a custom background included, andchart.fg_color()is the chart's text colour, each as the packed colour the colours kit uses ((r << 24) | (g << 16) | (b << 8) | aas a signed 32-bit integer, so white reads-1). Read them withi32(p_chart_bg_color())andi32(p_chart_fg_color()); 0 means unavailable.
function onStart(): void {
intervalSec = p_chart_interval_sec();
bg = i32(p_chart_bg_color());
fg = i32(p_chart_fg_color());
}The text colour is the theme's, not the background's: on a custom
background it may not contrast with the background. Choose ink from the
background's brightness instead: red(bg), green(bg) and blue(bg)
read its channels, and Read a color back
draws dark words on a light chart and light words on a dark one. Treat
fg_color as the theme's hint.
The market's facts
// What the market trades, its point value, its time zone and its quote, written by the host into hidden settings.
market.kind();
market.point_value();
market.zone();
market.quote_is_usd();Each is a number, and 0 means the host does not know:
| Declare | Reads | Values |
|---|---|---|
market.kind() | i32( | 1 crypto, 2 a stock or an ETF, 3 forex, 4 a metal, 5 an index, 6 an economic series; 0 unknown, or none of these (a prediction market, an oil contract) |
market. | p_ | the money one whole point of price is worth on one contract: a futures multiplier (50 on the E-mini S&P), 1 on a market priced per unit (a coin, a perpetual, a stock); 0 unknown |
market.zone() | i32( | the market's exchange time zone as its index in the zone list above (1 New York, the clock of US stocks and forex, 2 Chicago, 3 London); 0 is UTC, also where the zone is unknown |
market. | i32( | 1 when prices are in US dollars, 2 in another currency or coin (USDT and USDC included: BTCUSDT is priced in USDT), 0 unknown |
market. | p_ | the minute of the day, on the market's clock, at which its trade day opens: 1020 (17:00) on CME futures and on forex, 0 (midnight) on every other market and where it is unknown (Venue trade day) |
- A futures market reports what it trades: an index future reads 5, a gold future 4.
- A stock that trades around the clock on a crypto venue reads 2 and its venue's zone, UTC.
- The codes never change: a new kind is added at the end of the list.
- The zone is an index, not an offset: pass it to
inSession(...)ornew Clock(SESSION_TZ_IDS[zone])and each bar gets its own daylight-saving offset. market.size_unit()andmarket.notional()declare the facts the size helpers read, so one file counts and prices a size on every market (Size units).
// A listed stock's regular hours on its own exchange clock: the close drawn only between 09:30 and 16:00 there, every bar on a market that trades around the clock.
market.kind();
market.zone();
market.point_value();
market.quote_is_usd();
output("session_close", line, overlay, { color: "#2962ff" });
output("point_value_usd", line, lower, { color: "#94a3b8" });
let kind: i32 = 0;
let zone: i32 = 0;
let pointValue: f64 = 0;
let inDollars = false;
function onStart(): void {
kind = i32(p_market_kind());
// 0 is UTC, also where the host does not know the zone.
zone = i32(p_market_zone());
pointValue = p_market_point_value();
inDollars = i32(p_market_quote_is_usd()) == 1;
}
function onBar(): void {
const close = bar.close();
// A stock (kind 2) on an exchange clock keeps its hours, 09:30 (minute 570) to 16:00 (minute 960);
// zone 0 is a venue that trades around the clock (a stock perpetual), or an unknown zone.
const open = kind != 2 || zone == 0 || inSession(bar.time(), 570, 960, zone);
out_session_close(open ? close : NaN);
// A one-point move on one contract, in dollars where the market is priced in them.
out_point_value_usd(inDollars && pointValue > 0 ? pointValue : NaN);
}On a US stock the line breaks outside New York's regular hours, daylight saving included, and the lower pane reads 1. On BTCUSDT, and on a stock perpetual that trades around the clock, the line runs through every bar; on BTCUSDT the lower pane stays empty, since the price is in USDT.
Venue trade day
A CME futures trade date does not start at midnight UTC: it opens at 17:00
Chicago the evening before the date it is stamped with, and its week opens
on Sunday at 17:00. A forex trade date (gold and silver on FX_OTC
included) opens the same way at 17:00 New York, and its week opens on
Sunday at 17:00 New York. Declare market.session_open() beside
market.zone(), read both in onStart(), and the same four helpers place
any bar in its trade day, so a daily or weekly anchor lands where the
exchange's does.
// The market's clock and the minute its trade day opens, written by the host into hidden settings.
market.zone();
market.session_open();| Helper | Answers |
|---|---|
session | the time, in epoch seconds, at which the trade day holding t opened |
session | that trade day's date as days since 1970-01-01 (times 86400 is its 00:00 UTC stamp) |
session | the time the trading week holding t opened: the open of its Monday trade date |
session | true when the bar at t sits in another trade day than the bar at prevT |
t is a bar's open time (bar.time()), zone is i32(p_market_zone())
and openMin is p_market_session_open().
- An open past 12:00 stamps the next date: on CME a bar from 17:00 Chicago on belongs to tomorrow's trade date, so Monday's trade date, and the week, open on Sunday at 17:00.
- Where the trade day opens at midnight on UTC (crypto), the helpers
return the UTC day and the UTC week from Monday: the same numbers as
Math.floor(t / 86400) * 86400, to the bit. - Daylight saving follows the zone: the CME open stays at 17:00 on the Chicago clock in summer and in winter, and the forex open at 17:00 on the New York clock (21:00 UTC in summer, 22:00 UTC in winter).
- There is no holiday calendar: a weekday holiday's session keeps its own date.
sessionGapBeforeistrueon the first bar of each trade day: after the daily break and the weekend on CME, at 17:00 New York on forex, after every UTC midnight on a market that trades around the clock. It isfalsewhenprevTisNaN, as on the first bar.
A session VWAP that restarts at the exchange's trade day: 17:00 Chicago on CME, 17:00 New York on forex, midnight UTC on crypto.
market.zone();
market.session_open();
output("session_vwap", line, overlay, { color: "#f59e0b" });
let zone: i32 = 0;
let openMin: f64 = 0;
let dayOpen: f64 = NaN;
let pv: f64 = 0;
let vol: f64 = 0;
function onStart(): void {
zone = i32(p_market_zone());
openMin = p_market_session_open();
}
function onBar(): void {
const open = sessionDayOpen(bar.time(), zone, openMin);
if (open != dayOpen) {
// A new trade day: the sums restart.
dayOpen = open;
pv = 0;
vol = 0;
}
const typical = (bar.high() + bar.low() + bar.close()) / 3;
pv += typical * bar.volume();
vol += bar.volume();
out_session_vwap(vol > 0 ? pv / vol : NaN);
}On E-mini S&P futures (ES) with hourly bars, around the switch to daylight time on 2026-03-08 (Chicago is UTC-6 before it, UTC-5 after):
| Bar opens (Chicago) | Trade date | Trade day opened | Week opened | New trade day |
|---|---|---|---|---|
| Fri 03-06 14:00 | 2026-03-06 | Thu 03-05 17:00 | Sun 03-01 17:00 | |
| Sun 03-08 17:00 | 2026-03-09 | Sun 03-08 17:00 | Sun 03-08 17:00 | yes, after the weekend |
| Mon 03-09 10:00 | 2026-03-09 | Sun 03-08 17:00 | Sun 03-08 17:00 | no |
| Tue 03-10 15:00 | 2026-03-10 | Mon 03-09 17:00 | Sun 03-08 17:00 | no |
| Tue 03-10 17:00 | 2026-03-11 | Tue 03-10 17:00 | Sun 03-08 17:00 | yes, after the daily break |
On BTCUSDT the same file restarts at 00:00 UTC every day.
Size units
A bar's volume and a trade's size count coins on a crypto pair, shares on a
stock and contracts on a futures market. Declare market.size_unit() and
two helpers name the unit and turn any size into money, so one file labels
and prices a size right on every market without checking the exchange.
// The facts the size helpers read, written by the host into hidden settings.
market.size_unit();
market.notional();Neither word adds a setting of its own. market.size_unit() declares
market.kind(), market.point_value() and market.zone();
market.notional() declares market.point_value() and market.zone(). A
fact two words name is declared once. Read the facts in onStart() and
pass them per bar:
| Helper | Answers |
|---|---|
sizeUnit(kind, pointValue, zone) | the unit the market counts its size in, as a code below |
notional(qty, price, pointValue, zone) | what qty of that size is worth at price, in the market's quote currency: qty * price * pointValue, or NaN on a CME market whose multiplier is not known |
kind is i32(p_market_kind()), pointValue is p_market_point_value()
and zone is i32(p_market_zone()).
| Code | Label | The market |
|---|---|---|
| 0 | units | none of the rules below holds: forex, a metal, an index, an economic series, a market the host does not know |
| 1 | coins | a crypto kind |
| 2 | shares | a stock or an ETF |
| 3 | contracts | a futures market |
The first rule that holds decides the code:
- Contracts when the point value is a contract multiplier, a positive number other than 1 (50 on ES, 5 on MES), or the zone is Chicago (2), the clock only CME futures keep.
- Coins when the kind is crypto (1).
- Shares when the kind is a stock or an ETF (2).
- Units, code 0, otherwise.
- The contracts rule comes first: CME bitcoin futures trade a coin (kind
- and still count contracts.
notionalnever prints a wrong number. On the Chicago zone a point value of 0 or 1 is a multiplier the host does not hold (a CME option on the chart, every CME market where there is no chart), so it returnsNaNand a money view stays empty. The cost: a CME contract whose multiplier really is 1 readsNaNtoo.- Off the Chicago zone a point value of 0 means the host does not know it,
and
notionalmultiplies by 1. - The codes never change: a new unit is added at the end of the list. The
kit exports the codes and their labels as
WRUN_MARKET_SIZE_UNITSandWRUN_MARKET_SIZE_UNIT_LABELS, so the chart shows the same words.
| Market | kind, point value, zone | sizeUnit | A size in money |
|---|---|---|---|
| ES (E-mini S&P 500 futures) | 5, 50, 2 | 3, contracts | 2 contracts at 6000: notional(2, 6000, 50, 2) is 600000 |
| ES where the host does not hold its multiplier | 5, 0, 2 | 3, contracts | notional(2, 6000, 0, 2) is NaN |
| BTCUSDT perpetual | 1, 1, 0 | 1, coins | 0.5 BTC at 60000: notional(0.5, 60000, 1, 0) is 30000 (USDT) |
| AAPL | 2, 1, 1 | 2, shares | 100 shares at 230: notional(100, 230, 1, 1) is 23000 |
A volume pane in money on every market, with the unit its size counts in:
market.size_unit();
output("volume_money", histogram, lower, { color: "#26a69a" });
output("size_unit", none, lower);
let unit: i32 = 0;
let pointValue: f64 = 0;
let zone: i32 = 0;
function onStart(): void {
pointValue = p_market_point_value();
zone = i32(p_market_zone());
unit = sizeUnit(i32(p_market_kind()), pointValue, zone);
}
function onBar(): void {
out_volume_money(notional(bar.volume(), bar.close(), pointValue, zone));
out_size_unit(f64(unit));
}On ES a bar of 2 contracts at 6000 reads 600000 and size_unit reads 3;
on BTCUSDT a bar of 0.5 BTC at 60000 reads 30000 and size_unit reads 1.
Where the host does not hold ES's multiplier the money pane stays empty
and size_unit still reads 3.
The dialog and the lanes
Three words hand the size unit to the host, for what the module cannot change by itself: which rows the settings dialog and the chart show, the unit a volume lane is read in, and which markets fetch an input at all. None reaches the module: the build keeps them in the sheet and compiles the same bytes without them.
| Word | On | What the host does |
|---|---|---|
visible_by: { size_unit: [codes] } | a typed setting (param.<kind>) or an output(...) | shows the row only on markets whose size unit is listed. Elsewhere the settings dialog leaves the setting out (its value still reaches onStart()), and the chart mounts nothing for the output: no plot, no legend entry, no stats row that reads it. The module still computes every output. |
currency: "Auto" | a trades.* or volume_ input | reads the lane in contracts (what "Coin" reads) on a market whose size unit is contracts (3), and in dollars ("USD") on every other market. |
needed_by: { size_unit: [codes] } | a secondary scalar feed input(...) (scaffold 72) or a secondary tape.cells input (scaffold 95) | fetches the input's lane only on markets whose size unit is listed. Elsewhere nothing is asked for it and the input reads its fill on every bar (NaN, 0 under missing: "zero", NaN under "carry"; a tape reads zero prints), never holding the run. Without the word the input is needed everywhere. |
// Liquidations exist on crypto venues: no toggle and no row on futures.
param.bool("show_liq", true, { label: "Liq", visible_by: { size_unit: [0, 1, 2] } });
output("liq", histogram, lower, { visible_by: { size_unit: [0, 1, 2] } });
// One profile lane beside the candles: contracts on futures, dollars everywhere else.
input("close", ohlcv.close);
input("profile", volume_profile.cells, { max_cells: 8192, ticks_per_bar: 5, currency: "Auto" });
// The liquidations lane only where the row can show: never asked on futures.
input("liq", liquidations.liquidations, { side: "BUY", missing: "nan", needed_by: { size_unit: [0, 1, 2] } });On ES the dialog has no Liq toggle, the chart draws no Liq row, no liquidations are fetched and the profile counts contracts; on BTCUSDT all three show and the profile is in dollars.
- The codes are the size units above, 0 units, 1 coins, 2 shares and 3 contracts: at least one, each once. A setting's derived rows (a range's two ends, a session's three parts, a unit picker) hide with it.
visible_bybelongs to typed settings and outputs. Oninput(...), plainparam(...), a stats row or any other declaration it is refused by name; a stats row hides with the output it reads.needed_bybelongs to a secondary scalar feed input, a published feed (series.value) included, and to a secondarytape.cellsinput: on the first input (its rows are the grid every market needs), atime.*input, every other celled<class>.cellsinput and a metric composition it is refused by name. Two tapes with different floors can split the markets between them, a dollar floor on coins and shares and a contracts floor on futures (Large prints): each keeps its own floor, judged on every run. Give a row that only reads such an input the same list as itsvisible_by, so a market that hides the row never fetches its data. Anis_new_periodview on a pin equal to the chart's interval still reads 1 there: it asks nothing on any market."Auto"follows the market the indicator runs on. On an input pinned to another market it is refused: name the unit,"USD"or"Coin".- Every host resolves
"Auto"the same way, where it plans the lane's fetch: it takes the market's size unit from the facts it holds (the point value and the zone decide contracts) and reads"Coin"on 3,"USD"on anything else, a host that knows no facts included. The kit exports the three rules for hosts:wrunLaneCurrency(currency, sizeUnit),wrunVisibleOnMarket(visibleBy, sizeUnit, setting)andwrunNeededOnMarket(neededBy, sizeUnit, setting), wheresettingiswrunKeyedSettingReader(params, sizeUnit, read)(below).
Keyed by a choice. A typed setting's visible_by and a tape's
needed_by may name one param.choice of the file beside size_unit,
with the option indexes it holds under. The two keys hold together:
visible_by: { size_unit: [1], min_unit: [1] } shows the row on coin
markets while min_unit picks its second choice
(A tape picked by a setting).
size_unitstays required, and one choice at most stands beside it.- The choice keys its own row by the size unit alone. Where that row is hidden it reads its default: a stock chart that saved Coins reads Dollars. The module still receives the saved value.
- An undeclared name, a setting that is no
param.choice, an index the choice lacks, a second choice, a choice keyed by another choice and the row itself are refused by name. - An output's
visible_byand a scalar feed'sneeded_bykeep the size unit alone.
| Host | currency: "Auto" | visible_by | needed_by |
|---|---|---|---|
| The chart | resolved on the chart's market | the dialog and the chart's rows follow it | the lane is fetched only where the chart's market is listed; a tape off the list reads zero prints |
| OpenMarket's servers and alerts | resolved from the market facts the chart sends (point value and zone; missing facts read dollars); the servers select the wrun10 pair, wrun9 since 2026-10-13 | admitted: the servers compute every output and the chart hides the rows | the lane is fetched only where the facts the chart sends (kind, point value and zone) list the market's size unit (wrun10, selected 2026-10-14); Enterprise requests still ask the lane on every market until that executor fills skipped inputs; a tape's needed_by is refused by name (source.) until a head admits it |
| Where there is no chart | resolved from the venue tables: only CME futures read contracts there, and no CME rows are read there, so every lane served reads dollars | nothing changes: metric reads, watches and previews read every output | the input reads its fill where the market's size unit is not listed (the market's facts decide it); a tape off the list is never subscribed and reads zero prints |
| A host on an older kit | before scaffold 69: refused by name | before scaffold 69: the row shows on every market | before scaffold 72: the sheet check drops the word and the lane is asked on every market, so the input reads the lane's data there too; only the build refuses it by name, as an unknown input option. Before scaffold 95 the sheet check refuses it on a tape by name |
Gotchas
- A tick size or an ATR of 0 means unavailable, and
unitToPricethen leaves the value as it is. - A unit picker on a range is refused:
param.range 'r' takes no unit option (a unit picker sits beside one number field, not a range). - A session counts as three settings and a
unitlist as one more toward the 128-setting cap (Picks, lanes, the cap). - A preset sets a session or a unit through its parts (
rth_start,offset_unit, by the dialog's words for a session zone or a unit) (Presets). - A window fixed in the file needs no setting: it is a
Session(Clock and sessions kit). market.size_unit()andmarket.notional()are declarations: they take no arguments and stand at the top level. Per bar, callsizeUnit(...)andnotional(...)with the facts read inonStart().visible_byhides a row; it never stops a value. A package that has no number to show on a market writesNaNthere itself, and the hidden row keeps the dialog and the chart free of an empty line.