OPEN-SOURCE SCRIPT
Обновлено Index Line on Chart With Top/Bottom Margins (MarketSurge)

Adds an index line to the chart, along with configurable top/bottom margins. MarketSurge has the line in the top third/quarter of the chart area.
This script is unfortunately quite slow/laggy when zooming/scrolling. Unfortunately that is unavoidable, because to scale the visible portion of the index line it needs to access `left_visible_bar_time` and `right_visible_bar_time`. There are two issues with that. First, if a script access those variables, then it is reloaded on every zoom/scroll. So every time the chart is zoomed/scrolled, this script is reloaded and has to recalculate and draw everything from scratch. Second, TradingView has a couple of seconds delay built in before it will initiate the reload, presumably to allow the zoom/scroll to settle, and to avoid reloading on every zoom/scroll intermediate step. But that makes this script even less responsive, of course.
Tip: when using this indicator, you may also want to change the main chart's top margin to push the main plot down a bit (that setting does not affect the position of this indicator). See the "Margins" section in the Chart Setting's "Canvas" tab.
This script is unfortunately quite slow/laggy when zooming/scrolling. Unfortunately that is unavoidable, because to scale the visible portion of the index line it needs to access `left_visible_bar_time` and `right_visible_bar_time`. There are two issues with that. First, if a script access those variables, then it is reloaded on every zoom/scroll. So every time the chart is zoomed/scrolled, this script is reloaded and has to recalculate and draw everything from scratch. Second, TradingView has a couple of seconds delay built in before it will initiate the reload, presumably to allow the zoom/scroll to settle, and to avoid reloading on every zoom/scroll intermediate step. But that makes this script even less responsive, of course.
Tip: when using this indicator, you may also want to change the main chart's top margin to push the main plot down a bit (that setting does not affect the position of this indicator). See the "Margins" section in the Chart Setting's "Canvas" tab.
Информация о релизе
Change the default color of the line so it is visible on both dark and light themed TradingView.Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.