Skip to main content

Custom fields

This article describes Rest API fields and flags that can help you customize some UI elements.

Account Summary tab

The Account Summary tab represents a table with information about the current state of the account. By default, only one table with the Balance, Equity, and Unrealized P/L fields is displayed. However, you can configure the number of tables and their rows and columns in two ways:

  • Using the accountManager object in the /config endpoint. In this case, the configuration is applied to all accounts.
  • Using the uiaccountManager object in the /accounts endpoint. In this case, the configuration is applied to a particular account. Note that this way takes precedence over the first one.

To add custom data to the table, use the amData field of the /state endpoint.

The image below demonstrates custom fields in the Account Summary tab.

Account Summary tab with custom fields

Account Summary row

The Account Summary row contains information about the current state of the account. By default, the Balance, Equity, and Unrealized P/L indicators with their corresponding values are displayed.

To enable the Account Summary row customization, set supportCustomAccountSummaryRow: true in the config object of the /accounts endpoint.

You can configure the indicators in two ways:

  • Using the accountSummaryRow object in the /config endpoint. In this case, the configuration is applied to all accounts.
  • Using the uiaccountSummaryRow object in the /accounts endpoint. In this case, the configuration is applied to a particular account. Note that this way takes precedence over the first one.

To add custom data to indicators, use the accountSummaryRowData field of the /state endpoint.

The image below demonstrates the custom Total account balance field in the Account Summary row.

Account Summary row with custom field

Positions, Orders, and Order History tabs

Custom fields in the Positions, Orders, and Order History tabs display additional information about positions and orders in the corresponding tabs in the bottom widget.

To enable these tabs customization, set supportPositionCustomFields, supportOrderCustomFields, and supportOrderHistoryCustomFields to true in the config object of the /accounts endpoint.

You can configure custom fields for these tabs in two ways:

  • Using the positionCustomFields/orderCustomFields/orderHistoryCustomFields object in the /config endpoint. In this case, the configuration is applied to all accounts.
  • Using the uipositionCustomFields/orderCustomFields/orderHistoryCustomFields object in the /accounts endpoint. In this case, the configuration is applied to a particular account. Note that this way takes precedence over the first one.

To add custom data, use the /positions, /orders, and /ordersHistory endpoints respectively.

The images below demonstrate the custom fields in the Positions, Orders, and Order History tabs.

Positions tab with custom field

Order Ticket

Custom fields in the Order Ticket allow sending additional information about order placement. Custom field values should be sent along with standard field values in the /placeOrder request.

info

All custom field values are received in /orders and /positions responses. Therefore, you first need to configure Orders and Positions custom fields.

You can configure the Order Ticket custom fields in two ways:

  • Using the uiorderDialogCustomFields object in the /accounts endpoint for all instruments available for trading on this account.
  • Using the uiorderDialogCustomFields object in the /instruments endpoint for a particular instrument. Note that this way takes precedence over the first one.

The image below demonstrates the custom Product field in the Order Ticket.

Order Ticket with custom field

Standard value for combo box

The selection of values in the combo box depends on two flags:

  • forceUserEnterInitialValue: prevents a user from placing an order unless the item in combobox was explicitly selected
  • saveToSettings: the user's selection will persist between sessions

By default, the combobox selects the first item specified in the list of possible values. Therefore, the first item will be used in the request to place an order with forceUserEnterInitialValue: set to false by default.

note

Saved selection applies only to a particular symbol. Order ticket will display default behavior for symbols that the user has not yet selected.