Not paint in a position

If you want to leave a bar space without painting you can use the na constant.

//@version=2
study("My Script")
x=n%10   // n is the bars counter of the system
r=x==7?na:x   // if the value=7 then it not paints
plot(r,style=columns)

This is a counter of bars modulated in 10 (it generates 0-9 values continuosly)
It will paint columns with numbers 0-9 (except the position 7).

Pinescripts.

Charts generation

Before add your script, you must remember that all the elements showed in the chart (bars, candles, indicators…) will be generated from left to right in a only one time.
After the execution of your script (continuing with real time) it will generate the next bars one by one adding to the painted graphic.

Pinescripts.

Welcome to PINESCRIPTS.COM

In this website you’ll find tips, tricks, tools, scripts and many information to help you develope robots and trading indicators in Pinescript programming language.
PineScript is a programming language especially dedicated to the creation of financial tools.

PineScripts.