Requests dividend data for a symbol, such as the gross or net amount of the latest payment.
request.dividends returns a figure from the most recent dividend as of each bar. The value holds until the next dividend is declared or paid.
Set field to dividends.gross for the amount before tax, dividends.net for the amount after tax, or dividends.future_amount for the announced next payment.
Syntax
request.dividends(ticker: series string, field: series string (optional), gaps: simple barmerge_gaps (optional), lookahead: simple barmerge_lookahead (optional), ignore_invalid_symbol: input bool (optional), currency: series string (optional)) -> series floatArguments
| Name | Type | Default | Description |
|---|---|---|---|
| ticker | series string | required | The symbol to read. syminfo.tickerid is the chart's own symbol. |
| field | series string | dividends. | Which figure to return: dividends.gross, dividends.net or dividends.future_amount. |
| gaps | simple barmerge_gaps | barmerge. | barmerge.gaps_on leaves na between payments. barmerge.gaps_off carries the last value forward. |
| lookahead | simple barmerge_lookahead | barmerge. | barmerge.lookahead_off waits for a payment to be on record. barmerge.lookahead_on stamps each payment onto the earlier bars of its period, which uses data from the future. |
| ignore_invalid_symbol | input bool | false | When true, an unknown symbol returns na. |
| currency | series string | the symbol's own currency | Currency to convert the amount to. |
Returns
series float: the dividend figure, or na where the symbol pays none.
Remarks
- Divide by close to express the payment as a yield.
- On Sidechair: dividend data is not available yet. The call warns once and returns na.
Example
//@version=6
indicator("Dividend yield")
div = request.dividends(syminfo.tickerid, dividends.gross)
plot(100 * div / close, "Yield %", color = color.teal)See also
Not on Sidechair yet