Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть How to Plot Different Shapes Based on Condition Occurrences in PineScript

  • vlogize
  • 2025-05-25
  • 2
How to Plot Different Shapes Based on Condition Occurrences in PineScript
How to plot different shapes based on the occurrences of 1 condition over the past x bars (PineScripconditional statementspine scriptshapestradingview api
  • ok logo

Скачать How to Plot Different Shapes Based on Condition Occurrences in PineScript бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно How to Plot Different Shapes Based on Condition Occurrences in PineScript или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

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

Cкачать музыку How to Plot Different Shapes Based on Condition Occurrences in PineScript бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео How to Plot Different Shapes Based on Condition Occurrences in PineScript

Learn how to effectively `plot various shapes` in TradingView based on the occurrences of a specific condition over the past bars with PineScript.
---
This video is based on the question https://stackoverflow.com/q/71477134/ asked by the user 'Jon' ( https://stackoverflow.com/u/2480838/ ) and on the answer https://stackoverflow.com/a/71489681/ provided by the user 'rumpypumpydumpy' ( https://stackoverflow.com/u/16003875/ ) 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: How to plot different shapes based on the occurrences of 1 condition over the past x bars (PineScript, TradingView)

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.
---
Plot Different Shapes Based on Condition Occurrences in PineScript

When working with PineScript in TradingView, a common goal is to represent data visually in a way that enhances decision-making. Imagine you want to plot different shapes on your chart based on how many times a specific condition has occurred over the last set of bars. This can be particularly useful in trading strategies where understanding the frequency of signals can inform buy or sell decisions. However, you may find that it gets tricky if you want to display these shapes in response to particular conditions.

The Problem at Hand

Let's break down the challenge you've encountered:

Objective: Plot shapes based on the occurrences of a condition over the past 50 bars.

Conditions:

If the condition is met less than three times in the last 50 bars, continue to plot Plotshape1.

If the condition is met exactly three times in the last 50 bars, plot Plotshape2 instead of Plotshape1.

Complication: The current method continuously plots instances above every candle, leading to visual clutter.

You tested a couple of code snippets but haven't yet succeeded in getting the desired behavior.

Solution Overview

To achieve your goal, you need a clear implementation of counting the occurrences and conditional plotting of the shapes. The following sections will guide you through the steps needed.

Step 1: Counting Occurrences of the Condition

The first step is to accumulate how many times the condition has been met in the past 50 bars. You can utilize the following code:

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

Step 2: Evaluating Conditions

Next, you need to define whether the condition has been met either 3 times or less:

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

Step 3: Defining What to Plot

Instead of your original approach, you can slightly modify the way shapes are defined to achieve your desired plotting behavior:

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

Final Step: Plotting the Shapes

With the defined conditions in place, you can now effectively plot your shapes with the following snippet:

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

Summary of Changes

When querying and plotting the shapes:

Use NotThree to dictate when to display Plotshape1.

Use Three and not Three[1] for Plotshape2, ensuring that it only appears on the third occurrence of the condition.

This way, your chart will now accurately reflect the conditions you intended, without continual plotting over every candle.

By understanding the condition counts and effectively plotting different shapes based on those counts, your TradingView analysis will be clearer and more actionable.

Conclusion

Implementing condition-based shape plotting in PineScript is an invaluable skill for enhancing your trading visuals in TradingView. By following the steps outlined above, you’ll be able to represent your trading conditions more effectively and make decisions with confidence.

Happy Trading!

Комментарии

Информация по комментариям в разработке

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

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

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