Paul Cas
Paul Cas

Reputation: 39

I am looking to make these labels with syminfo.mintick to show the tick and point values instead of the current value that is showing?

enter image description hereI tried switching out the bar index but it doesn't work. For example the orange label reads 4154.4177 but should read 4150.50 or 4150.25 for the ES MINI Futures. Because it moves in .25 cent increments. Thanks!

label.delete(rsidown)
yrsil = al*bar_index + bl
rsidown := label.new(bar_index, yrsil, 

text=str.tostring(yrsil, "#.####"), color=color.red, style=label.style_text_outline, yloc=yloc.price)

label.delete(rsiup)
yrsih = ah*bar_index + bh
rsiup := label.new(bar_index, yrsih, text=str.tostring(yrsih, "#.####"), color=color.green, style=label.style_text_outline, yloc=yloc.price)

Upvotes: 0

Views: 510

Answers (1)

G.Lebret
G.Lebret

Reputation: 3108

You should try this to have the value in tradingview tick on your labels :

label.delete(rsiup)
HighPlace = ta.highest(10)
yrsih = ah*bar_index + bh
rsiup := label.new(bar_index, HighPlace, text=str.tostring(yrsih/syminfo.mintick, "#"), color=color.green, style=label.style_label_down, yloc=yloc.price)

label.delete(rsidown)
LowPlace = ta.lowest(10)
yrsil = (al*bar_index + bl)
rsidown := label.new(bar_index, LowPlace, text=str.tostring(yrsil/syminfo.mintick, "#"), color=color.red, style=label.style_label_up, yloc=yloc.price)

Result : enter image description here

Upvotes: 0

Related Questions