Module: Broker
Broker JS API for TradingView Trading Platform
Enumerations
- BottomWidgetBarMode
 - CommonAccountManagerColumnId
 - ConnectionStatus
 - ConnectionType
 - DisconnectType
 - NotificationType
 - OrderOrPositionMessageType
 - OrderStatus
 - OrderStatusFilter
 - OrderTicketFocusControl
 - OrderType
 - ParentType
 - PriceType
 - Side
 - StandardFormatterName
 - StopType
 
Interfaces
- AccountManagerColumnBase
 - AccountManagerInfo
 - AccountManagerPage
 - AccountManagerSummaryField
 - AccountManagerTable
 - AccountManagerTableFlags
 - AccountMetainfo
 - ActionDescription
 - ActionDescriptionWithCallback
 - BaseInputFieldValidatorResult
 - BracketOrder
 - BracketOrderBase
 - Brackets
 - BrokerConfigFlags
 - BrokerCustomUI
 - ChangeAccountSolution
 - ChangeSymbolSolution
 - CheckboxFieldMetaInfo
 - ClosePositionPreviewResult
 - ClosePositionPreviewRowData
 - ClosePositionPreviewSeparator
 - CryptoBalance
 - CustomComboBoxItem
 - CustomComboBoxMetaInfo
 - CustomFieldMetaInfoBase
 - CustomFields
 - CustomInputFieldMetaInfo
 - CustomInputFieldsValues
 - CustomTableElementFormatter
 - DOMData
 - DOMLevel
 - DefaultContextMenuActionsParams
 - DefaultDropdownActionsParams
 - DisconnectionInfo
 - ErrorFormatterParseResult
 - Execution
 - FormatterFormatOptions
 - FormatterParseOptions
 - FormatterParseResult
 - HyperlinkInfo
 - IBoxedValue
 - IBoxedValueReadOnly
 - IBrokerAccountInfo
 - IBrokerCommon
 - IBrokerConnectionAdapterFactory
 - IBrokerConnectionAdapterHost
 - IBrokerTerminal
 - IDelegate
 - IFormatter
 - INumberFormatter
 - IObservable
 - IObservableValue
 - IObservableValueReadOnly
 - IPriceFormatter
 - ISubscription
 - ISymbolValueFormatter
 - IWatchedValue
 - IWatchedValueReadonly
 - IndividualPosition
 - IndividualPositionBase
 - InstrumentInfo
 - IsTradableResult
 - LeverageInfo
 - LeverageInfoParams
 - LeveragePreviewResult
 - LeverageSetParams
 - LeverageSetResult
 - MenuSeparator
 - NegativeBaseInputFieldValidatorResult
 - NumberFormatterFormatOptions
 - OpenUrlSolution
 - OrderDialogOptions
 - OrderDuration
 - OrderDurationMetaInfo
 - OrderOrPositionMessage
 - OrderPreviewResult
 - OrderPreviewSection
 - OrderPreviewSectionRow
 - OrderRule
 - OrderTemplate
 - OrderTemplateBase
 - OrderTicketSettings
 - PipValues
 - PlaceOrderResult
 - PlacedOrder
 - PlacedOrderBase
 - Position
 - PositionBase
 - PositionDialogOptions
 - PositiveBaseInputFieldValidatorResult
 - PreOrder
 - PriceFormatterFormatOptions
 - QuantityMetainfo
 - SingleBrokerMetaInfo
 - SortingParameters
 - StandardFormattersDependenciesMapping
 - SuccessFormatterParseResult
 - SymbolFormatterProperties
 - SymbolSpecificTradingOptions
 - SymbolValueFormatterFormatOptions
 - TableFormatterInputs
 - TextFieldMetaInfo
 - TextWithCheckboxFieldCustomInfo
 - TextWithCheckboxFieldMetaInfo
 - TextWithCheckboxValue
 - TradableSolutionsTypes
 - TradeContext
 - TradingDialogOptions
 - TradingQuotes
 - WatchedValueSubscribeOptions
 
