Interface: IBrokerCommon
Charting Library.IBrokerCommon
Hierarchy
-
IBrokerCommon
Methods
accountManagerInfo
▸ accountManagerInfo(): AccountManagerInfo
This function should return the information that will be used to build an Account manager.
Returns
chartContextMenuActions
▸ chartContextMenuActions(context, options?): Promise<ActionMetaInfo[]>
Chart can have a sub-menu Trading in the context menu. This method should return an array of ActionMetaInfo elements, each of them representing one context menu item.
Parameters
| Name | Type | Description |
|---|---|---|
context | TradeContext | context object passed by a browser |
options? | DefaultContextMenuActionsParams | - |
Returns
Promise<ActionMetaInfo[]>
connectionStatus
▸ connectionStatus(): ConnectionStatus
Connection status for the Broker API.
You don't need to return values other than 1 (Connected) typically since the broker is already connected when you create the widget.
You can use it if you want to display a spinner in the bottom panel while the data is being loaded.
Returns
executions
▸ executions(symbol): Promise<Execution[]>
Called by Trading Platform to request executions for the specified symbol
Parameters
| Name | Type | Description |
|---|---|---|
symbol | string | symbol identifier |
Returns
Promise<Execution[]>
formatter
▸ formatter(symbol, alignToMinMove): Promise<INumberFormatter>
Provide a custom price formatter for the specified symbol.
Parameters
| Name | Type | Description |
|---|---|---|
symbol | string | symbol identifier |
alignToMinMove | boolean | align formatted number to the minimum movement amount of the symbol |
Returns
Promise<INumberFormatter>
getOrderDialogOptions
▸ getOrderDialogOptions(symbol): Promise<OrderDialogOptions>
Implement this method if you use the standard Order dialog and want to customize it.
Use the symbol parameter to return customization options for a particular symbol.
Parameters
| Name | Type | Description |
|---|---|---|
symbol | string | symbol identifier |
Returns
Promise<OrderDialogOptions>
getPositionDialogOptions
▸ getPositionDialogOptions(): PositionDialogOptions
Implement this method if you want to customize the position dialog.
Returns
isTradable
▸ isTradable(symbol): Promise<boolean | IsTradableResult>
This function is required for the Floating Trading Panel.
The ability to trade via the panel depends on the result of this function: true or false.
You don't need to implement this method if all symbols can be traded.
If you want to show a custom message with the reason why the symbol cannot be traded then you can return an object IsTradableResult.
Parameters
| Name | Type | Description |
|---|---|---|
symbol | string | symbol identifier |
Returns
Promise<boolean | IsTradableResult>
orders
▸ orders(): Promise<Order[]>
Called by Trading Platform to request orders
Returns
Promise<Order[]>
ordersHistory
▸ ordersHistory(): Promise<Order[]>
This method is called by the Trading Platform to request orders history.
It is expected that returned orders will have a final status (rejected, filled, cancelled).
This method is optional. If you don't support orders history, please set supportOrdersHistory flag to false.
Returns
Promise<Order[]>
positions
▸ positions(): Promise<Position[]>
Called by Trading Platform to request positions
Returns
Promise<Position[]>
quantityFormatter
▸ quantityFormatter(symbol): Promise<INumberFormatter>
Provide a custom quantity formatter for the specified symbol.
Parameters
| Name | Type | Description |
|---|---|---|
symbol | string | symbol identifier |
Returns
Promise<INumberFormatter>
spreadFormatter
▸ spreadFormatter(symbol): Promise<INumberFormatter>
Provide a custom spread formatter for the specified symbol.
Parameters
| Name | Type | Description |
|---|---|---|
symbol | string | symbol identifier |
Returns
Promise<INumberFormatter>
symbolInfo
▸ symbolInfo(symbol): Promise<InstrumentInfo>
Called by the internal Order dialog, DOM panel, and floating trading panel to get symbol information.
Parameters
| Name | Type | Description |
|---|---|---|
symbol | string | symbol identifier |
Returns
Promise<InstrumentInfo>
trades
▸ trades(): Promise<Trade[]>
Called by Trading Platform to request trades
Returns
Promise<Trade[]>