Bentrix Docs
HomePricingDashboard

JavaScript: market watch

Every method of client.marketwatch in the JavaScript SDK.

add#

Add a market to a real account's Market Watch · tool marketwatch_add

scope: realplan: freesince 1.0.0

Adds a market of the broker's list to a real account's Market Watch, as its + does; the first market of an empty account is charted on the selected workbench. Answers the account's markets.

Declaration

client.marketwatch
add(args: { account: string; symbol: string }): Promise<any>

Parameters

NameTypeWhat it is
accountstringrequiredThe account's uri, as get_state gives it: bentrix://account/<id>.
symbolstringrequiredThe broker's own name of the market.

Returns

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

What it answers

Answers the account's markets.

Example

await client.marketwatch.add({ account, symbol: "SYN-DOCS" })

hide#

Hide a market from a real account's Market Watch · tool marketwatch_hide

scope: realplan: freesince 1.0.0

Takes a market off a real account's Market Watch, as a row's Hide does; MetaTrader's own Market Watch is untouched. Answers the account's markets.

Declaration

client.marketwatch
hide(args: { account: string; symbol: string }): Promise<any>

Parameters

NameTypeWhat it is
accountstringrequiredThe account's uri, as get_state gives it: bentrix://account/<id>.
symbolstringrequiredThe broker's own name of the market.

Returns

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

What it answers

Answers the account's markets.

Example

await client.marketwatch.hide({ account, symbol: "SYN-DOCS" })

setView#

Set Market Watch's view · tool marketwatch_set_view

scope: labplan: plussince 1.0.0

Chooses Market Watch's columns, its sort and its filter, as its column chooser, its headers and its search do; and which list it shows (a workbench's markets) with that list's order, filters and refresh, as its switch and controls do. Answers the view.

Declaration

client.marketwatch
setView(args: { base_market?: boolean; board_sort?: string; collect?: boolean; columns?: string[]; every_s?: number; filter?: string; opens_in?: string; reset_columns?: boolean; sort?: string; traded_only?: boolean; view?: string }): Promise<any>

Parameters

NameTypeWhat it is
base_marketbooleanoptionalThe exchange list: the base market's rows too.
board_sortstringoptionalThe exchange list's order: symbol, last, change, volume or trades, as a header press.
collectbooleanoptionalThe analysis desk's evening collection of every share that traded, on or off.
columnsstring[]optionalThe columns shown, in Market Watch's own names (bid, ask, spread, change, high, low, time,...), in their order.
every_snumberoptionalThe exchange list's refresh while the exchange trades, in seconds: 2, 5, 10, 30 or 60.
filterstringoptionalThe table's filter text.
opens_instringoptionalWhere a row's press shows its market: own_chart or chart_in_front.
reset_columnsbooleanoptionalBack to the default columns.
sortstringoptionalSorted by symbol or by a column's name, as a header press; the same again reverses it.
traded_onlybooleanoptionalThe exchange list: only what traded today.
viewstringoptionalWhich list it shows: workbench.

Returns

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

What it answers

Answers the view.

Example

await client.marketwatch.setView()

symbolInfo#

A market's contract · tool symbol_info

scope: readplan: freesince 1.0.0

The contract a workbench's venue prices a market under — contract size, point, volume limits, the swap and the basis of its point value — as Market Watch's Specification shows it. Read only.

Declaration

client.marketwatch
symbolInfo(args: { bench: string; symbol: string }): Promise<any>

Parameters

NameTypeWhat it is
benchstringrequiredThe workbench's uri.
symbolstringrequired

Returns

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

What it answers

Recorded from a running Bentrix 0.1.382 on a laboratory of generated markets (long lists cut to their first rows):

{
  "contract_size": 100000.0,
  "point": 1e-05,
  "point_value_basis": "ContractTimesPoint",
  "swap": "None",
  "symbol": "SYN-DOCS",
  "volume_max": 100.0,
  "volume_min": 0.01,
  "volume_step": 0.01
}

Example

await client.marketwatch.symbolInfo({ bench, symbol: "SYN-DOCS" })

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