When using request.security function in Pine Script, like in the script below, I find weird outcomes when there is dividend at play. I used the function a lot for crypto... no dividends, so no problem there, but developing now more for stocks and ETF.
Example: GETTEX:IQQA Ex-Dividend date on Sep 11, 2025, value 0.329
From that date until today (Oct 4, 2025) I get the expected outcome.
But before this date it's calculating the future the dividend and adding it. So on Sep 10 it shows 22.55 instead of the close 22.22 (screen shot below)
Further back in history the difference is getting bigger with every dividend event.... At the start of this ETF Jan 29, 2024: indicator gives 17.26 vs actual close 15.59
A simple script to demonstrate:
//@version=6 indicator("request.security dividend issue") plot(request.security(symbol = 'GETTEX:IQQA',timeframe = timeframe.period, expression = close), title = 'Close values of request.security' , color=color.red ) plot(close, title = 'Standard close values (please select IQQA on Gettex)', color=color.green) I tried different versions of pine script and narrowed it down to this one function.
What am I missing?