Reputation: 1
Is it possible to change what's plotted on prior, completed candles using PineScript for TradingView?
ex: I have a series that needs 9 candles to complete. Once candle 6 completes, I plot something above it based on certain conditions but once candle 8 or 9 completes...what I plotted on candle 6 may need to be removed.
Is this possible? Thanks for the help!
Upvotes: 0
Views: 2410
Reputation: 1
I think by using offset argument in plotshape you can locate the desired candle and print a blank string like " " there which will erase the prev text. If a shape is there use a dummy shape and change its colour to color.white.
Upvotes: 0
Reputation: 1852
Is it possible to change what's plotted on prior, completed candles using PineScript for TradingView?
Once candle 6 completes, I plot something above it based on certain conditions but once candle 8 or 9 completes...what I plotted on candle 6 may need to be removed.
No this isn't possible at this time. Several TradingView functions do have an offset
argument (like plotshape()
) so that you can plot values on previous bars. But once you plot something, it's not possible to remove on next bars.
What you can do as a workaround is use the show_last
argument that most plotting functions have. With that argument you can define how many plotted values, shapes, or symbols should be shown on the chart.
That way you can still limit how many plotted data you get on the chart.
Upvotes: 2