request.economic() - Pine Script Function
request.economic()
Section titled “request.economic()”Overview
Section titled “Overview”Requests economic data for a symbol. Economic data includes information such as the state of a country’s economy (GDP, inflation rate, etc.) or of a particular industry (steel production, ICU beds, etc.).
Syntax
Section titled “Syntax”request.economic(country_code, field, gaps, ignore_invalid_symbol) → series floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| country_code | series string | The code of the country (e.g. “US”) or the region (e.g. “EU”) for which the economic data is requested. The Help Center article lists the countries and their codes. The countries for which information is available vary with metrics. The Help Center article for each metric lists the countries for which the metric is available. |
Returns
Section titled “Returns”Requested series.
Remarks
Section titled “Remarks”- Economic data can also be accessed from charts, just like a regular symbol. Use “ECONOMIC” as the exchange name and {country_code}{field} as the ticker. The name of US GDP data is thus “ECONOMIC:USGDP”.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("US GDP")e = request.economic("US", "GDP")plot(e)