My strategy generates a strategy entry when a certain buy condition is met (e.g. RSI > 0.8). And it plots a green arrow above the bar when the strategy entry is generated.
It looks like this:
if buy_signal
___strategy.entry("BUY", strategy.long)
plotshape(buy_signal, title='BUY', color=color.new(color.green, 25), style=shape.labeldown, size=size.large, location=location.abovebar)
And this works fine when I start backtesting! Both the trades and the green arrows are generated on all the bars the consition is met.
With calc_on_every_tick=true, in the realtime bar the strategy is calculated on every tick. So whenever the buying condition is met during the build of that bar, a buy trade is generated. That also works fine!
But although the strategy entry has been made correctly in the bar, the green arrow is NOT plotted above it. While in Pinescript the arrow is initiated by the exact same condition as the strategy entry I would say...
And when I later close the graph, open it again and start backtesting, both the strategy entry AND the green arrow are perfectly generated at that bar.
I can't figure out how to have the green arrow also plotted when my strategy is running on my computer receiving realtime data during every new bar that starts. (which it does during backtesting the same code)
Can any of you help me out please?!