0

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)

Screen shot

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?

0

1 Answer 1

0

SOLVED!

ADJ (adjust data for dividends) setting was ON!
Button in the right lower corner, and works somewhat counter-inituitve

See image here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.