The tradingview help center says that request.security function can cause repaint issue
if the timeframe argument is not the same as the chart timeframe.
Then, vice versa, if the timeframe argument is the same as the chart time frame, It never causes repaint??
below is the example I'm struggling with
=>
I`m using, for example, three security functions A & B & C with the same timeframe as the chart.
say,
A = request.security("AVAXBUSD","",ta.rsi(close,14))
B = request.security("UNIBUSD","",ta.rsi(close,14))
C = request.security("BTCBUSD","",ta.rsi(close,14))
and at the close,
compare A,B,C and
(1) plot the biggest one on the chart bar.
(2) simultaneously, send alert texting the biggest one.
usually, the (1) and (2) are making the same results.
However, I found that sometimes, (1) is not equal to (2)
I thought it is a kind of repaint issue.
(of course, I didn`t use other risky functions such as valuewhen, barstate series and so on)
So, my question is :
I guess it happens because at the close, sometimes, there may be a slow chart symbol that not completed yet due to data lagging from the exchange. is it right?
or it is caused by other issues?
(for example, at 2:00 pm, is may be possible that AVAXBUSD, BTCBUSD 1hour bar are completed but UNIBUSD bar is not completed yet?)
[
As an example scenario: at 2:00 pm, UNIBUSD 1-hour bar is not completed.
so when sending alert, the logic have no other way than comparing the remained AVAXBUSD and BTCBUSD.
so it can send alert meaning BTCBUSD is the biggest one.
on the other hand, when plotting on the chart after a few seconds, UNIBUSD 1hour bar would be completed.
so it is possible sending the actual truely biggest one UNIBUSD.
]
FYI, this happens more frequently on a lower chart timeframe than a higher chart timeframe.
Best regards