Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issues while converting series to const string for plotshape text

I have been trying to print the current volume as a plotshape text label using the following code...

plotshape(EntryCondition, style=shape.labelup, title="Buy flag", location=location.belowbar, color=color.lime, text=str.tostring(volume)) 

but I keep getting this error..

Cannot call 'plotshape' with argument 'text'='call 'str.tostring' (series string)'. An argument of 'series string' type was used but a 'const string' is expected

Any advice on how to fix this?

like image 792
s21jb Avatar asked Sep 15 '25 08:09

s21jb


1 Answers

There is no way to force the plotshape() to accept series string, unfortunately. Use the label.new() function instead, which allows to plot and change the text dynamically.

if longCondition
    label.new(bar_index, low, str.tostring(volume), color = color.lime, style = label.style_label_up)
like image 189
e2e4 Avatar answered Sep 18 '25 10:09

e2e4