Skip to main content
Version: latest

AccountManagerInfo

Interface
Types Module: Broker

The information object that is used to build the Account Manager.

Properties

accountTitle

Name of the broker

Type

string


customFormatters

Optional

An optional array for defining custom formatters. Each formatter description is an object with the following fields:

  • name (FormatterName): Unique formatter name.

  • formatText (TableFormatTextFunction): Function that is used for formatting a cell value to a string. The formatText field is required because it is used to generate exported data. You can return an empty string if you do not need this function.

  • formatElement (CustomTableFormatElementFunction | undefined): Optional function that is used for formatting a cell value to a string or an HTML element.

If the formatElement function is provided, it only handles the formatting of displayed values. Otherwise the formatText function is used. For optimal performance, it is recommended to only use formatText if you intend to display only string values.

Example

{
name: 'closeButton' as FormatterName, // Typecast to FormatterName. Use constant in real code
formatText: () => '', // Returns an empty string because we don't need to display this in the exported data
formatElement: ({ values: [id] }: TableFormatterInputs<[id: string]>) => {
const button = document.createElement('button');

button.innerText = 'Close';

button.addEventListener('click', () => {
event.stopPropagation();

closePosition(id);
});

return button;
},
}

Type

CustomTableElementFormatter<TableFormatterInputValues>[]


historyColumns

Optional

An array of data objects that create columns for the History page where all orders from previous sessions are shown. Note that this page is only shown if you set the BrokerConfigFlags.supportOrdersHistory to true and implement the IBrokerTerminal.ordersHistory method.

Type

AccountManagerColumn[]


historyColumnsSorting

Optional

Optional sorting of the table on the History page.

Type

SortingParameters


individualPositionColumns

Optional

You can display any field of an IndividualPosition or add your own fields to an individualPosition object and display them.

Type

AccountManagerColumn[]


marginUsed

Optional

Margin used

Type

IWatchedValue<number>


orderColumns

An array of data objects that create columns for the Orders page. You can display any field of an Order or add your own fields to an order object and display them.

Type

OrderTableColumn[]


orderColumnsSorting

Optional

Optional sorting of the orders table.

Type

SortingParameters


pages

Adds custom pages to the Account Manager. Each page is a set of tables.

Type

AccountManagerPage[]


positionColumns

Optional

An array of data objects that create columns for the Positions page. You can display any field of a Position or add your own fields to a position object and display them.

Type

AccountManagerColumn[]


possibleOrderStatuses

Optional

Optional list of statuses to be used in the orders filter. Default list is used if it hasn't been set.

Type

OrderStatus[]


summary

Custom fields that are always displayed at the top-right corner of the Account Manager. Refer to the Account Summary row section for more information.

Type

AccountManagerSummaryField[]

Methods

contextMenuActions

Optional

Optional function to create a custom context menu.

Signature

contextMenuActions(contextMenuEvent: MouseEvent | TouchEvent, activePageActions: ActionMetaInfo[]) => Promise<ActionMetaInfo[]>

Parameters

NameTypeDescription
contextMenuEventMouseEvent | TouchEventMouseEvent or TouchEvent object passed by a browser
activePageActionsActionMetaInfo[]array of ActionMetaInfo items for the current page

Returns

Promise that is resolved with an array of ActionMetaInfo

Promise<ActionMetaInfo[]>