Module: 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
- PipValues
- PlaceOrderResult
- PlacedOrder
- PlacedOrderBase
- Position
- PositionBase
- PositionDialogOptions
- PositiveBaseInputFieldValidatorResult
- PreOrder
- QuantityMetainfo
- SingleBrokerMetaInfo
- SortingParameters
- StandardFormattersDependenciesMapping
- SuccessFormatterParseResult
- SymbolSpecificTradingOptions
- TableFormatterInputs
- TextWithCheckboxFieldCustomInfo
- TextWithCheckboxFieldMetaInfo
- TextWithCheckboxValue
- 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"
CustomFieldPossibleTypes
Ƭ CustomFieldPossibleTypes: "TextWithCheckBox"
| "ComboBox"
| "Checkbox"
CustomTableFormatElementFunction
Ƭ CustomTableFormatElementFunction<T
>: (inputs
: TableFormatterInputs
<T
>) => undefined
| string
| HTMLElement
A function that takes an TableFormatterInputs object and returns a string
or an HTMLElement
.
Type parameters
Name | Type |
---|---|
T | extends TableFormatterInputValues = TableFormatterInputValues |
Type declaration
▸ (inputs
): undefined
| string
| HTMLElement
Parameters
Name | Type |
---|---|
inputs | TableFormatterInputs <T > |
Returns
undefined
| string
| HTMLElement
FormatterName
Ƭ FormatterName: Nominal
<string
, "FormatterName"
>
InputFieldValidator
Ƭ InputFieldValidator: (value
: any
) => InputFieldValidatorResult
Input field validator
Type declaration
▸ (value
): InputFieldValidatorResult
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
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 |
Order
Ƭ Order: PlacedOrder
| BracketOrder
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"
TableFormatTextFunction
Ƭ TableFormatTextFunction<T
>: (inputs
: TableFormatterInputs
<T
>) => string
A function that takes an TableFormatterInputs object and returns a string
.
Type parameters
Name | Type |
---|---|
T | extends TableFormatterInputValues = TableFormatterInputValues |
Type declaration
▸ (inputs
): 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: ChangeAccountSolution
| ChangeSymbolSolution
| OpenUrlSolution
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
WatchedValueCallback
Ƭ WatchedValueCallback<T
>: (value
: T
) => void
Type parameters
Name |
---|
T |
Type declaration
▸ (value
): void
Parameters
Name | Type |
---|---|
value | T |
Returns
void