Reputation: 3615
I tradingview platform I am using Version 2 script. I have a code which show Buy sell signal like this
plotshape(long_final, style=shape.labelup,
location=location.belowbar, color=green,size=size.tiny,title="buy label",text="Buy",textcolor=white)
plotshape(short_final, style=shape.labeldown,
location=location.abovebar, color=red,size=size.tiny,title="sell label",text="Sell",textcolor=white)
How I need to add Candle open value in it. If I change like below I get an error can you please help
plotshape(long_final, style=shape.labelup, location=location.belowbar, color=green,size=size.tiny,title="buy label",text="Buy"+tostring(open),textcolor=white)
Upvotes: 0
Views: 925
Reputation: 3
label.new(x=bar_index, y=high, color=color.orange, textcolor=color.blue, text=str.tostring(smavalue))
I use the above code to put the value into the text. Try label with str.tostring()
.
Upvotes: -1
Reputation: 132
I've tried the same as you did before and I couldn't. I don't think the PineScript fitted to use tostring()
in plotshape
function. Instead, Try to use label.new()
lab= label.new(
bar_index, close,
text="Buy"+tostring(open),
color=color.white,
textcolor= color.blue,
size= size.auto,
style= label.style_square,
yloc= yloc.abovebar)
Upvotes: 0