Type Aliases
AccountId
Ƭ AccountId: Nominal<string, "AccountID">
AccountManagerColumn
Ƭ AccountManagerColumn: { [K in StandardFormatterName | FormatterName]: AccountManagerColumnBase<K> }[StandardFormatterName | FormatterName]
ActionMetaInfo
Ƭ ActionMetaInfo: ActionDescriptionWithCallback | MenuSeparator
Describes a single action to put it into a dropdown or a context menu.
AskBid
Ƭ AskBid: Required<Pick<TradingQuotes, "ask" | "bid">>
The Ask and Bid quotes.
CellAlignment
Ƭ CellAlignment: "left" | "right"
ClosePositionPreviewRow
Ƭ ClosePositionPreviewRow: ClosePositionPreviewRowData | ClosePositionPreviewSeparator
CustomFieldPossibleTypes
Ƭ CustomFieldPossibleTypes: "TextWithCheckBox" | "ComboBox" | "Checkbox" | "TextField"
CustomTableFormatElementFunction
Ƭ CustomTableFormatElementFunction<T>: (inputs: TableFormatterInputs<T>) => undefined | string | HTMLElement
Type parameters
| Name | Type | 
|---|---|
T | extends TableFormatterInputValues = TableFormatterInputValues | 
Type declaration
▸ (inputs): undefined | string | HTMLElement
A function that takes an TableFormatterInputs object and returns a string or an HTMLElement.
Parameters
| Name | Type | 
|---|---|
inputs | TableFormatterInputs<T> | 
Returns
undefined | string | HTMLElement
FormatterName
Ƭ FormatterName: Nominal<string, "FormatterName">
InputFieldValidator
Ƭ InputFieldValidator: (value: any) => InputFieldValidatorResult
Type declaration
▸ (value): InputFieldValidatorResult
Input field validator
Parameters
| Name | Type | Description | 
|---|---|---|
value | any | value to be validated | 
Returns
InputFieldValidatorResult
Ƭ InputFieldValidatorResult: PositiveBaseInputFieldValidatorResult | NegativeBaseInputFieldValidatorResult
LanguageCode
Ƭ LanguageCode: "ar" | "zh" | "ca_ES" | "en" | "fr" | "de" | "he_IL" | "id_ID" | "it" | "ja" | "ko" | "pl" | "pt" | "ru" | "es" | "sv" | "th" | "tr" | "vi" | "ms_MY" | "zh_TW"
LeverageParams
Ƭ LeverageParams: LeverageInfoParams | LeverageSetParams
MarkupText
Ƭ MarkupText: (string | HyperlinkInfo)[]
Nominal
Ƭ Nominal<T, Name>: T & { [species]: Name  }
This is the generic type useful for declaring a nominal type, which does not structurally matches with the base type and the other types declared over the same base type
Usage:
Example
type Index = Nominal<number, 'Index'>;
// let i: Index = 42; // this fails to compile
let i: Index = 42 as Index; // OK
Example
type TagName = Nominal<string, 'TagName'>;
Type parameters
| Name | Type | 
|---|---|
T | T | 
Name | extends string | 
ObservableCallback
Ƭ ObservableCallback<T>: (value: T) => void
Type parameters
| Name | 
|---|
T | 
Type declaration
▸ (value): void
Parameters
| Name | Type | 
|---|---|
value | T | 
Returns
void
Order
Ƭ Order: PlacedOrder | BracketOrder
OrderPreviewMessage
Ƭ OrderPreviewMessage: string | MarkupText
OrderTableColumn
Ƭ OrderTableColumn: AccountManagerColumn & { supportedStatusFilters?: OrderStatusFilter[]  }
SuggestedQtyChangedListener
Ƭ SuggestedQtyChangedListener: (newQty: number) => void
Type declaration
▸ (newQty): void
Parameters
| Name | Type | 
|---|---|
newQty | number | 
Returns
void
SymbolType
Ƭ SymbolType: "stock" | "index" | "forex" | "futures" | "bitcoin" | "crypto" | "undefined" | "expression" | "spread" | "cfd" | "economic" | "equity" | "dr" | "bond" | "right" | "warrant" | "fund" | "structured" | "commodity" | "fundamental" | "spot" | "swap" | "option" | "ndf"
TableFormatTextFunction
Ƭ TableFormatTextFunction<T>: (inputs: TableFormatterInputs<T>) => string
Type parameters
| Name | Type | 
|---|---|
T | extends TableFormatterInputValues = TableFormatterInputValues | 
Type declaration
▸ (inputs): string
A function that takes an TableFormatterInputs object and returns a string.
Parameters
| Name | Type | 
|---|---|
inputs | TableFormatterInputs<T> | 
Returns
string
TableFormatterInputValue
Ƭ TableFormatterInputValue: any
TableFormatterInputValues
Ƭ TableFormatterInputValues: TableFormatterInputValue[]
TextInputFieldValidator
Ƭ TextInputFieldValidator: (value: string) => InputFieldValidatorResult
Type declaration
▸ (value): InputFieldValidatorResult
Parameters
| Name | Type | 
|---|---|
value | string | 
Returns
TradableSolutions
Ƭ TradableSolutions: TradableSolutionsTypes[keyof TradableSolutionsTypes]
TradableSolutions has one of the following keys:
changeAccount- id of a sub-account suitable for trading the symbolchangeSymbol- the symbol suitable for trading with current sub-accountopenUrl- the object with URL to be opened and text for solution button
TradingDialogCustomField
Ƭ TradingDialogCustomField: CheckboxFieldMetaInfo | TextWithCheckboxFieldMetaInfo | CustomComboBoxMetaInfo | TextFieldMetaInfo
WatchedValueCallback
Ƭ WatchedValueCallback<T>: (value: T) => void
Type parameters
| Name | 
|---|
T | 
Type declaration
▸ (value): void
Parameters
| Name | Type | 
|---|---|
value | T | 
Returns
void