Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

draw rectangle pine script

Tags:

pine-script

I would like draw a rectangle box over specific candles range using pine script, can anyone please help me on this ?

like below pic:

enter image description here

like image 740
Alireza Jaba Avatar asked Oct 21 '25 00:10

Alireza Jaba


1 Answers

You have line 4 with every argument used, you have to know the sides (left, top, right, bottom) for your square, everything else is for design.

//@version=4
study("My Script", overlay=true)

// box.new(left, top, right, bottom, border_color, border_width, border_style, extend, xloc, bgcolor)
b = box.new(bar_index[100], highest(high,50), bar_index[10], lowest(low, 50), color.purple, 1, line.style_solid, extend.none, xloc.bar_index, color.new(color.purple, 90))
box.delete(b[1])

enter image description here

Also you can read the docs here.

like image 137
edward Avatar answered Oct 24 '25 20:10

edward



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!