Sidechair

dividends.future_ex_date

Browse the reference

The next ex-dividend date as a UNIX timestamp in milliseconds; na when no dividend is announced.

Try it in the editor

dividends.future_ex_date is a series int. Buying the share on or after this date does not entitle you to the dividend; owning it before does.

Subtract time (or timenow) and divide by 86400000 to count the days left.

Type

series int

Remarks

  • It describes the next event as known right now, so read it on the last bar.
  • On Sidechair: not supported yet; dividends.future_ex_date reads as its own text, not a number, so arithmetic on it gives na and na() on it is false. A script that reads it still runs but has no real value to show.

Example

Pine ScriptDays to ex-dateOpen in editor
//@version=6
indicator("Ex-date countdown", overlay = true)
plot(close, "Close", color.gray)
if barstate.islast and dividends.future_ex_date > timenow
    label.new(bar_index, high, str.tostring(math.ceil((dividends.future_ex_date - timenow) / 86400000)) + " days to ex-date")

See also

Not on Sidechair yet