Bentrix Docs
HomePricingDashboard

JavaScript: zone

Every method of client.zone in the JavaScript SDK.

barsInZone#

Read a market's candles in any time zone · tool bars_in_zone

scope: readplan: freesince 3.12.0

Answers a workbench's candles of one market and interval read and cut in a time zone of the caller's choosing, without changing what the screen shows: a day opens at that zone's midnight, a week at its Monday, H4 on its grid — folded from the workbench's own finer candles (H1, or M30/M15 for a half- or quarter-hour zone), up to the cursor and never past it. Rows are time_ms (the workbench's own stamps), zone_time (the bar's open in that zone), open, high, low, close, tick_volume; newest limit (200 when omitted, at most 2000), oldest first. An interval the zone does not move is read as it is.

Declaration

client.zone
barsInZone(args: { bench: string; symbol: string; timeframe: string; zone: string; limit?: number }): Promise<any>

Parameters

NameTypeWhat it is
benchstringrequiredThe workbench's uri.
symbolstringrequiredOne of the workbench's markets.
timeframestringrequiredThe interval, as the menu writes it (H4, D1, W1…).
zonestringrequiredThe zone to read and cut in: a code from zones_list, an IANA name, system, or display (the workbench's charts' zone).
limitnumberoptionalThe newest bars kept, 200 when omitted, at most 2000.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers a workbench's candles of one market and interval read and cut in a time zone of the caller's choosing, without changing what the screen shows: a day opens at that zone's midnight, a week at its Monday, H4 on its grid — folded from the workbench's own finer candles (H1, or M30/M15 for a half- or quarter-hour zone), up to the cursor and never past it.

Example

await client.zone.barsInZone({ bench, symbol: "SYN-DOCS", timeframe: "H1", zone: "…" })

benchSetDisplayZone#

Set a workbench's charts' time zone · tool bench_set_display_zone

scope: labplan: freesince 3.12.0

Sets the time zone a workbench's charts are read in and their candles cut in, as a press on the clock's charts' face does: every chart of the workbench follows; its venue, strategies and swap keep the workbench's own clock. Default puts the workbench's own zone (or its broker's) back. Answers the zone.

Declaration

client.zone
benchSetDisplayZone(args: { bench: string; zone: string }): Promise<any>

Parameters

NameTypeWhat it is
benchstringrequiredThe workbench's uri, as get_state gives it.
zonestringrequiredA zone's code from zones_list, an IANA name, system (this computer's), or default (the workbench's own zone, or its broker's).

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers the zone.

Example

await client.zone.benchSetDisplayZone({ bench, zone: "…" })

chartSetZone#

Set one chart's own time zone · tool chart_set_zone

scope: labplan: freesince 3.12.0

Sets one chart's own time zone, as its settings' Time zone row does: its times read and its candles cut in it, a preview of that chart alone — the workbench's other charts and the clock as they were. Default reads it as its workbench again. Answers the chart's zone.

Declaration

client.zone
chartSetZone(args: { chart: string; zone: string }): Promise<any>

Parameters

NameTypeWhat it is
chartstringrequiredThe chart's uri.
zonestringrequiredA zone's code from zones_list, an IANA name, system, or default (as its workbench).

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers the chart's zone.

Example

await client.zone.chartSetZone({ chart, zone: "…" })

clockRead#

Read the clock · tool clock_read

scope: readplan: freesince 3.12.0

Answers the clock window as it reads the selected workbench: each clock it shows (market: the broker's or the laboratory's zone; computer: this computer's; charts: the workbench's display zone) with its time, region and offset; the workbench's display zone, chosen or default; and the clock's own settings (which clocks, face, hours, parts, sections, desks, band, glow window, close-together line).

Declaration

client.zone
clockRead(): Promise<any>

It takes no arguments.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers the clock window as it reads the selected workbench: each clock it shows (market: the broker's or the laboratory's zone; computer: this computer's; charts: the workbench's display zone) with its time, region and offset; the workbench's display zone, chosen or default; and the clock's own settings (which clocks, face, hours, parts, sections, desks, band, glow window, close-together line).

Example

await client.zone.clockRead()

clockSettingsSet#

Change the clock's settings · tool clock_settings_set

scope: labplan: freesince 3.12.0

Changes the clock window's own settings, as its gear's window does — the fields given laid over the rest. Answers the settings.

Declaration

client.zone
clockSettingsSet(args: { settings: unknown }): Promise<any>

Parameters

NameTypeWhat it is
settingsunknownrequiredFields of the clock's settings laid over what they are now (clock_read's settings): market, computer, charts, computer_time (replay_moment | real_now), face (analog | analog_and_digital | digital), hours (h24 | h12), seconds_hand, millis, date, week, zone_line, markets, candles, progress, holidays, desks (a bit each: Sydney 1, Tokyo 2, London 4, New York 8), band, warn (off | s10 | s30 | m1), together.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers the settings.

Example

await client.zone.clockSettingsSet({ settings: "…" })

zonesList#

List every time zone · tool zones_list

scope: readplan: freesince 3.12.0

Answers every time zone Bentrix offers, in the order its lists show them: system (this computer's), the important ones (UTC, New York close, New York, London, Tokyo, Chicago, Frankfurt, Eastern Europe, Dubai, Singapore, Hong Kong, Sydney), every zone of the IANA database and the fixed offsets — each its code (what the other zone tools take), label, region, offsets across the year and offset now. Search narrows them.

Declaration

client.zone
zonesList(args: { search?: string }): Promise<any>

Parameters

NameTypeWhat it is
searchstringoptionalOnly the zones whose code or name holds this text (case does not matter).

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers every time zone Bentrix offers, in the order its lists show them: system (this computer's), the important ones (UTC, New York close, New York, London, Tokyo, Chicago, Frankfurt, Eastern Europe, Dubai, Singapore, Hong Kong, Sydney), every zone of the IANA database and the fixed offsets — each its code (what the other zone tools take), label, region, offsets across the year and offset now.

Example

await client.zone.zonesList()

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed