Skip to main content
added 24 characters in body
Source Link

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("My"request.security script"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) 

What am I missing?

I tried different versions of pine script and narrowed it down to this one function.

What am I missing?

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("My script") 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) 

What am I missing?

I tried different versions of pine script and narrowed it down to this one function.

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?

added 2 characters in body
Source Link

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("My script") 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) 

What am I missing?

I tried different versions of pine script and narrowed it down to this one function.

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("My script") 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) 

What am I missing?

I tried different versions of pine script and narrowed it down to this one function.

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("My script") 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) 

What am I missing?

I tried different versions of pine script and narrowed it down to this one function.

added 16 characters in body
Source Link

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("My script") 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) 

What am I missing?

I tried different versions of pine script and narrowed it down to this one function.

Screen shot

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

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("My script") 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) 

What am I missing?

I tried different versions of pine script and narrowed it down to this one function.

Screen shot

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("My script") 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) 

What am I missing?

I tried different versions of pine script and narrowed it down to this one function.

added 67 characters in body
Source Link
Loading
added 143 characters in body
Source Link
Loading
added 6 characters in body
Source Link
Loading
added 4 characters in body
Source Link
Loading
deleted 2 characters in body
Source Link
Loading
Source Link
Loading