Reputation: 39
I'm using plotshape in Pine Script to display small triangle markers below the chart. However, I noticed that plotshape always generates numerical values (e.g., 0.00) next to the indicator name at the top of the TradingView chart.
I want to keep the shapes on the chart but completely remove these numerical values from the indicator label.
Here’s a simplified version of my code:
plotshape(xSMA1_SMA2 > 0 and xSMA1_SMA2 > xSMA1_SMA2[1], location=location.bottom, style=shape.triangleup, color=color.green, size=size.tiny)
plotshape(xSMA1_SMA2 > 0 and xSMA1_SMA2 < xSMA1_SMA2[1], location=location.bottom, style=shape.triangleup, color=color.red, size=size.tiny)
plotshape(xSMA1_SMA2 < 0 and xSMA1_SMA2 > xSMA1_SMA2[1], location=location.bottom, style=shape.triangledown, color=color.green, size=size.tiny)
plotshape(xSMA1_SMA2 < 0 and xSMA1_SMA2 < xSMA1_SMA2[1], location=location.bottom, style=shape.triangledown, color=color.red, size=size.tiny)
What I’ve tried so far: Using title="" inside plotshape() → Did not work
Using plot(na, title="") to override labels → Did not work
Setting display=display.none → This removes the values but also hides the shapes, which I don’t want.
My question:
Is there any way to keep the shapes visible on the chart but completely remove the numerical values from the indicator label?
Upvotes: 1
Views: 62
Reputation: 21342
You can actually do math operations on the display
parameter. By default, it is set to display.all
. You can remove or add any display placeholders from that parameter.
//@version=6
indicator("My script", overlay=true)
plot(close, "close", color.white)
plot(close, "close", color.red, display=display.all - display.status_line)
plot(close, "close", color.green, display=display.all - display.status_line - display.price_scale)
plot(close, "close", color.yellow, display=display.pane)
Upvotes: 3