Skip to main content

Configuring

Configuration levels

There are three configuration levels.

  • Broker level applies to all sub-accounts defined for the user. It's performed via the /config request.
  • Sub-account level extends to UI elements for a specific sub-account. It's performed via the /accounts request.
  • Instrument level uses to configure UI elements for a specific instrument. It's performed via the /instruments request.

All these requests are executed once when logging into the broker integration. The configuration priority of the same UI elements is as follows: broker, account, instrument. Each subsequent configuration overrides the previous one.

Sub-account types

To ensure proper platform behavior and data adaptation for various use cases, user accounts can be divided into the following sub-account types:

Instrument-specific sub-accounts

Sub-accounts can be allocated for different asset types. For example, one sub-account is used for stock trading, another for cryptocurrencies. In this case, API responses will differ in:

These differences reflect unique instrument lists and configurations per asset type.

Another common scenario: instruments can be of the same type but differ by region. This separation can also be implemented through sub-accounts. For example, one sub-account is used for U.S. stocks trading, another for European stocks. The /instruments response will vary accordingly to reflect the region-specific instruments available for trading.

Type-specific sub-accounts

Sub-accounts can also differ by account type:

  • One sub-account is demo, and another is live.
  • This distinction is reflected in the /accounts response through the type parameter of each sub-account.

Multiple currencies per account

Users may have sub-accounts with different base currencies (e.g., EUR, USD, JPY, etc.). In this case:

  • The /accounts response will differ in currency and currencySign parameters.
  • The /instruments response will differ in pipValue — since pip value must be presented in the account’s currency.
note

The sub-account types above are just examples - their separation depends on how the broker structures them. For any unclear cases, please reach out to the TradingView team.

Pulling intervals

Pulling intervals are designed to determine the frequency of requests to a specific endpoint. They are configurable at the broker level only. Consider the infrastructure when configuring the intervals to avoid dropping connections on the broker's side.

Warning

If the pulling interval is set above the maximum value, it will be reduced to the required maximum value on the TradingView side. Make sure your server can support the maximum pulling interval values without any issues. Otherwise, the integration stability will be affected.

Matching fields to requests:

  • quotes — the /quotes and /depth requests (max 1000ms)
  • accountManager — the /state request (max 1500ms)
  • orders — the /orders request (max 1000ms)
  • positions — the /positions request (max 1500ms)
  • balances — the /balances request (max 1500ms)

Pulling interval values directly affect how quickly users see the integration updates (i.e actions with orders and positions, quotes and balances updates, etc.). The lower the values are, the faster the integration UI is being updated.

note

To comply with the cross-origin security model, all modern browsers send Pre-flight requests to get permission to send the main request. You can make use of Access-Control-Max-Age header in Pre-flight response, in order for the browser to make the permission last longer than the default 5 seconds. This may help to reduce the number of requests and shorten the delay in updating data between the user and your server.