Download OpenAPI specification:Download
This API is to be implemented by the Brokers in order to connect their backend systems to TradingView, that acts as a frontend.
Check the info page for more info and use the contact form there if you have any questions.
There are two types of requests — client and server. Client requests are executed at the browser. Server requests are initiated from the TradingView servers. If your integration does not imply brokerage data stream connection to the TradingView website - then there won't be any server requests.
The two possible ways of sending updates to the client's side are either done by making use of client regularly polling endpoints, or by opening a streaming connection and pushing updates.
From the browser TradingView requests the info (list of orders and positions, balance info, etc.) from the broker’s server. The requests are sent periodically and the intervals can be set by using the /config endpoint. After that, TradingView compares the new data with the previous answer and calculates the difference. If the status of the order/position changes or new data appears - the user will see a notification and the changes will display in the Account manager on the website.
Requests to the endpoints for placing/modifying orders, positions closing, etc. occur only after actions made by the user.
The /quotes endpoint retrieves the current bid/ask from the broker. The /depth endpoint retrieves Level 2 market data.
If the integration uses HTTP streaming endpoints, the connections to them are established once at the start of a session. The http-streaming consists of messages separated with line breaks. The content of the messages must be in Compact JSON format, i.e. should not contain any line breaks, except a line break at the very end which will act as a message separator.
There are four types of messages:
Entities snapshot
Entities updates
Ping
Error
Please refer to the streaming endpoints for more details.
In case if a Broker provides any Forex or CFD trading access for its clients it will require connection of its own market data at TradingView. In order to make it possible, you will need to implement the following endpoints - /symbol_info, /history and /streaming. Data requests are sent from different TradingView servers. Usually, at least 4 servers are used. The historical data is cached on TradingView servers and loaded to the client browser from our servers.
By default, the broker symbols will be available in the symbol search at TradingView and all the community will have access to your data streams without any limitation. In order to limit the access to your data streams please use the following endpoints - /groups and /permissions.
You can find more information about restricting access to the data in the description of these endpoints.
1.4.27. Added a new supportCustomOrderInfo
flag.
This flag enables the new /orderInfo endpoint, which retrieves order data displayed in the Order Ticket.
The data is dynamically updated in the Order Info section of the Order Ticket based on the fields updates listed in the dependencies
property of the new orderInfoConfig
parameter from /config.
1.4.26. Added a new /userInfo endpoint to retrieve detailed information specific to each user.
1.4.25. Added new supportStopLoss
flag.
1.4.24. Added support for broker's hyperlinks to be displayed in an order preview or an order ticket.
1.4.23. Added the minimum allowed value for the expires_in
parameter.
1.4.22. Added support for hyperlinks in /orderPreview response.
1.4.21. Added custom text field support.
Added new textField
field to the /accounts and /instruments endpoints
for the orderDialogCustomFields
object.
1.4.20. Changed the typespecs parameter type in /symbol_info endpoint's response.
1.4.19. The supportExecutions
flag became deprecated. The Executions endpoint is now mandatory.
1.4.18. The supportOrdersHistory
flag became deprecated. The Orders History endpoint is now mandatory.
1.4.17. Added new supportCloseIndividualPosition
flag.
1.4.16. Added connection warning message configuration to the /accounts endpoint.
1.4.15. Added new flag supportRiskControlsAndInfo
.
1.4.14. Added support for Guaranteed Stop brackets for orders and positions. Added new flag supportGuaranteedStop
.
1.4.13. Added logout with redirect to OAuth 2 Code Flow.
1.4.12. Added a closed position description to the /stream/positions, /stream/individualPositions and /stream/netPositions endpoints responses.
1.4.11. Changed the transactionId parameter type, changed the common response description.
1.4.10. Added new typespecs
field to /instruments endpoint's response.
Added new applicable values for the type
field in the same endpoint's response: spot
, swap
, commodity
.
Marked the cfd
and crypto
values in the type
field as deprecated.
Added new volume-type
field to /symbol_info endpoint's response.
1.4.9. Added new roundTripStartTime
field to the /trackLatency endpoint's request body.
1.4.8. Added new flag supportAddBracketsToExistingOrder
.
1.4.7. Added new flag supportStrictCheckingLimitOrderPrice
.
1.4.6. Added 'modify_individual_position' and 'close_individual_position' transaction types to the /trackLatency endpoint.
1.4.5. Added support for refresh_token_expires_in
parameter for OAuth 2 Code Flow.
1.4.4. Added support for individual and net position streaming, added two new endpoints: /stream/individualPositions a streaming alternative to the /individualPositions endpoint. /stream/netPositions a streaming alternative to the /netPositions endpoint.
1.4.3. Added marginAvailable
field to the AccountState
parameters.
1.4.2. Added amount
field to /individualPositions endpoint. Added new supportPartialCloseIndividualPosition
flag.
1.4.1. Added two new endpoints: /stream/state. A streaming alternative to the /state endpoint. /stream/quotes. A streaming alternative to the /quotes endpoint.
1.4.0. Added support for http-streaming and two new endpoints: /stream/orders and /stream/positions.
1.3.35. Added support for net and individual positions. Added the following endpoints:
/netPositions, /individualPositions,
/closeNetPosition, /closeIndividualPosition
and /modifyIndividualPosition.
Added new flag supportIndividualPositionBrackets
.
1.3.34. Added track latency support. Added new supportTrackLatency
flag. Added new endpoint:
/trackLatency.
1.3.33. Added new flag supportStopLimitOrdersInBothDirections
.
1.3.32. Added new flag supportLeverageButton
.
1.3.31. The locale parameter for the /authorization endpoint is now required only for trading integration.
1.3.30. Added new currentAsk
and currentBid
fields to the /modifyPosition endpoint.
1.3.29. Added custom checkbox support.
Added new checkbox
field to the /accounts and /instruments endpoints
for the orderDialogCustomFields
object.
1.3.28. Added new variableMinTick
field to the /instruments endpoint.
1.3.27. Added hardToBorrow
, notShortable
, halted
parameters to the /quotes endpoint.
1.3.26. In /symbol_info, the minmov2
property renamed to minmovement2
, the Etc/UTC
timezone added. In /history , the HistoryNextBarResponse
response changed to
HistoryEmptyBarResponse
, the countback
query parameter became deprecated.
In /accounts, added the isVerified
property.
1.3.25. Added locale
parameter to the /authorize endpoint.
1.3.24. Added leverage support. Added new supportLeverage
flag. Added three new endpoints:
/getLeverage, /setLeverage and /previewLeverage.
1.3.23. Changed description of forceUserEnterInitialValue
flag in the OrderDialogCustomFields
parameters.
1.3.22. Added new flags - supportModifyOrderPrice
and supportModifyBrackets
. The supportModifyOrder
flag became deprecated.
1.3.21. Added new units
field to the /instruments endpoint.
1.3.20. Added new supportTrailingStop
flag. Added support for trailing stops for orders and positions.
1.3.19. Added new logout
endpoint, supportLogout
flag.
1.3.18. Added new supportPartialClosePosition
flag and amount
field to the /closePosition
endpoint parameters.
1.3.17. Added stopPercent
and limitPercent
validation rules to the /instruments endpoint.
1.3.16. Added new supportOrderHistoryCustomFields
flag and orderHistoryCustomFields
field to the ui
object
in the /accounts endpoint and /config.
1.3.15. Added supportedOrderTypes
field to the Duration
parameters.
1.3.14. Added isCapitalize
field to the positionCustomFields
and orderCustomFields
parameters.
1.3.13. Added rules parameter to the /instruments endpoint.
1.3.12. Added prefix
field to the Account
parameters.
1.3.11. Changed description for /placeOrder, /modifyOrder,
/previewOrder, OrderDialogCustomFields
and customFields
field in OrderCommon
.
1.3.10. Added locale
query parameter to /getOrders, /placeOrder,
/modifyOrder, /cancelOrder, /getPositions,
/modifyPosition, /closePosition,
/getExecutions, /getOrdersHistory,
/getQuotes, /getDepth and /getBalances endpoints.
1.3.9. Added orderId
, isClose
, positionId
and commission
fields to Execution.
1.3.8. Added id
field to the /previewOrder endpoint parameters.
1.3.7. Added mutable
field to the OrderDialogCustomFields
parameters.
1.3.6. Added lang
query parameter to OAuth authorization request.
1.3.5. Added accountId
query parameter to depth
endpoint.
1.3.4. Added Order dialog customization opportunity on the instrument basis. Moved OrderDialogCustomFields
to
the ui
object in the /accounts endpoint.
1.3.3. Added new supportStopOrdersInBothDirections
flag.
1.3.2. Added new previewOrder
endpoint, supportPlaceOrderPreview
and supportModifyOrderPreview
flags.
1.3.1. Added OAuth 2 Code Flow.
1.3.0. Added overriding Account manager and Durations configuration on Account basis.
1.2.5. Added reserved
, value
and valueCurrency
fields to Crypto Balances.
1.2.4. Added default values to the account flags. Added supportMarketBrackets
account flag.
1.2.3. Added current ask/bid fields to the parameters of the order placement and modification requests.
1.2.2. Added supportPartialOrderExecution flag.
1.2.1. Added support for position's and order's Custom fields. Removed fixedWidth
and sortable
fields from AccountManagerColumn
.
1.2.0. Introducing new Quote response. Deprecation of streaming Bid and Ask responses. All new integrations should use the Quote response to provide ask/bid values. Added supportMarketOrders, supportLimitOrders, supportStop orders account flags. Added informational message to order and position.
1.1.3. Added support for reverse of the position.
1.1.2. Added support for custom Account Summary Row.
1.1.1. Added type
field to /accounts endpoint.
1.1.0. Refactor, added examples.
This flow uses login and password to authenticate a user. Username and password are sent as parameters to the /authorize endpoint.
If the username and password are valid, then the broker issues an access token and returns it in the response. The access token is sent with every request in the Authorization header.
Security Scheme Type | HTTP |
---|---|
HTTP Authorization Scheme | bearer |
Bearer format | "Bearer ACCESS_TOKEN" |
TradingView is using the Implicit or Code flow of OAuth 2 as it is described in the RFC 6749.
After performing authorization, the access token is sent with every request in the Authorization
header.
Implicit Flow:
For OAuth 2 Implicit Flow the broker provides TradingView with the following OAuth 2 application parameters:
Application parameter | Description | Example value |
---|---|---|
client id | A unique client identifier | sQeww4FgtythHTUrhrfMo9rRTq |
authorization URI | An authorization endpoint URI | https://your-rest-implementation.com/api/authorize |
scope | A scope of the access request as a list of space-delimited, case-sensitive strings | read trade profile |
TradingView provides the broker with two redirect URIs, one for the staging environment and the other for the production environment.
Authorization Request
TradingView sends the authorization request according to OAuth 2 specification, 4.2.1. The following parameters will be in the query part of the authorization URI:
OAuth2 parameter | Description |
---|---|
response_type | Response type. The value will be set to token |
client_id | A client identifier string provided by the broker |
redirect_uri | Redirection Endpoint |
scope | A scope of the access request if it is provided by the broker |
prompt | The value will be set to login |
state | A literal string that the broker should return to TradingView without changes in the authorization response. |
Note: The redirect_uri
parameter should be verified by the broker's OAuth service, and should be whitelisted on the broker's service.
TradingView could send the lang
parameter additionally if it is required by the broker, with the following possible values:
ar
, br
, cs
, de
, el
, en
, es
, fa
, fr
, he
,hu
, id
, in
, it
, ja
, kr
, ms
, nl
, pl
, ro
, ru
, sv
, th
, tr
, uk
, vi
, zh
.
In case of successful authorization, the OAuth service redirects the user-agent (browser) to redirect_uri
with the access token added as a fragment, according to
OAuth 2 specification, 4.2.2. The state
parameter
should be passed without modifications. The expires_in
parameter is optional, but is recommended to provide
a more secure environment for integration users. A minimum value for the expires_in
parameter is 60 sec.
Refresh Request
In order to refresh the access token the broker should support additional prompt parameter in the authorization
requests, that is not a part of the OAuth specification, but it presents in
the OpenID Connect specification.
The broker should respect the none
value of this parameter and display no authentication UI and just return
an error if the user session is already expired (the specific error codes is also standardized by
the OpenID Connect specification).
Code Flow:
For OAuth 2 Code Flow the broker provides TradingView with the following OAuth 2 application parameters:
Application parameter | Description | Example value |
---|---|---|
client id | A unique client identifier | sQeww4FgtythHTUrhrfMo9rRTq |
client secret | A client secret | 45dd67oi56ds678st6788dffdyu |
authorization URI | An authorization endpoint URI | https://your-rest-implementation.com/oauth/authorize |
token URI | A token endpoint URI | https://your-rest-implementation.com/oauth/token |
logout URI (optional) | A logout URI | https://your-rest-implementation.com/oauth/logout |
scope | A scope of the access request as a list of space-delimited, case-sensitive strings | read trade profile |
TradingView provides the broker with two redirect URIs, one for the staging environment and the other for the production environment.
TradingView also provides a redirect_uri
URI if the broker supports user logout with a redirect.
Note: The redirect_uri
parameter should be verified by the broker's OAuth service, and should be whitelisted on the broker's side.
Authorization Request
TradingView sends the Authorization Request according to OAuth 2 specification, 4.1.1. The following parameters will be in the query part of the authorization URI:
OAuth2 parameter | Description |
---|---|
response_type | Response type. The value will be set to code |
client_id | A client identifier string provided by the broker |
redirect_uri | Redirection Endpoint |
scope | A scope of the access request if it is provided by the broker |
state | A literal string that the broker should return back to TradingView without changes in the authorization response |
Note: The redirect_uri
parameter should be verified by the broker's OAuth service, and should be whitelisted on the broker's service.
TradingView could send the lang
parameter additionally if it is required by the broker, with the following possible values:
ar
, br
, cs
, de
, el
, en
, es
, fa
, fr
, he
,hu
, id
, in
, it
, ja
, kr
, ms
, nl
, pl
, ro
, ru
, sv
, th
, tr
, uk
, vi
, zh
.
If all the parameters of the authorization request are valid and access is granted, the broker issues an authorization code and redirects to the redirect URI with the following parameters added to the request URI component:
OAuth2 parameter | Description |
---|---|
code | The authorization code. It must expire shortly after its release to prevent the risk of leakage |
state | The exact value which was sent in the authorization request |
Access Token Request
TradingView makes an Access Token Request by sending the following parameters using the application/x-www-form-urlencoded
format:
OAuth2 parameter | Description |
---|---|
grant_type | The grant type. The value will be set to authorization_code |
client_id | A client identifier string provided by the broker |
client_secret | A client secret string provided by the broker |
code | The authorization code received from the broker |
redirect_uri | The same redirect URI used in the Authorization Request |
After successful verification of the authorization code broker issues an access token, a refresh token and responds to the access token request as follows:
OAuth2 parameter | Description |
---|---|
access_token | The access token which will be used in every request to the API |
refresh_token | Token used to obtain new access tokens |
token_type | Token type. Should be set to bearer |
expires_in | The life time of the access token in seconds |
refresh_token_expires_in | The life time of the refresh token in seconds |
The expires_in
and refresh_token_expires_in
parameters are optional, but are recommended to provide
a more secure environment for integration users.
Refresh Request
To refresh the access token TradingView makes a Refresh Request to the token endpoint using the application/x-www-form-urlencoded
format with the following parameters:
OAuth2 parameter | Description |
---|---|
grant_type | The grant type. The value will be set to refresh_token |
refresh_token | The refresh token issued by the broker |
client_secret | The client secret value provided by the broker |
If all parameters are valid, the broker issues a new access token and, if necessary, a new refresh token and responds to the request as described in the Access token request section above.
Logout Request
To log the user out of the integration, TradingView makes a Logout Request to the logout endpoint with the following query string parameters:
OAuth2 parameter | Description | Example |
---|---|---|
client_id | A client identifier string provided by the broker | |
redirect_uri | The url where the user should be redirected to after logging out | https://www.tradingview.com/trading/logout-redirect/ |
Security Scheme Type | OAuth2 |
---|---|
implicit OAuth Flow | Authorization URL: https://your-rest-implementation.com/api/authorize Scopes:
|
authorizationCode OAuth Flow | Authorization URL: https://your-rest-implementation.com/api/authorize Token URL: https://your-rest-implementation.com/api/oauth/token Scopes:
|
This authentication flow is used for server-to-server requests where authentication needs to be done without human intervention. It can be used with the /history, /symbol_info, /streaming and /groups endpoints.
JSON Web Token (JWT) is used to securely transmit information between broker and TradingView. More information about JWT can be found here.
The broker provides the following application and OAuth2 parameters to TradingView:
Application parameter | Description | Example value |
---|---|---|
AppUrl | A URL uniquely representing broker's application | https://your-rest-implementation.com |
UserId | A user identifier for which the access token will be issued | testuser1 |
OAuth2 parameter | Description | Example value |
---|---|---|
client_id | A unique client Identifier | FGGH7-TRVC3-ECDD2-CDHRG3-FYUDG5 |
client_secret | Secret code | adfegywrtyw |
token_url | An url to which the access token request will be sent | https://your-rest-implementation.com/authorize/token |
grant_type | Indicates the type of grant being presented in exchange for an access token | urn:your-broker:oauth:grant-type:personal-jwt |
The broker provides a valid X.509 certificate to TradingView for signing JWT.
JWT for the access token request is created with the following headers and claims:
Header | Description | Standard | Sample Value |
---|---|---|---|
x5t | Thumbprint of provided X.509 certificate used for signing JWT | RFC 7515 | 935093f1690900asdfd98626dfw35fa22b41d9dfd |
alg | Algorithm used to sign JWT. RS256 is only supported at the moment | RFC 1518 | RS256 |
Claim | Description | Sample Value |
---|---|---|
iss | Issuer - Value should be client_id | FGGH7-TRVC3-ECDD2-CDHRG3 |
sub | UserId - Value should be the UserId for which token is needed | testuser1 |
exp | Expiry - Value should be a Unix time stamp indicating expiry of the token | 1549465914 |
aud | Audience - Value should be the token_url | https://your-rest-implementation.com/authorize/token |
spurl | AppUrl - The AppUrl of your application | https://your-rest-implementation.com |
TradingView sends a POST request to the token_url
to obtain an access token.
The client_id
and client_secret
are included as parameters in the request body.
The JWT is sent in a parameter named assertion
.
POST /token HTTP/1.1
Host: sim.logonvalidation.net
Content-Type: application/x-www-form-urlencoded
grant_type=urn%3Ayour-broker%3Aoauth%3Agrant-type%3Apersonal-jwt
&assertion=eyJhbGciOiJFUzI1NiIsImtpZCI6IjE2In0.eyJpc3Mi[...omitted for brevity...]
&client_id=1234-5678-9101
&client_secret=abcdefghijklmn
The response to this request should contain an access_token
. A refresh_token
is optional and can be omitted:
{
"access_token" : "eyJhbfGujudUf.eyJvYWEiOiIw[omitted for brevity]",
"expires_in": 1200,
"token_type": "Bearer",
"refresh_token": "86fy7fa3d2-5e13-4736-86031-9ehiyiufrow0b",
"refresh_token_expires_in": 2400
}
Security Scheme Type | OAuth2 |
---|---|
clientCredentials OAuth Flow | Token URL: https://your-rest-implementation.com/api/authorize/token Scopes:
|
Your REST API implementation url. Change it to your real REST API url.
Send logout if the supportLogout flag is set as true.
response
s required | string Value: "ok" Status will always be |
{- "s": "ok"
}
Your REST API implementation url. Change it to your real REST API url.
Get localized configuration.
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (Config) |
{- "s": "ok",
- "d": {
- "accountSummaryRow": [
- {
- "id": "accountBalance",
- "title": "Account Balance"
}, - {
- "id": "Equity",
- "title": "Realized P/L"
}, - {
- "id": "Open Profit",
- "title": "Unrealized P/L"
}
], - "accountManager": [
- {
- "id": "accountSummary",
- "title": "",
- "columns": [
- {
- "id": "todayPL",
- "title": "Today's P&L"
}, - {
- "id": "accountValue",
- "title": "Account Value"
}, - {
- "id": "balance",
- "title": "Balance"
}, - {
- "id": "totalMargin",
- "title": "Margin"
}, - {
- "id": "held",
- "title": "Held"
}, - {
- "id": "buyingPower",
- "title": "Buying Power"
}
]
}
], - "durations": [
- {
- "id": "GTT",
- "title": "Good Till Time",
- "hasDatePicker": true,
- "hasTimePicker": true,
- "default": true,
- "supportedOrderTypes": [
- "stop",
- "stoplimit"
]
}
], - "orderCustomFields": [
- {
- "id": "commission",
- "title": "Commission",
- "tooltip": "Commission Fees",
- "alignment": "right"
}
], - "orderHistoryCustomFields": [
- {
- "id": "commission",
- "title": "Commission",
- "tooltip": "Commission Fees",
- "alignment": "right"
}
], - "positionCustomFields": [
- {
- "id": "exchangeFee",
- "title": "Exchange fee",
- "tooltip": "Exchange fee for the position",
- "alignment": "right"
}, - {
- "id": "routeFee",
- "title": "Route fee",
- "tooltip": "Route fee for the position",
- "alignment": "right"
}
], - "netPositionCustomFields": [
- {
- "id": "exchangeFee",
- "title": "Exchange fee",
- "tooltip": "Exchange fee for the position",
- "alignment": "right"
}, - {
- "id": "routeFee",
- "title": "Route fee",
- "tooltip": "Route fee for the position",
- "alignment": "right"
}
], - "individualPositionCustomFields": [
- {
- "id": "exchangeFee",
- "title": "Exchange fee",
- "tooltip": "Exchange fee for the position",
- "alignment": "right"
}, - {
- "id": "routeFee",
- "title": "Route fee",
- "tooltip": "Route fee for the position",
- "alignment": "right"
}
], - "pullingInterval": {
- "quotes": 500,
- "orders": 500,
- "positions": 1000,
- "accountManager": 1000,
- "balances": 1000
}, - "orderInfoConfig": {
- "dependencies": [
- [
- "qty",
- "side",
- "price",
- "duration",
- "brackets"
]
]
}
}
}
Your REST API implementation url. Change it to your real REST API url.
Return all broker instruments with corresponding TradingView instruments. It is required to add a Broker to TradingView.com. Please note that this endpoint works without authorization!
response
symbols | Array of objects (SingleMapping) |
fields | Array of strings (SingleField) 1 items Items Value: "brokerSymbol" Array with the only one element |
{- "symbols": [
- {
- "f": [
- "EURUSD"
], - "s": "FX_IDC:EURUSD"
}, - {
- "f": [
- "AAPLE"
], - "s": "NASDAQ:AAPLE"
}
], - "fields": [
- "brokerSymbol"
]
}
Your REST API implementation url. Change it to your real REST API url.
Get a list of accounts owned by the user.
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | Array of objects (Account) non-empty |
{- "s": "ok",
- "d": [
- {
- "id": "ACC-001",
- "name": "Demo trading account",
- "type": "demo",
- "currency": "JPY",
- "currencySign": "Â¥",
- "config": {
- "supportBrackets": true,
- "supportOrderBrackets": false,
- "supportAddBracketsToExistingOrder": true,
- "supportMarketBrackets": true,
- "supportPositionBrackets": false,
- "supportPositions": true,
- "supportMultiposition": false,
- "supportClosePosition": false,
- "supportPartialClosePosition": false,
- "supportReversePosition": true,
- "supportNativeReversePosition": false,
- "supportMarketOrders": true,
- "supportLimitOrders": true,
- "supportStopOrders": true,
- "supportStopLimitOrders": false,
- "supportStopLoss": true,
- "supportTrailingStop": false,
- "supportGuaranteedStop": false,
- "supportStopOrdersInBothDirections": false,
- "supportStopLimitOrdersInBothDirections": false,
- "supportPartialOrderExecution": false,
- "supportModifyOrder": true,
- "supportModifyOrderPrice": true,
- "supportEditAmount": true,
- "supportModifyBrackets": true,
- "supportModifyDuration": false,
- "supportCryptoExchangeOrderTicket": false,
- "supportDigitalSignature": false,
- "supportPlaceOrderPreview": false,
- "supportModifyOrderPreview": false,
- "showQuantityInsteadOfAmount": false,
- "supportBalances": false,
- "supportOrdersHistory": false,
- "supportLeverage": false,
- "supportLeverageButton": true,
- "supportDOM": true,
- "supportLevel2Data": false,
- "supportPLUpdate": true,
- "supportDisplayBrokerNameInSymbolSearch": true,
- "supportLogout": false,
- "supportCustomAccountSummaryRow": false,
- "supportPositionCustomFields": false,
- "supportOrderCustomFields": false,
- "supportOrderHistoryCustomFields": false,
- "supportTrackLatency": false,
- "supportPositionNetting": false,
- "supportIndividualPositionBrackets": false,
- "supportCloseIndividualPosition": false,
- "supportPartialCloseIndividualPosition": false,
- "supportStrictCheckingLimitOrderPrice": false,
- "supportRiskControlsAndInfo": true,
- "supportCustomOrderInfo": false
}, - "ui": {
- "accountSummaryRow": [
- {
- "id": "accountBalance",
- "title": "Account Balance"
}, - {
- "id": "Equity",
- "title": "Realized P/L"
}, - {
- "id": "Open Profit",
- "title": "Unrealized P/L"
}
], - "accountManager": [
- {
- "id": "accountSummary",
- "title": "",
- "columns": [
- {
- "id": "todayPL",
- "title": "Today's P&L"
}, - {
- "id": "accountValue",
- "title": "Account Value"
}, - {
- "id": "balance",
- "title": "Balance"
}, - {
- "id": "totalMargin",
- "title": "Margin"
}, - {
- "id": "held",
- "title": "Held"
}, - {
- "id": "buyingPower",
- "title": "Buying Power"
}
]
}
], - "orderCustomFields": [
- {
- "id": "commission",
- "title": "Commission",
- "tooltip": "Commission Fees",
- "alignment": "right"
}
], - "orderHistoryCustomFields": [
- {
- "id": "commission",
- "title": "Commission",
- "tooltip": "Commission Fees",
- "alignment": "right"
}
], - "positionCustomFields": [
- {
- "id": "exchangeFee",
- "title": "Exchange fee",
- "tooltip": "Exchange fee for the position",
- "alignment": "right"
}, - {
- "id": "routeFee",
- "title": "Route fee",
- "tooltip": "Route fee for the position",
- "alignment": "right"
}
], - "netPositionCustomFields": [
- {
- "id": "exchangeFee",
- "title": "Exchange fee",
- "tooltip": "Exchange fee for the position",
- "alignment": "right"
}, - {
- "id": "routeFee",
- "title": "Route fee",
- "tooltip": "Route fee for the position",
- "alignment": "right"
}
], - "individualPositionCustomFields": [
- {
- "id": "exchangeFee",
- "title": "Exchange fee",
- "tooltip": "Exchange fee for the position",
- "alignment": "right"
}, - {
- "id": "routeFee",
- "title": "Route fee",
- "tooltip": "Route fee for the position",
- "alignment": "right"
}
], - "orderDialogCustomFields": {
- "comboBox": [
- {
- "id": "customInputFieldId",
- "title": "Additional parameters",
- "saveToSettings": true,
- "mutable": false,
- "forceUserEnterInitialValue": true,
- "items": [
- {
- "text": "text",
- "value": "value"
}
]
}
], - "checkbox": [
- {
- "id": "customInputFieldId",
- "title": "Additional parameter",
- "saveToSettings": true,
- "help": "Brief help text",
- "checked": false,
- "mutable": false
}
], - "textField": [
- {
- "id": "customInputFieldId",
- "title": "Additional parameters",
- "saveToSettings": true,
- "mutable": false,
- "forceUserEnterInitialValue": true,
- "placeholder": "string",
- "maskWithAsterisk": false
}
]
},
}, - "durations": [
- {
- "id": "GTT",
- "title": "Good Till Time",
- "hasDatePicker": true,
- "hasTimePicker": true,
- "default": true,
- "supportedOrderTypes": [
- "stop",
- "stoplimit"
]
}
], - "prefix": "NASDAQ",
- "isVerified": true,
- "connectWarningConfig": {
- "key": "string",
- "skippable": false
}
}
]
}
Your REST API implementation url. Change it to your real REST API url.
Get detailed user-specific information.
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (UserInfo) |
{- "s": "ok",
- "d": {
- "userId": "1466320d-7bdb-479f-aa26-fa1b99c8b2a6",
- "promotionId": "string"
}
}
Your REST API implementation url. Change it to your real REST API url.
Get the list of the instruments that are available for trading with the specified account.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | Array of objects (Instrument) |
{- "s": "ok",
- "d": [
- {
- "name": "EURUSD",
- "description": "EUR/USD",
- "minQty": 1,
- "maxQty": 100000000,
- "qtyStep": 100,
- "pipSize": 0.0001,
- "pipValue": 0.00008845,
- "minTick": 0.00001,
- "lotSize": 10,
- "currency": "EUR",
- "baseCurrency": "LTC",
- "quoteCurrency": "BTC",
- "marginRate": 0.05,
- "hasQuotes": false,
- "units": "string",
- "variableMinTick": "0.01 10 0.02 25 0.05",
- "type": "forex",
- "typespecs": "crypto,cfd",
- "ui": {
- "orderDialogCustomFields": {
- "comboBox": [
- {
- "id": "customInputFieldId",
- "title": "Additional parameters",
- "saveToSettings": true,
- "mutable": false,
- "forceUserEnterInitialValue": true,
- "items": [
- {
- "text": "text",
- "value": "value"
}
]
}
], - "checkbox": [
- {
- "id": "customInputFieldId",
- "title": "Additional parameter",
- "saveToSettings": true,
- "help": "Brief help text",
- "checked": false,
- "mutable": false
}
], - "textField": [
- {
- "id": "customInputFieldId",
- "title": "Additional parameters",
- "saveToSettings": true,
- "mutable": false,
- "forceUserEnterInitialValue": true,
- "placeholder": "string",
- "maskWithAsterisk": false
}
]
}, - "validationRules": [
- {
- "id": "slPercent",
- "options": {
- "min": 10,
- "max": 90
}
}, - {
- "id": "tpPercent",
- "options": {
- "min": 10,
- "max": 90
}
}, - {
- "id": "limitPercent",
- "options": {
- "min": 10,
- "max": 20
}
}, - {
- "id": "stopPercent",
- "options": {
- "min": 10,
- "max": 20
}
}, - {
- "id": "gsPercent",
- "options": {
- "min": 10,
- "max": 20
}
}
]
}
}
]
}
Your REST API implementation url. Change it to your real REST API url.
Get account information. Consider using stream/state instead, as it can decrease the workload on the servers.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (AccountState) |
{- "s": "ok",
- "d": {
- "balance": 41757.91,
- "unrealizedPl": 1053.02,
- "equity": 42857.56,
- "amData": [
- [
- [
- "90.22",
- "42857.56",
- "42857.56",
- "1099.65",
- "0.00",
- "41757.91"
]
]
], - "accountSummaryRowData": [
- "96883.89",
- "96837.12",
- "-46.77"
]
}
}
Your REST API implementation url. Change it to your real REST API url.
Stream account information. Unlike /stream/orders or /stream/positions the whole state object must be sent to the client every time an update occurs.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
balance required | number Account Balance. |
unrealizedPl required | number Unrealized profit/loss. |
equity | number Equity. If this field is not specified, then it is calculated as balance + unrealizedPl. |
amData | Array of Array of Array of strings non-empty Account manager data. Structure of Account manager is defined by the /config endpoint. Each element of this array is a table. |
accountSummaryRowData | Array of strings non-empty Account Summary Row data. Structure of Account Summary Row is defined by the /config endpoint. |
marginAvailable | number Current available margin for account. |
{- "balance": 41757.91,
- "unrealizedPl": 1053.02,
- "equity": 42857.56,
- "amData": [
- [
- [
- "90.22",
- "42857.56",
- "42857.56",
- "1099.65",
- "0.00",
- "41757.91"
]
]
], - "accountSummaryRowData": [
- "96883.89",
- "96837.12",
- "-46.77"
]
}
Your REST API implementation url. Change it to your real REST API url.
Get current session orders for the account. It also includes working orders from previous sessions. Filled/cancelled/rejected orders should be included in the list till the end of the session. Consider using stream/orders instead, as it can decrease the workload on the servers.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | Array of objects (Order) |
{- "s": "ok",
- "d": [
- {
- "id": "1",
- "instrument": "EURUSD",
- "qty": 100,
- "side": "buy",
- "type": "limit",
- "avgPrice": 0,
- "limitPrice": 1.14344,
- "duration": {
- "type": "gtt",
- "datetime": 1548406235
}, - "status": "working",
- "customFields": [
- {
- "id": "commission",
- "value": "1.25"
}
]
}, - {
- "id": "2",
- "instrument": "EURUSD",
- "qty": 100,
- "side": "sell",
- "type": "limit",
- "filledQty": 50,
- "avgPrice": 0,
- "limitPrice": 1.15094,
- "parentId": "1",
- "parentType": "order",
- "duration": {
- "type": "gtt",
- "datetime": 1548406235
}, - "status": "inactive",
- "customFields": [
- {
- "id": "commission",
- "value": ""
}
]
}, - {
- "id": "3",
- "instrument": "EURUSD",
- "qty": 1000000,
- "side": "sell",
- "type": "limit",
- "filledQty": 0,
- "avgPrice": 0,
- "limitPrice": 1.15094,
- "parentId": "1",
- "parentType": "order",
- "duration": {
- "type": "gtt",
- "datetime": 1548406235
}, - "status": "rejected",
- "message": {
- "text": "This order has been rejected due to the closed market",
- "type": "error"
}
}
]
}
Your REST API implementation url. Change it to your real REST API url.
Stream orders of the current session for the account. It also includes working orders from the previous sessions. A snapshot of all orders should be sent as the first message in the stream. After that the server must only send updates. It's not required to send the list of all orders in every message. If there are updated fields in an order, the server must send the whole order, including unchanged fields. If there were no updates for 5 seconds, a ping message must be sent.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
id required | string Unique identifier. | ||||||||||||||
instrument required | string Instrument name that is used on a broker's side. | ||||||||||||||
qty required | number Quantity. | ||||||||||||||
side required | string Enum: "buy" "sell" Side. | ||||||||||||||
type required | string Enum: "market" "stop" "limit" "stoplimit" Type. | ||||||||||||||
status required | string Enum: "placing" "inactive" "working" "rejected" "filled" "cancelled" String constants to describe an order status.
| ||||||||||||||
filledQty | number Filled quantity. | ||||||||||||||
avgPrice | number Average price of order fills. It should be provided for filled / partly filled orders. | ||||||||||||||
limitPrice | number Limit Price for Limit or StopLimit orders only. You should not send this field for other order types. | ||||||||||||||
stopPrice | number Stop Price for Stop or StopLimit orders only. You should not send this field for other order types. | ||||||||||||||
trailingStopPips | number Distance from the stop loss level to the current market price in pips for a position or to the order price if the parent is a stop or limit order. | ||||||||||||||
isTrailingStop | boolean If this flag is set to | ||||||||||||||
isGuaranteedStop | boolean If this flag is set to | ||||||||||||||
parentId | string Identifier of a parent order or a parent position (for position brackets) depending on | ||||||||||||||
parentType | string Enum: "order" "position" Type of order's parent. Should be set only for bracket orders. | ||||||||||||||
duration | object Expiration type and Unix timestamp date/time. | ||||||||||||||
lastModified | number Indicates the time when the order was last modified, Unix timestamp (UTC). | ||||||||||||||
customFields | Array of objects (CustomFieldsValueItem) non-empty Localized order custom fields values data.
Custom fields are configured in the /config endpoint response.
Custom | ||||||||||||||
message | object (OrderInformationalMessage) Informational message description, that will be displayed for the order in the Account manager. The message will be marked with a color, corresponding to a message type. The text message will also be displayed in the notification pop-up in case the order status gets changed. |
[- {
- "id": "1",
- "instrument": "EURUSD",
- "qty": 101,
- "side": "buy",
- "type": "limit",
- "avgPrice": 0,
- "limitPrice": 1.2093,
- "duration": {
- "type": "gtt",
- "datetime": 1548406235
}, - "status": "working",
- "customFields": [
- {
- "id": "commission",
- "value": "1.25"
}
]
}
]
Your REST API implementation url. Change it to your real REST API url.
Get positions for an account. Consider using stream/positions instead, as it can decrease the workload on the servers.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | Array of objects (Position) |
{- "s": "ok",
- "d": [
- {
- "id": "1",
- "instrument": "EURUSD",
- "qty": 1,
- "side": "buy",
- "avgPrice": 1.1347091,
- "unrealizedPl": 19.4739,
- "message": {
- "text": "You can add brackets to this position to protect it",
- "type": "Information"
}, - "customFields": [
- {
- "id": "string",
- "value": "string"
}
]
}
]
}
Your REST API implementation url. Change it to your real REST API url.
Stream positions for an account. The first message must be a snapshot including all active positions and their required fields. Subsequent messages should include only updates; there is no need to resend the full list of positions. If any fields of an active position change, the server must send an updated position with all fields included. When a position is closed, the server must send an update with position id
and qty:0
, omitting all other fields. If no updates occur within 5 seconds, a ping message must be sent.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
id required | string Unique identifier. |
instrument required | string Instrument name that is used on a broker's side. |
qty required | number Quantity. |
side required | string Enum: "buy" "sell" Side. |
avgPrice required | number Average price of position trades. |
unrealizedPl | number Unrealized (open) profit/loss. |
message | object (PositionInformationalMessage) Informational message description, that will be displayed for the position in the Account manager. The message will be marked with a color, corresponding to a message type. |
customFields | Array of objects (CustomFieldsValueItem) non-empty Localized position custom fields values data. Custom fields are configured in the /config endpoint response. |
[- {
- "id": "1",
- "instrument": "EURUSD",
- "qty": 1,
- "side": "buy",
- "avgPrice": 1.1347091,
- "unrealizedPl": 19.4739,
- "message": {
- "text": "You can add brackets to this position to protect it",
- "type": "Information"
}, - "customFields": [
- {
- "id": "customField1",
- "value": "Value of custom field"
}
]
}, - {
- "id": "2",
- "qty": 0
}
]
Your REST API implementation url. Change it to your real REST API url.
Get net positions for an account.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | Array of objects (NetPosition) |
{- "s": "ok",
- "d": [
- {
- "id": "1",
- "instrument": "EURUSD",
- "qty": 1,
- "longQty": 2,
- "shortQty": 1,
- "avgPrice": 1.23,
- "customFields": [
- {
- "id": "string",
- "value": "string"
}
], - "message": {
- "text": "You can add brackets to this position to protect it",
- "type": "Information"
}
}
]
}
Your REST API implementation url. Change it to your real REST API url.
Stream net positions for an account. A snapshot of all net positions should be sent as the first message in the stream. After that the server must only send updates. It's not required to send the list of all net positions in every message. If there are updated fields in a net position, the server must send the whole net position, including unchanged fields. The server must send a message with position id and qty
field equal to 0
if a position is closed. If there were no updates for 5 seconds, a ping message must be sent.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
id required | string Unique identifier. |
instrument required | string Instrument name that is used on a broker's side. |
qty required | number Net quantity. |
longQty | number Net quantity of long positions. |
shortQty | number Net quantity of short positions. |
avgPrice | number Average price of net position trades. |
customFields | Array of objects (CustomFieldsValueItem) non-empty Localized net position custom fields values data. Custom fields are configured in the /config endpoint response. |
message | object (PositionInformationalMessage) Informational message description, that will be displayed for the position in the Account manager. The message will be marked with a color, corresponding to a message type. |
[- {
- "id": "np1",
- "instrument": "EUR/USD",
- "qty": 90,
- "side": "buy",
- "longQty": 90,
- "shortQty": 0,
- "avgPrice": 1.1247
}, - {
- "id": "np2",
- "qty": 0
}
]
Your REST API implementation url. Change it to your real REST API url.
Get individual positions for an account
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | Array of objects (IndividualPosition) |
{- "s": "ok",
- "d": [
- {
- "id": "1",
- "instrument": "EURUSD",
- "date": "1683818630353",
- "qty": 1,
- "side": "buy",
- "price": 23.274,
- "unrealizedPl": 3.094,
- "customFields": [
- {
- "id": "string",
- "value": "string"
}
], - "message": {
- "text": "You can add brackets to this position to protect it",
- "type": "Information"
}
}
]
}
Your REST API implementation url. Change it to your real REST API url.
Stream individual positions for an account. A snapshot of all individual positions should be sent as the first message in the stream. After that the server must only send updates. It's not required to send the list of all individual positions in every message. If there are updated fields in a individual position, the server must send the whole individual position, including unchanged fields. The server must send a message with position id and qty
field equal to 0
if a position is closed. If there were no updates for 5 seconds, a ping message must be sent.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
id required | string Unique identifier. |
instrument required | string Instrument name that is used on a broker's side. |
qty required | number Quantity. |
side required | string Enum: "buy" "sell" Side. |
price required | number Individual position's price. |
date required | string The date when the individual position was opened. UNIX timestamp in milliseconds. |
unrealizedPl | number Individual position's profit/loss. |
customFields | Array of objects (CustomFieldsValueItem) non-empty Localized individual position custom fields values data. Custom fields are configured in the /config endpoint response. |
message | object (PositionInformationalMessage) Informational message description, that will be displayed for the position in the Account manager. The message will be marked with a color, corresponding to a message type. |
[- {
- "id": "ip1",
- "instrument": "EUR/USD",
- "qty": 50,
- "side": "buy",
- "price": 1.1347,
- "pl": 555.44
}, - {
- "id": "ip2",
- "instrument": "EUR/USD",
- "qty": 40,
- "side": "buy",
- "price": 1.12,
- "pl": 405.44
}, - {
- "id": "ip3",
- "qty": 0
}
]
Your REST API implementation url. Change it to your real REST API url.
Get crypto balances for an account. Balances are displayed as the first table of the Account Summary tab. Used for crypto currencies only.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | Array of objects (CryptoBalance) |
{- "s": "ok",
- "d": [
- {
- "symbol": "BTC",
- "longName": "Bitcoin",
- "total": 1000,
- "available": 10,
- "reserved": 90,
- "btcValue": 1000,
- "value": 100000,
- "valueCurrency": "USD"
}
]
}
Your REST API implementation url. Change it to your real REST API url.
Get a list of executions (i.e. fills or trades) for an account and an instrument. Executions are displayed on a chart.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
instrument required | string Broker instrument name. |
maxCount | number Maximum count of executions to return. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | Array of objects (Execution) |
{- "s": "ok",
- "d": [
- {
- "id": "EX34567",
- "instrument": "EURUSD",
- "price": 1.23564,
- "time": 1548406235,
- "qty": 1,
- "side": "buy",
- "orderId": "1263159154",
- "isClose": false,
- "positionId": "10098",
- "commission": 0.004
}
]
}
Your REST API implementation url. Change it to your real REST API url.
Get order history for an account. It is expected that returned orders will have a final status (rejected
,
filled
, cancelled
).
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
maxCount | number Maximum count of orders to return. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | Array of objects (OrderHistory) |
{- "s": "ok",
- "d": [
- {
- "id": "1",
- "instrument": "EURUSD",
- "qty": 100,
- "side": "buy",
- "type": "limit",
- "avgPrice": 0,
- "limitPrice": 1.14344,
- "duration": {
- "type": "gtt",
- "datetime": 1548406235
}, - "status": "filled"
}, - {
- "id": "2",
- "instrument": "EURUSD",
- "qty": 100,
- "side": "sell",
- "type": "limit",
- "filledQty": 50,
- "avgPrice": 0,
- "limitPrice": 1.15094,
- "parentId": "1",
- "parentType": "order",
- "duration": {
- "type": "gtt",
- "datetime": 1548406235
}, - "status": "cancelled"
}
]
}
Your REST API implementation url. Change it to your real REST API url.
Request to this endpoint will be sent when the user opens the order ticket or changes any of the symbol, order type, side and any of the custom fields in the order ticket.
Custom Order dialog
fields defined in the /accounts are sent along with the standard fields in the order object.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
instrument required | string Broker instrument name. |
side required | string Enum: "buy" "sell" Current order side in the order ticket. |
orderType required | string Enum: "market" "stop" "limit" "stoplimit" Current order type selected in the order ticket. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (GetLeverage) |
"instrument=BTCPERP&side=buy&orderType=market"
{- "s": "ok",
- "d": {
- "title": "Adjust Leverage",
- "leverage": 5,
- "min": 1,
- "max": 10,
- "step": 1
}
}
Your REST API implementation url. Change it to your real REST API url.
Will be sent when the user confirms changing the leverage.
Additional "leverage" field will be added to the payload, the value of which was set by the user.
Custom Order dialog
fields defined in the /accounts are sent along with the standard fields in the order object.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
instrument required | string Broker instrument name. |
side required | string Enum: "buy" "sell" Current order side in the order ticket. |
orderType required | string Enum: "market" "stop" "limit" "stoplimit" Current order type selected in the order ticket. |
leverage required | number Leverage value set by the user |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (SetLeverage) |
"instrument=BTCPERP&side=buy&orderType=market&leverage=25"
{- "s": "ok",
- "d": {
- "leverage": 25
}
}
Your REST API implementation url. Change it to your real REST API url.
Will be sent when the user is editing the leverage.
Custom Order dialog
fields defined in the /accounts are sent along with the standard fields in the order object.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
instrument required | string Broker instrument name. |
side required | string Enum: "buy" "sell" Current order side in the order ticket. |
orderType required | string Enum: "market" "stop" "limit" "stoplimit" Current order type selected in the order ticket. |
leverage required | number Leverage value set by user |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (PreviewLeverage) |
"instrument=BTCPERP&side=buy&orderType=market&leverage=25"
{- "s": "ok",
- "d": {
- "infos": [
- "Borrowing limit at current leverage 0.3057 BTC or 0.00000 USDT",
- "Required position margin at current leverage 0.3057 BTC"
], - "warnings": [
- "Your leverage is comparatively high. Please be aware of risks"
], - "errors": [
- "Invalid leverage value"
]
}
}
Your REST API implementation url. Change it to your real REST API url.
Place a new order. Custom Order dialog
fields defined in the /accounts are sent along with the standard fields in the order object.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
requestId | string Example: requestId=23425678343 Unique identifier for a request. |
instrument required | string Instrument. |
qty required | number The number of units. |
side required | string Enum: "buy" "sell" Side. |
type required | string Enum: "market" "stop" "limit" "stoplimit" Type. |
currentAsk required | number Current ask price for the instrument that the user sees in the order panel. |
currentBid required | number Current bid price for the instrument that the user sees in the order panel. |
limitPrice | number Limit Price for Limit or StopLimit order. |
stopPrice | number Stop Price for Stop or StopLimit order. |
durationType | string Duration ID (if supported). |
durationDateTime | number Expiration datetime Unix timestamp (if supported by duration type). |
stopLoss | number StopLoss price (if supported). |
trailingStopPips | number Distance from the stop loss level to the current market price in pips (if supported by the broker). |
guaranteedStop | number Stop price of Guaranteed Stop bracket (if supported). |
takeProfit | number TakeProfit price (if supported). |
digitalSignature | string Digital signature (if supported). |
confirmId | string (ConfirmId) An optional order identifier, which was received in the /previewOrder response. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object |
"instrument=EURUSD&side=buy&type=limit&qty=1&limitPrice=1.23456&stopPrice=0&durationType=gtt&durationDateTime=1548406235&stopLoss=0&trailingStopPips=0&guaranteedStop=0&takeProfit=0&digitalSignature=954345868¤tAsk=1.25¤tBid=1.23&confirmId=112358"
{- "s": "ok",
- "d": {
- "orderId": "441fdB023",
- "transactionId": "1adf4578-cdf"
}
}
Your REST API implementation url. Change it to your real REST API url.
Modify an existing order. Custom Order dialog
fields defined in the /accounts are sent along with the standard fields in the order object.
accountId required | string Account identifier. |
orderId required | string Order identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
qty required | number The number of units. |
limitPrice | number Limit Price for Limit or StopLimit order. |
stopPrice | number Stop Price for Stop or StopLimit order. |
durationType | string Duration ID (if supported). |
durationDateTime | number Expiration datetime Unix timestamp (if supported by duration type). |
stopLoss | number StopLoss price (if supported). |
trailingStopPips | number Distance from the stop loss level to the current market price in pips (if supported by the broker). |
guaranteedStop | number Stop price of Guaranteed Stop bracket (if supported). |
takeProfit | number TakeProfit price (if supported). |
digitalSignature | string Digital signature (if supported). |
currentAsk | number Current ask price for the instrument that the user sees in the order panel. |
currentBid | number Current bid price for the instrument that the user sees in the order panel. |
confirmId | string (ConfirmId) An optional order identifier, which was received in the /previewOrder response. |
response
s required | string Value: "ok" Status will always be |
"qty=1&limitPrice=1.23456&stopPrice=0&durationType=gtt&durationDateTime=1548406235&stopLoss=0&trailingStopPips=0&guaranteedStop=0&takeProfit=0&digitalSignature=954345868¤tAsk=1.25¤tBid=1.23&confirmId=112358"
{- "s": "ok"
}
Your REST API implementation url. Change it to your real REST API url.
Cancel an existing order.
accountId required | string Account identifier. |
orderId required | string Order identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string Value: "ok" Status will always be |
{- "s": "ok"
}
Your REST API implementation url. Change it to your real REST API url.
Get estimated cost, commission and other information for an order without the order actually being placed or modified. This information is displayed in the Order Ticket Preview.
This endpoint is used if supportPlaceOrderPreview and/or supportModifyOrderPreview flag is true
.
TradingView displays the following information by itself: symbol, bid/ask, order type, side, quantity, price (except market orders), stop loss, take profit and currency.
Custom Order dialog
fields defined in the /accounts are sent along with the standard fields in the order object.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
instrument required | string Instrument. |
qty required | number The number of units. |
side required | string Enum: "buy" "sell" Side. |
type required | string Enum: "market" "stop" "limit" "stoplimit" Type. |
limitPrice | number Limit Price for Limit or StopLimit order. |
stopPrice | number Stop Price for Stop or StopLimit order. |
durationType | string Duration ID (if supported). |
durationDateTime | number Expiration datetime Unix timestamp (if supported by duration type). |
stopLoss | number StopLoss price (if supported). |
trailingStopPips | number Distance from the stop loss level to the current market price in pips (if supported by the broker). |
guaranteedStop | number Stop price of Guaranteed Stop bracket (if supported). |
takeProfit | number TakeProfit price (if supported). |
digitalSignature | string Digital signature (if supported). |
currentAsk | number Current ask price for the instrument that the user sees in the order panel. |
currentBid | number Current bid price for the instrument that the user sees in the order panel. |
id | string Identifier of the order that is being modified by the user. This parameter is sent only if |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (PreviewOrder) |
"qty=1&limitPrice=1.23456&stopPrice=0&durationType=gtt&durationDateTime=1548406235&stopLoss=0&trailingStopPips=0&guaranteedStop=0&takeProfit=0&digitalSignature=954345868¤tAsk=1.25¤tBid=1.23&instrument=EURUSD&side=buy&type=limit&id=21698953"
{- "s": "ok",
- "d": {
- "confirmId": 112358,
- "sections": [
- {
- "header": "Estimated",
- "rows": [
- {
- "title": "Estimated Commission",
- "value": 0.01
}, - {
- "title": "Estimated Price",
- "value": 4091
}
]
}, - {
- "rows": [
- {
- "title": "Margin Value",
- "value": 12100
}, - {
- "title": "Time In Force",
- "value": "DAY"
}
]
}
], - "warnings": [
- "Estimated money impact is for main order only.",
- "Order can be executed outside regular trading hours.",
- [
- "Click ",
- " to read the terms and conditions"
]
], - "errors": [
- "Failed to build order confirmation."
]
}
}
Your REST API implementation url. Change it to your real REST API url.
Retrieves order data displayed in the Order Ticket.
This information is displayed in the Order Info section.
This endpoint is used if supportCustomOrderInfo
flag is set to true
.
accountId required | string Account identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
instrument required | string Instrument. |
qty required | number The number of units. |
side required | string Enum: "buy" "sell" Side. |
type required | string Enum: "market" "stop" "limit" "stoplimit" Type. |
id | string Identifier of the order. |
limitPrice | number Limit Price for Limit or StopLimit order. |
stopPrice | number Stop Price for Stop or StopLimit order. |
durationType | string Duration ID (if supported). |
durationDateTime | number Expiration datetime Unix timestamp (if supported by duration type). |
stopLoss | number StopLoss price (if supported). |
trailingStopPips | number Distance from the stop loss level to the current market price in pips (if supported by the broker). |
guaranteedStop | number Stop price of Guaranteed Stop bracket (if supported). |
takeProfit | number TakeProfit price (if supported). |
digitalSignature | string Digital signature (if supported). |
currentAsk | number Current ask price for the instrument that the user sees in the order panel. |
currentBid | number Current bid price for the instrument that the user sees in the order panel. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (OrderInfo) |
"id=21698953&instrument=EURUSD&side=buy&type=limit&qty=1&limitPrice=1.23456&stopPrice=0&durationType=gtt&durationDateTime=1548406235&stopLoss=0&trailingStopPips=0&guaranteedStop=0&takeProfit=0&digitalSignature=954345868¤tAsk=1.25¤tBid=1.23"
{- "s": "ok",
- "d": {
- "rows": [
- {
- "title": "string",
- "value": "string",
- "currency": "USD"
}
], - "disclaimer": "string"
}
}
Your REST API implementation url. Change it to your real REST API url.
Modify an existing position stop loss or take profit or both.
accountId required | string Account identifier. |
positionId required | string Position identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
stopLoss | number StopLoss price. |
trailingStopPips | number Distance from the stop loss level to the order price in pips (if supported). |
guaranteedStop | number Stop price of Guaranteed Stop bracket (if supported). |
takeProfit | number TakeProfit price. |
currentAsk | number Current ask price for the instrument that the user sees in the order panel. |
currentBid | number Current bid price for the instrument that the user sees in the order panel. |
side | string Enum: "buy" "sell" New side of the position. This parameter is used to reverse the position,
if the |
response
s required | string Value: "ok" Status will always be |
"stopLoss=1.283568&trailingStopPips=0&guaranteedStop=0&takeProfit=1.294436¤tAsk=1.287367¤tBid=1.28554&side=buy"
{- "s": "ok"
}
Your REST API implementation url. Change it to your real REST API url.
Close an existing position.
accountId required | string Account identifier. |
positionId required | string Position identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
amount | number Amount to close. This property is used if supportPartialClosePosition flag is |
response
s required | string Value: "ok" Status will always be |
"amount=5"
{- "s": "ok"
}
Your REST API implementation url. Change it to your real REST API url.
Close an existing net position and all of the individual positions on the symbol.
accountId required | string Account identifier. |
netPositionId required | string Net position identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
response
s required | string Value: "ok" Status will always be |
{- "s": "ok"
}
Your REST API implementation url. Change it to your real REST API url.
Modify an existing individual position stop loss or take profit or both.
accountId required | string Account identifier. |
individualPositionId required | string Individual position identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
stopLoss | number StopLoss price. |
trailingStopPips | number Distance from the stop loss level to the order price in pips (if supported). |
guaranteedStop | number Stop price of Guaranteed Stop bracket (if supported). |
takeProfit | number TakeProfit price. |
currentAsk | number Current ask price for the instrument that the user sees in the order panel. |
currentBid | number Current bid price for the instrument that the user sees in the order panel. |
response
s required | string Value: "ok" Status will always be |
"stopLoss=1.283568&trailingStopPips=0&guaranteedStop=0&takeProfit=1.294436¤tAsk=1.287367¤tBid=1.28554"
{- "s": "ok"
}
Your REST API implementation url. Change it to your real REST API url.
Close an individual position.
accountId required | string Account identifier. |
individualPositionId required | string Individual position identifier. |
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
amount | number Amount to close. This property is used if supportPartialCloseIndividualPosition flag is |
response
s required | string Value: "ok" Status will always be |
"amount=5"
{- "s": "ok"
}
Your REST API implementation url. Change it to your real REST API url.
Endpoint is used to collect performance and statistical data for a particular request.
Applies to the following endpoints:
Place order: /placeOrder
Modify order: /modifyOrder
Cancel order: /cancelOrder
Modify position: /modifyPosition
Close position: /closePosition
To enable latency tracking functionality the supportTrackLatency
flag should be set to true in the account config. Please see the /accounts endpoint.
accountId required | string Account identifier. |
transactionId required | string Request identifier for which the performance data is being sent. |
transactionType required | string Enum: "place_order" "modify_order" "cancel_order" "modify_position" "close_position" "modify_individual_position" "close_individual_position" "close_net_position" Type of the transaction |
instrument required | string Instrument. |
side required | string Enum: "buy" "sell" Side. |
ask required | number Current ask price for the instrument that the user sees in the order panel. |
bid required | number Current bid price for the instrument that the user sees in the order panel. |
timestamp required | number Timestamp of the price quote user has seen on the UI. In milliseconds. |
roundTripDuration required | number Request duration in milliseconds. |
qty | number Placed or modified orders quantity. Not applied to Cancel order / modify position / close position requests. |
roundTripStartTime | number Timestamp in UTC when the request round trip started. In milliseconds. |
response
s required | string Value: "ok" Status will always be |
"transactionId=string&transactionType=place_order&instrument=string&qty=0&side=buy&ask=1.287367&bid=1.28554×tamp=1548406235000&roundTripStartTime=1548406230000&roundTripDuration=183"
{- "s": "ok"
}
Your REST API implementation url. Change it to your real REST API url.
Get current prices of the instrument.
The bid
and ask
fields are required, and the buyPipValue
and sellPipValue
fields
are desirable if the account currency is different from the currency of the instrument.
The same values should be sent for these fields if different values for buying and selling are not supported.
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
accountId required | string Account identifier. |
symbols required | string Comma separated symbol list. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | Array of objects (Quotes) non-empty |
{- "s": "ok",
- "d": [
- {
- "s": "ok",
- "n": "EURUSD",
- "v": {
- "ask": 1.13836,
- "bid": 1.13834,
- "buyPipValue": 1,
- "sellPipValue": 1,
- "hardToBorrow": false,
- "notShortable": false,
- "halted": false
}
}
]
}
Your REST API implementation url. Change it to your real REST API url.
Stream current prices of the instrument.
The bid
and ask
fields are required, and the buyPipValue
and sellPipValue
fields
are desirable if the account currency is different from the currency of the instrument.
The same values should be sent for these fields if different values for buying and selling are not supported.
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
accountId required | string Account identifier. |
symbols required | string Comma separated symbol list. |
response
n required | string Symbol name. Should be equal to the requested one. |
v required | object (SingleQuote) Price and restriction data for an instrument. |
s | string (Status) Enum: "ok" "error" |
[- {
- "s": "ok",
- "n": "EURUSD",
- "v": {
- "ask": 1.13836,
- "bid": 1.13834,
- "buyPipValue": 1,
- "sellPipValue": 1,
- "hardToBorrow": false,
- "notShortable": false,
- "halted": false
}
}
]
Your REST API implementation url. Change it to your real REST API url.
Get current depth of market for the instrument. Optional.
locale required | string (Locale) Enum: "ar_AE" "br" "cs" "de_DE" "el" "en" "es" "fr" "he_IL" "hu_HU" "id" "in" "it" "ja" "kr" "ms_MY" "nl_NL" "pl" "ro" "ru" "th_TH" "tr" "uk" "vi_VN" "zh_CN" "zh_TW" Locale (language) id. |
accountId required | string Account identifier. |
symbol required | string Instrument name. |
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (Depth) Depth of market for an instrument. |
{- "s": "ok",
- "d": {
- "asks": [
- [
- 45.1,
- 100
], - [
- 48.4,
- 120
]
], - "bids": [
- [
- 24.7,
- 80
], - [
- 35.6,
- 30
]
]
}
}
Your REST API implementation url. Change it to your real REST API url.
Get a list of possible groups of symbols. A group is a set of symbols that share a common access level. Any user can have access to any number of such groups. In case your data integration does not require separating symbols into several groups, implementing this endpoint is still mandatory. You will be able to add a single group and place all symbols there.
IMPORTANT: Please plan your symbol grouping carefully. Groups cannot be deleted, you can only remove all the symbols from there.
LIMITATIONS: Each integration is limited to have up to 10 symbol groups. Each symbol group is limited to have up to 10K symbols in it. You cannot put the same symbol into 2 different groups.
This endpoint allows you to specify a list of groups, and the /permissions endpoint specifies which groups are available for the certain user.
When TradingView user logs into his broker account - he will gain access to one or more groups, depending on the /permissions endpoint.
At the /symbol_info endpoint TradingView adds the GET argument group
with the name of the group. Thus, TradingView will receive information about which group each symbol belongs to.
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (GroupList) |
{- "s": "ok",
- "d": {
- "groups": [
- {
- "id": "broker_stocks"
}, - {
- "id": "broker_futures"
}, - {
- "id": "broker_forex"
}, - {
- "id": "broker_crypto"
}
]
}
}
Your REST API implementation url. Change it to your real REST API url.
Get a list of symbol groups allowed for the user. It is only required if you use groups of symbols to restrict access to instrument's data.
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (PermissionGroups) |
{- "s": "ok",
- "d": {
- "groups": [
- "broker_futures",
- "broker_stocks",
- "broker_forex"
]
}
}
Your REST API implementation url. Change it to your real REST API url.
Get a list of possible groups of symbols. A group is a set of symbols that share a common access level. Any user can have access to any number of such groups. In case your data integration does not require separating symbols into several groups, implementing this endpoint is still mandatory. You will be able to add a single group and place all symbols there.
IMPORTANT: Please plan your symbol grouping carefully. Groups cannot be deleted, you can only remove all the symbols from there.
LIMITATIONS: Each integration is limited to have up to 10 symbol groups. Each symbol group is limited to have up to 10K symbols in it. You cannot put the same symbol into 2 different groups.
This endpoint allows you to specify a list of groups, and the /permissions endpoint specifies which groups are available for the certain user.
When TradingView user logs into his broker account - he will gain access to one or more groups, depending on the /permissions endpoint.
At the /symbol_info endpoint TradingView adds the GET argument group
with the name of the group. Thus, TradingView will receive information about which group each symbol belongs to.
response
s required | string (OkStatus) Value: "ok" Status will always be |
d required | object (GroupList) |
{- "s": "ok",
- "d": {
- "groups": [
- {
- "id": "broker_stocks"
}, - {
- "id": "broker_futures"
}, - {
- "id": "broker_forex"
}, - {
- "id": "broker_crypto"
}
]
}
}
Your REST API implementation url. Change it to your real REST API url.
Get a list of all instruments.
group | string ID of a symbol group. If it presents then only symbols that belong to this group should be returned. Possible values are provided by the /groups endpoint. It is only required if you use groups of symbols to restrict access to instrument's data. |
response
s required | string Value: "ok" Status will always be |
symbol required | Array of strings non-empty It is a symbol name which is a string that users see. Also, the symbol name is used for data requests
if you are not using tickers. |
description required | Array of strings Description of a symbol. Will be displayed in the chart legend for this symbol. |
currency required | Array of strings Nullable Default: null Symbol currency, also named as counter currency. If a symbol is a currency pair, then the currency field has
to contain the second currency of this pair. For example, |
exchange-listed required | Array of strings Short name of exchange where this symbol is listed. |
exchange-traded required | Array of strings Short name of exchange where this symbol is traded. |
minmovement required | Array of numbers Minimal integer price change. |
pricescale required | Array of numbers Indicates how many decimal points the price has. For example, if the price has 2 decimal points (ex., 300.01),
then |
timezone required | Array of strings Items Enum: "America/New_York" "America/Los_Angeles" "America/Chicago" "America/Phoenix" "America/Toronto" "America/Vancouver" "America/Argentina/Buenos_Aires" "America/El_Salvador" "America/Sao_Paulo" "America/Bogota" "Europe/Moscow" "Europe/Athens" "Europe/Berlin" "Europe/London" "Europe/Madrid" "Europe/Paris" "Europe/Warsaw" "Australia/Sydney" "Australia/Brisbane" "Australia/Adelaide" "Australia/ACT" "Asia/Almaty" "Asia/Ashkhabad" "Asia/Tokyo" "Asia/Taipei" "Asia/Singapore" "Asia/Shanghai" "Asia/Seoul" "Asia/Tehran" "Asia/Dubai" "Asia/Kolkata" "Asia/Hong_Kong" "Asia/Bangkok" "Pacific/Auckland" "Pacific/Chatham" "Pacific/Fakaofo" "Pacific/Honolulu" "America/Mexico_City" "Africa/Johannesburg" "Asia/Kathmandu" "US/Mountain" "Etc/UTC" Timezone of the exchange for this symbol. We expect to get the name of the time zone in olsondb format. |
type required | Array of strings (SymbolType) Items Enum: "stock" "dr" "right" "bond" "warrant" "structured" "index" "forex" "futures" "spot" "swap" "commodity" "crypto" "cfd" "option" Symbol type (forex/stock etc.). Deprecated values: crypto, cfd |
session-regular required | Array of strings Session time format is HHMM-HHMM. E.g., a session that starts at 9:30 am and ends at 4:00 pm should look like |
base-currency | Array of strings Nullable Default: null For currency pairs only. This field contains the first currency of the pair. For example, base currency for
|
minmovement2 | Array of numbers This is a number for complex price formatting cases. The default value is |
fractional | Array of booleans Boolean showing whether this symbol wants to have complex price
formatting (see |
root | Array of strings Nullable Default: null Root of the features. It's required for futures symbol types only. Provide a null value for other symbol types. |
root-description | Array of strings Nullable Default: null Short description of the futures root that will be displayed in the symbol search. It's required for futures only. Provide a null value for other symbol types. |
has-intraday | Array of booleans Boolean value showing whether the symbol includes intraday (minutes)
historical data. If it's |
has-no-volume | Array of booleans Boolean showing whether the symbol includes volume data or not. The default value is |
typespecs | Array of strings Nullable An array of strings. Each element can be a list of comma separated values. Applicable values:
|
volume-type | Array of strings Nullable Items Enum: "base" "quote" "tick" "contract" The volume type of the symbol.
Required if the |
is-cfd | Array of booleans Deprecated Boolean value showing whether the symbol is CFD. The base instrument type is set using the type field.
Deprecated. Use |
ticker | Array of strings This is a unique identifier for this particular symbol in your symbology. If you specify this property then its value will be used for all data requests for this symbol. |
session-extended | Array of strings An extended session, includes |
session-premarket | Array of strings An additional session before |
session-postmarket | Array of strings An additional session after the |
has-daily | Array of booleans The boolean value showing whether data feed has its own daily
resolution bars or not. If |
has-weekly-and-monthly | Array of booleans The boolean value showing whether data feed has its own weekly
and monthly resolution bars or not. If |
pointvalue | Array of numbers The currency value of a single whole unit price change in the instrument's currency.
If the value is not provided it is assumed to be |
expiration | Array of numbers Nullable Default: null Expiration of the futures in the following format: YYYYMMDD. Required for futures type symbols only. |
bar-source | Array of strings Items Enum: "bid" "ask" "mid" "trade" The principle of building bars. The default value is |
bar-transform | Array of strings Items Enum: "none" "openprev" "prevopen" The principle of bar alignment. The default value is |
bar-fillgaps | Array of booleans Is used to create the zero-volume bars in the absence of any trades
(i.e. bars with zero volume and equal OHLC values ).
The default value is |
isin | Array of strings International Securities Identification Number. It's needed for classic stock instruments only. |
wkn | Array of strings German Securities Identification Code. It's needed for classic German stock instruments only. |
{- "s": "ok",
- "symbol": [
- "VIXG2019",
- "AAPLE",
- "EURUSD",
- "BTCUSD"
], - "description": [
- "Volatility Index",
- "Apple Inc",
- "EUR/USD",
- "Bitcoin / US Dollar"
], - "currency": [
- "USD",
- "USD",
- "USD",
- "USD"
], - "base-currency": [
- null,
- null,
- "EUR",
- "BTC"
], - "exchange-listed": [
- "CBOE",
- "NASDAQ",
- "FOREX",
- "CRYPTO"
], - "exchange-traded": [
- "CBOE",
- "NASDAQ",
- "FOREX",
- "CRYPTO"
], - "minmovement": [
- 1,
- 1,
- 1,
- 1
], - "minmovement2": [
- 0,
- 0,
- 0,
- 0
], - "fractional": [
- false,
- false,
- false,
- false
], - "pricescale": [
- 100,
- 100,
- 100000,
- 100
], - "root": [
- "VIX",
- null,
- null,
- null
], - "root-description": [
- "Volatility Index",
- null,
- null,
- null
], - "has-intraday": [
- true,
- true,
- true,
- true
], - "has-no-volume": [
- false,
- false,
- true,
- false
], - "type": [
- "futures",
- "stock",
- "forex",
- "spot"
], - "typespecs": [
- "cfd",
- "cfd",
- null,
- "crypto,cfd"
], - "volume-type": [
- "base",
- "quote",
- "tick",
- null
], - "is-cfd": [
- true,
- true,
- false,
- true
], - "ticker": [
- "VIXG2019",
- "AAPLE",
- "EURUSD",
- "BTCUSD"
], - "timezone": [
- "America/New_York",
- "America/New_York",
- "America/New_York",
- "Etc/UTC"
], - "session-regular": [
- "0000-2359:23456",
- "0930-1600",
- "1700-1700",
- "24x7"
], - "session-extended": [
- "0000-2359:23456",
- "0400-2000",
- "1700-1700",
- "24x7"
], - "session-premarket": [
- null,
- "0400-0930",
- null,
- null
], - "session-postmarket": [
- null,
- "1600-2000",
- null,
- null
], - "has-daily": [
- true,
- true,
- true,
- false
], - "has-weekly-and-monthly": [
- false,
- false,
- false,
- false
], - "pointvalue": [
- 10,
- 1,
- 0.00001,
- 1
], - "expiration": [
- 20190213,
- null,
- null,
- null
], - "bar-source": [
- "trade",
- "bid",
- "ask",
- "trade"
], - "bar-transform": [
- "openprev",
- "openprev",
- "none",
- "none"
], - "bar-fillgaps": [
- "true",
- "true",
- "false",
- "false"
], - "isin": [
- "ZAE000190252",
- "ZAE0001201977",
- "ZAE000567432",
- null
], - "wkn": [
- "A12ABB",
- "A66RTT",
- "A13DDE",
- null
]
}
Your REST API implementation url. Change it to your real REST API url.
Request for history bars. Each property of the response object is treated as a table column.
Data should meet the following requirements:
Bar time for daily bars should be 00:00 UTC and is expected to be a trading day (not a day when the session starts).
Bar time for monthly bars should be 00:00 UTC and is the first trading day of the month.
If there is no data in the requested time period, you should return an empty response:
{"s":"ok","t":[],"o":[],"h":[],"l":[],"c":[],"v":[]}
symbol required | string Symbol name or ticker. |
resolution required | string Symbol resolution. Possible resolutions are daily ( |
from required | number Unix timestamp (UTC) of the leftmost required bar, including |
to required | number Unix timestamp (UTC) of the rightmost required bar, including |
countback | number Deprecated Number of bars (higher priority than |
response
s required | string Value: "ok" Status will always be |
t required | Array of numbers Bar time, Unix timestamp (UTC). Daily bars should only have the date part, time should be 0. |
o required | Array of numbers Open price. |
h required | Array of numbers High price. |
l required | Array of numbers Low price. |
c required | Array of numbers Close price. |
v required | Array of numbers Volume. |
{- "s": "ok",
- "t": [
- 1547942400,
- 1547942460,
- 1547942520
], - "o": [
- 3667,
- 3662.25,
- 3664.29
], - "h": [
- 3667.24,
- 3664.47,
- 3664.3
], - "l": [
- 3661.55,
- 3661.9,
- 3662.43
], - "c": [
- 3662.25,
- 3663.13,
- 3664.01
], - "v": [
- 34.7336,
- 2.4413,
- 11.7075
]
}
Your REST API implementation url. Change it to your real REST API url.
Stream of prices. Server constantly keeps the connection alive. If the
connection is broken - the server constantly tries to restore it.
TradingView establishes up to 4 simultaneous connections to this endpoint and
expects to get the same data to all of them.
Transfer mode is chunked encoding
. The data feed should set 'Transfer-Encoding:
chunked'
and make sure that all intermediate proxies are set to use this
mode. All messages are to be ended with \n
. Data stream should contain
real-time data only. It shouldn't contain snapshots of data.
Data feed should provide trades and quotes:
0
, except for the correction. In that case size can be 0
.The broker must remove unnecessary restrictions (firewall, rate limits, etc.) for the set of IP addresses of our servers.
StreamingHeartbeatResponse
is a technical message that prevents the feed from unsubscribing from streaming.
It doesn't affect the price data and should be sent to /streaming every 5 seconds by default. The message
can be used, for example, when the trading session is closed on weekends or in case of low liquidity
on the exchange when TradingView does not receive price updates for a long time.
Please note, that StreamingAskResponse
and StreamingBidResponse
are deprecated.
The StreamingQuoteResponse
should be used to provide ask / bid data.
response
f required | string Should always be |
id required | string Symbol. |
t required | number Unix time UTC. |
ap required | number Best ask price. |
as required | number Best ask size. |
bp required | number Best bid price. |
bs required | number Best bid size. |
{- "f": "q",
- "id": "EURUSD",
- "t": 1547942400,
- "ap": 1.47245,
- "as": 100,
- "bp": 1.47245,
- "bs": 100
}