Broker
Broker JS API for TradingView Trading Platform
Enumerations
- CommonAccountManagerColumnId
- ConnectionStatus
- ConnectionType
- 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
- CryptoBalance
- CustomComboBoxItem
- CustomComboBoxMetaInfo
- CustomFieldMetaInfoBase
- CustomFields
- CustomInputFieldMetaInfo
- CustomInputFieldsValues
- CustomTableElementFormatter
- DOMData
- DOMLevel
- DefaultContextMenuActionsParams
- DefaultDropdownActionsParams
- ErrorFormatterParseResult
- Execution
- FormatterParseResult
- IBoxedValue
- IBoxedValueReadOnly
- IBrokerAccountInfo
- IBrokerCommon
- IBrokerConnectionAdapterFactory
- IBrokerConnectionAdapterHost
- IBrokerTerminal
- IBrokerWithoutRealtime
- IDelegate
- IFormatter
- INumberFormatter
- IObservable
- IObservableValue
- IObservableValueReadOnly
- IPriceFormatter
- ISubscription
- ISymbolValueFormatter
- IWatchedValue
- IWatchedValueReadonly
- IndividualPosition
- IndividualPositionBase
- InstrumentInfo
- IsTradableResult
- LeverageInfo
- LeverageInfoParams
- LeveragePreviewResult
- LeverageSetParams
- LeverageSetResult
- MenuSeparator
- NegativeBaseInputFieldValidatorResult
- OpenUrlSolution
- OrderDialogOptions
- OrderDuration
- OrderDurationMetaInfo
- OrderOrPositionMessage
- OrderPreviewResult
- OrderPreviewSection
- OrderPreviewSectionRow
- OrderRule
- OrderTemplate
- OrderTicketSettings
- PipValues
- PlaceOrderResult
- PlacedOrder
- PlacedOrderBase
- Position
- PositionBase
- PositionDialogOptions
- PositiveBaseInputFieldValidatorResult
- PreOrder
- QuantityMetainfo
- SingleBrokerMetaInfo
- SortingParameters
- StandardFormattersDependenciesMapping
- SuccessFormatterParseResult
- SymbolSpecificTradingOptions
- TableFormatterInputs
- TextWithCheckboxFieldCustomInfo
- TextWithCheckboxFieldMetaInfo
- TextWithCheckboxValue
- TradableSolutionsTypes
- TradeContext
- TradingDialogOptions
- TradingQuotes
- WatchedValueSubscribeOptions
Type Aliases
AccountId
Type
Nominal<string, "AccountID">
AccountManagerColumn
Type
{ [K in StandardFormatterName | FormatterName]: AccountManagerColumnBase<K> }[StandardFormatterName | FormatterName]
ActionMetaInfo
Describes a single action to put it into a dropdown or a context menu.
Type
ActionDescriptionWithCallback | MenuSeparator
AskBid
The Ask and Bid quotes.
Type
Required<Pick<TradingQuotes, "ask" | "bid">>
CellAlignment
Type
"left" | "right"
CustomFieldPossibleTypes
Type
"TextWithCheckBox" | "ComboBox" | "Checkbox"
CustomTableFormatElementFunction
A function that takes an TableFormatterInputs object and returns a string
or an HTMLElement
.
Type
(inputs: TableFormatterInputs<T>) => undefined | string | HTMLElement
Type parameters
Name | Type |
---|---|
T | extends TableFormatterInputValues = TableFormatterInputValues |
Type declaration
Signature
(inputs: TableFormatterInputs<T>) => undefined | string | HTMLElement
Parameters
Name | Type |
---|---|
inputs | TableFormatterInputs<T> |
Returns
undefined | string | HTMLElement
FormatterName
Type
Nominal<string, "FormatterName">
InputFieldValidator
Input field validator
Type
(value: any) => InputFieldValidatorResult
Type declaration
Signature
(value: any) => InputFieldValidatorResult
Parameters
Name | Type | Description |
---|---|---|
value | any | value to be validated |
Returns
InputFieldValidatorResult
Type
PositiveBaseInputFieldValidatorResult | NegativeBaseInputFieldValidatorResult
LanguageCode
Type
"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
Type
LeverageInfoParams | LeverageSetParams
Nominal
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
T & { [species]: Name }
Type parameters
Name | Type |
---|---|
T | T |
Name | extends string |
Order
Type
OrderTableColumn
Type
AccountManagerColumn & { supportedStatusFilters?: OrderStatusFilter[] }
SuggestedQtyChangedListener
Type
(newQty: number) => void
Type declaration
Signature
(newQty: number) => void
Parameters
Name | Type |
---|---|
newQty | number |
Returns
void
SymbolType
Type
"stock" | "index" | "forex" | "futures" | "bitcoin" | "crypto" | "undefined" | "expression" | "spread" | "cfd" | "economic" | "equity" | "dr" | "bond" | "right" | "warrant" | "fund" | "structured" | "commodity" | "fundamental" | "spot" | "swap"
TableFormatTextFunction
A function that takes an TableFormatterInputs object and returns a string
.
Type
(inputs: TableFormatterInputs<T>) => string
Type parameters
Name | Type |
---|---|
T | extends TableFormatterInputValues = TableFormatterInputValues |
Type declaration
Signature
(inputs: TableFormatterInputs<T>) => string
Parameters
Name | Type |
---|---|
inputs | TableFormatterInputs<T> |
Returns
string
TableFormatterInputValue
Type
any
TableFormatterInputValues
Type
TextInputFieldValidator
Type
(value: string) => InputFieldValidatorResult
Type declaration
Signature
(value: string) => InputFieldValidatorResult
Parameters
Name | Type |
---|---|
value | string |
Returns
TradableSolutions
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
Type
TradableSolutionsTypes[keyof TradableSolutionsTypes]
TradingDialogCustomField
Type
CheckboxFieldMetaInfo | TextWithCheckboxFieldMetaInfo | CustomComboBoxMetaInfo
WatchedValueCallback
Type
(value: T) => void
Type parameters
Name |
---|
T |
Type declaration
Signature
(value: T) => void
Parameters
Name | Type |
---|---|
value | T |
Returns
void