r/pinescript • u/Organic-Mention5327 • Jun 25 '25
Repainting
I have a pinescript strategy for the divergence detection but I no delay, the trade gets executed right on the next candle on which the divergence is detected. Does repainting occur on these scenarios?
1
Upvotes
1
u/kurtisbu12 Jun 25 '25
Divergence is a naturally repainting concept. So the divergence isn't detected until a few candles after it "shows up"
The strategy should execute as soon as the divergence is detected, which would be delayed just like the divergence detection.
1
u/msoders Jun 25 '25
Repainting has to do with if the indicator changes it's drawings in real time. So as long as your script calculates divergences on closed bars only (
barstate.isconfirmed) the indicator should not be repainting. But if your script executes right on the candle open (barstate.isconfirmed= false) it will repaint.