Requests a financial statement figure for a symbol, such as revenue or net income, for a chosen reporting period.
request.financial returns one line of a company's financial statements, identified by a code such as "TOTAL_REVENUE" or "NET_INCOME". The value stays constant between report dates.
The period argument chooses the reporting basis: "FQ" for the fiscal quarter, "FY" for the fiscal year, "FH" for the half year or "TTM" for the trailing twelve months.
Syntax
request.financial(symbol: series string, financial_id: series string, period: series string, gaps: simple barmerge_gaps (optional), ignore_invalid_symbol: input bool (optional), currency: series string (optional)) -> series floatArguments
| Name | Type | Default | Description |
|---|---|---|---|
| symbol | series string | required | The company's symbol. syminfo.tickerid is the chart's own symbol. |
| financial_id | series string | required | Code of the figure to return, such as "TOTAL_REVENUE". |
| period | series string | required | Reporting period: "FQ", "FH", "FY" or "TTM". |
| gaps | simple barmerge_gaps | barmerge. | barmerge.gaps_on leaves na between reports. barmerge.gaps_off carries the last value forward. |
| 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 figure to. |
Returns
series float: the figure for the period, or na where the company has not reported it.
Remarks
- Funds, forex and crypto symbols have no statements and return na.
- On Sidechair: fundamental data is not available yet. The call warns once and returns na.
Example
//@version=6
indicator("Revenue")
revenue = request.financial(syminfo.tickerid, "TOTAL_REVENUE", "TTM")
plot(revenue, "Revenue (TTM)", color = color.blue, style = plot.style_stepline)See also
Not on Sidechair yet