Alpha-Tango
Alpha-Tango

Reputation: 610

How to plot a dashed line on pine script V4?

Trying to plot a normal serie line but with the V4 of pine script I can't find how to set the style?

This gives me an error :

plot(my_serie, color=color.blue,linewidth=2, style=line.style_dashed)

Any help appreciated.

Upvotes: 8

Views: 22214

Answers (2)

Ganesh
Ganesh

Reputation: 1

Use the below -

Change the end part based on your requirement, set

style=plot.style_dashed

Upvotes: -4

PineCoders-LucF
PineCoders-LucF

Reputation: 8779

There is no dashed style for plot(). This turns the color on and off to achieve the effect:

plot(my_serie, color=bar_index % 2 == 0 ? color.blue : #00000000, linewidth=2)

Upvotes: 16

Related Questions