ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

How to Plot Horizontal Lines in TradingView Using Pine Script

Автор: vlogize

Загружено: 2025-05-27

Просмотров: 21

Описание: Learn how to plot custom horizontal lines in TradingView without displaying the baseline using Pine Script. Perfect for traders looking to visualize dynamic levels with ease!
---
This video is based on the question https://stackoverflow.com/q/65375170/ asked by the user 'Dutch Tacos' ( https://stackoverflow.com/u/14857494/ ) and on the answer https://stackoverflow.com/a/65379830/ provided by the user 'e2e4' ( https://stackoverflow.com/u/13723165/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions.

Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: Tradingview Pinescript quick q

Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l...
The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license.

If anything seems off to you, please feel free to write me at vlogize [AT] gmail [DOT] com.
---
How to Plot Horizontal Lines in TradingView Using Pine Script: A Simple Guide

TradingView is a powerful tool for traders who want to analyze financial markets through charts. A common requirement for traders is to visually represent specific price levels on their charts. Often, traders want to plot values around a particular baseline level without explicitly showing that baseline. This guide will guide you through a simple solution to achieve this using Pine Script.

Understanding the Problem

Imagine you want to plot a baseline horizontal line at a specific value (let's say 1900). You also want to add two more lines just above and below this value (at 1901 and 1899) while keeping the baseline invisible. The main questions arise:

How do you take a user-defined value (the baseline)?

How do you plot additional lines around that value without showing the baseline line itself?

Solution Explained

The solution is straightforward and involves a few simple lines of Pine Script code. Below, we will break down the steps required to create this functionality in TradingView.

1. Setting Up the Script

First, you need to define your script using the right version and give it an appropriate name. In this example, we will use version 4 of Pine Script and name our script "Baseline + -1". Here’s how you do that:

[[See Video to Reveal this Text or Code Snippet]]

2. Creating a User Input for the Baseline

Next, you want to allow users to input a baseline value. This input can be changed dynamically, which makes your script flexible. Here is how you define this input:

[[See Video to Reveal this Text or Code Snippet]]

In this line:

var float declares a variable that holds a floating-point number.

input(1900, "Baseline level") sets the default baseline value to 1900, and the text "Baseline level" is what users will see when they interact with the input.

3. Plotting the Lines Around the Baseline

Now, to plot the two lines (at 1901 and 1899), you simply add and subtract 1 from your baseline variable. You will achieve this with the plot function in Pine Script:

[[See Video to Reveal this Text or Code Snippet]]

These lines will plot:

The first line at one point above the baseline (1901).

The second line at one point below the baseline (1899).

4. Making the Baseline Invisible

If you decide later that you need to hide the baseline from your chart, you can do this by either not plotting it or setting its line transparency to zero. In our case, since we are not plotting it, there’s nothing more to do.

The Complete Pine Script

Here’s the complete Pine Script that combines all the above elements together:

[[See Video to Reveal this Text or Code Snippet]]

Conclusion

By following this guide, you can easily plot horizontal lines in TradingView at specified levels without showing the underlying baseline. This helps maintain a clean chart while still giving you the clarity you need when analyzing price movements around that baseline value.

Feel free to adjust the input values or extend the functionality as per your trading needs. Happy trading!

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
How to Plot Horizontal Lines in TradingView Using Pine Script

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Этот новый язык делает Python быстрым.

Этот новый язык делает Python быстрым.

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

Прекратите болтать без умолку: 3-2-1 прием ораторского искусства, который заставит вас звучать ка...

Прекратите болтать без умолку: 3-2-1 прием ораторского искусства, который заставит вас звучать ка...

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

Учебник по Excel за 15 минут

Учебник по Excel за 15 минут

Circles - Area, Circumference, Radius & Diameter Explained!

Circles - Area, Circumference, Radius & Diameter Explained!

Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности

Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности

Градиентный спуск, как обучаются нейросети | Глава 2, Глубинное обучение

Градиентный спуск, как обучаются нейросети | Глава 2, Глубинное обучение

SHAZAM Top 50🏖️ Лучшая Музыка 2026 🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно #90

SHAZAM Top 50🏖️ Лучшая Музыка 2026 🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно #90

We're All Addicted To Claude Code

We're All Addicted To Claude Code

Модель контекстного протокола (MCP), четко объясненная (почему это важно)

Модель контекстного протокола (MCP), четко объясненная (почему это важно)

Понимание GD&T

Понимание GD&T

Пайтон для начинающих - Изучите Пайтон за 1 час

Пайтон для начинающих - Изучите Пайтон за 1 час

Обучение EXCEL. УРОК 2: Основы форматирования. Первая таблица. Рабочая область. Горячие клавиши.

Обучение EXCEL. УРОК 2: Основы форматирования. Первая таблица. Рабочая область. Горячие клавиши.

Доступное Введение в Машинное Обучение

Доступное Введение в Машинное Обучение

Отобразите все ключевые показатели эффективности (KPI), которые нужны вашему начальнику, в Power ...

Отобразите все ключевые показатели эффективности (KPI), которые нужны вашему начальнику, в Power ...

PowerShell 7 Tutorials for Beginners : Fundamentals

PowerShell 7 Tutorials for Beginners : Fundamentals

Sunset Peach & Yellow Screensaver Background – Pastel Aesthetic Wall Art 4K

Sunset Peach & Yellow Screensaver Background – Pastel Aesthetic Wall Art 4K

Расслабляющая музыка, исцеляющая от стресса, беспокойства и депрессивных состояний, исцеляет #19

Расслабляющая музыка, исцеляющая от стресса, беспокойства и депрессивных состояний, исцеляет #19

Психология Людей, Которые Не Публикуют Ничего в Социальных Сетях

Психология Людей, Которые Не Публикуют Ничего в Социальных Сетях

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]