From a2e08b8133fee44e467b650d96d8b484cfb90ee0 Mon Sep 17 00:00:00 2001 From: Anastasiia Chuprina Date: Mon, 6 Mar 2023 16:13:35 +0300 Subject: [PATCH 1/2] WRT-347 Rename file --- source/Integration_overview.rst | 2 +- source/trading/{Configuring.rst => Configuration.rst} | 7 ++++--- source/trading/index.rst | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) rename source/trading/{Configuring.rst => Configuration.rst} (96%) diff --git a/source/Integration_overview.rst b/source/Integration_overview.rst index 9ac2b7c..6b1ced6 100644 --- a/source/Integration_overview.rst +++ b/source/Integration_overview.rst @@ -104,7 +104,7 @@ Features of the implementation of some endpoints Processed once at login: `/config`_, `/accounts`_, `/instruments`_, `/ordersHistory`_, `/permissions`_. The rest of the requests are sent either on a regular basis or are the result of user actions. In the first case, their -frequency is set using :ref:`trading-configuring-pulling-intervals` in the `/config`_. In the second case, it happens in +frequency is set using :ref:`trading-configuration-pulling-intervals` in the `/config`_. In the second case, it happens in the `Trading`_ section. In some cases, the listed endpoints may not be implemented. diff --git a/source/trading/Configuring.rst b/source/trading/Configuration.rst similarity index 96% rename from source/trading/Configuring.rst rename to source/trading/Configuration.rst index 3f4b6ff..39de329 100644 --- a/source/trading/Configuring.rst +++ b/source/trading/Configuration.rst @@ -9,8 +9,8 @@ .. _`/quotes`: https://www.tradingview.com/rest-api-spec/#operation/getQuotes .. _`/state`: https://www.tradingview.com/rest-api-spec/#operation/getState -Configuring ------------ +Configuration +-------------- .. .. contents:: :local: .. :depth: 1 @@ -30,10 +30,11 @@ All these requests are executed once when logging into the broker integration. T same UI elements is as follows: *broker*, *account*, *instrument*. Each subsequent configuration overrides the previous one. -.. _trading-configuring-pulling-intervals: +.. _trading-configuration-pulling-intervals: Pulling intervals ................. + Pulling intervals are designed to determine the frequency of requests to a specific endpoint. They are configurable at the broker level only. Consider the infrastructure when configuring the intervals to avoid dropping connections on the broker's side. High values in requests can cause rate limit errors. diff --git a/source/trading/index.rst b/source/trading/index.rst index a9371b9..ce9bf72 100644 --- a/source/trading/index.rst +++ b/source/trading/index.rst @@ -4,7 +4,7 @@ Trading integration .. toctree:: :maxdepth: 2 - Configuring + Configuration Concepts Authentication UI_elements From 207668ad3bf36cfb5a3689a421664f8a0914092b Mon Sep 17 00:00:00 2001 From: Anastasiia Chuprina Date: Mon, 6 Mar 2023 17:27:04 +0300 Subject: [PATCH 2/2] WRT-347 Fix description --- source/trading/Configuration.rst | 44 +++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/source/trading/Configuration.rst b/source/trading/Configuration.rst index 39de329..a183089 100644 --- a/source/trading/Configuration.rst +++ b/source/trading/Configuration.rst @@ -35,18 +35,32 @@ previous one. Pulling intervals ................. -Pulling intervals are designed to determine the frequency of requests to a specific endpoint. They are configurable -at the broker level only. Consider the infrastructure when configuring the intervals to avoid dropping -connections on the broker's side. High values in requests can cause rate limit errors. - -TradingView does not strictly limit the amount of pulling intervals for requests, however, it is not recommended -to set their values higher than the maximum recommended. Because the TradingView UI can become -unresponsive to the user experience, which can lead to user complaints. - -Matching fields to requests: - -* ``quotes`` --- the `/quotes`_ and `/depth`_ requests (max 1000ms) -* ``accountManager`` --- the `/state`_ request (max 1500ms) -* ``orders`` --- the `/orders`_ request (max 1000ms) -* ``positions`` --- the `/positions`_ request (max 1500ms) -* ``balances`` --- the `/balances`_ request (max 1500ms) +Pulling intervals are designed to determine the frequency of requests to a specific endpoint. +It is the only way TradingView can track if anything was changed on the user's account. +If your integration doesn't comply with the request frequency, +TradingView UI can become unresponsive and display outdated information to users. +This may lead to user complaints. + +Pulling intervals must be configurable at the broker's level only and defined in the ``pullingInterval`` object of `/config`_. +Consider the infrastructure when configuring the intervals to avoid dropping connections on the broker's side. +High values in requests can cause rate-limit errors. + +The ``pullingInterval`` object has the following fields: + ++--------------------+--------------------------------------------+---------------+-----------+ +| Field | Description | Default value | Max value | ++====================+============================================+===============+===========+ +| ``quotes`` | For the `/quotes`_ and `/depth`_ requests. | 500 ms | 1000 ms | ++--------------------+--------------------------------------------+---------------+-----------+ +| ``orders`` | For the `/orders`_ requests. | 500 ms | 1000 ms | ++--------------------+--------------------------------------------+---------------+-----------+ +| ``accountManager`` | For the `/state`_ requests. | 500 ms | 1500 ms | ++--------------------+--------------------------------------------+---------------+-----------+ +| ``positions`` | For the `/positions`_ requests. | 1000 ms | 1500 ms | ++--------------------+--------------------------------------------+---------------+-----------+ +| ``balances`` | For the `/balances`_ requests. | 1000 ms | 1500 ms | ++--------------------+--------------------------------------------+---------------+-----------+ + +.. important:: + TradingView does not strictly limit the number of pulling intervals for requests, however, + it is not recommended to set their values higher than the maximum recommended.