Pine Script code to show label with 'low' of the bar

Viewed 510

I wanted to see a label above the bar with "low" value of the bar if close < open, I searched a lot but "tostring" command is giving an error. Any help is appreciated.

I'm a code-dummy.

1 Answers

It should not give you any errors.

Here is an example which works:

//@version=5
indicator("My script", overlay=true)

var label _l = na

if (close < open)
    _l := label.new(bar_index, low, str.tostring(low), yloc=yloc.abovebar)

enter image description here

Related