pub struct FundamentalRegistryEntry {
pub fund_id: Ustr,
pub script_id: Ustr,
pub script_version: Ustr,
pub script_name: Ustr,
pub financial_period: Option<FinancialPeriod>,
pub fundamental_category: Option<Ustr>,
pub short_description: Option<Ustr>,
}Expand description
A single fundamental Pine study metric registered in TradingView’s catalog.
Each fundamental indicator corresponds to a built-in Pine Script study that computes a fundamental financial metric (e.g., Total Revenue, Net Income, Debt to Equity) for a particular reporting period.
Fields§
§fund_id: UstrCanonical TradingView metric identifier (e.g., "total_revenue_fy", "ebitda_ttm").
script_id: UstrPine study identifier part (e.g., "STD;Total_Revenue_FY").
script_version: UstrPine study version string (e.g., "1.0" or "4").
script_name: UstrHuman-readable study title (e.g., "Total Revenue").
financial_period: Option<FinancialPeriod>Reporting period, if applicable (FY, FQ, FH, TTM, NOAGG, etc.).
fundamental_category: Option<Ustr>High-level fundamental accounting category (e.g., "income_statement").
short_description: Option<Ustr>Brief textual description of the metric.
Implementations§
Source§impl FundamentalRegistryEntry
impl FundamentalRegistryEntry
Sourcepub fn from_pine_info(info: PineInfo) -> Option<Self>
pub fn from_pine_info(info: PineInfo) -> Option<Self>
Attempts to create a FundamentalRegistryEntry from a raw PineInfo.
Returns None if info.extra.is_fundamental_study is false or
if info.extra.fund_id is missing.
Sourcepub fn script_id(&self) -> &str
pub fn script_id(&self) -> &str
Returns the Pine Script study identifier part as a string slice.
Sourcepub fn script_version(&self) -> &str
pub fn script_version(&self) -> &str
Returns the Pine Script study version as a string slice.
Sourcepub fn script_name(&self) -> &str
pub fn script_name(&self) -> &str
Returns the human-readable script name as a string slice.
Sourcepub fn financial_period(&self) -> Option<&FinancialPeriod>
pub fn financial_period(&self) -> Option<&FinancialPeriod>
Returns the financial period, if present.
Sourcepub fn fundamental_category(&self) -> Option<&str>
pub fn fundamental_category(&self) -> Option<&str>
Returns the accounting category, if present.
Sourcepub fn short_description(&self) -> Option<&str>
pub fn short_description(&self) -> Option<&str>
Returns the short description, if present.
Sourcepub fn base_metric(&self) -> &str
pub fn base_metric(&self) -> &str
Derives the base metric name by stripping known period suffixes from fund_id.
For example:
"total_revenue_fy"->"total_revenue""net_income_fq"->"net_income""free_cash_flow_ttm"->"free_cash_flow""shares_outstanding_noagg"->"shares_outstanding""pe_ratio"->"pe_ratio"
Sourcepub fn to_study_options(&self) -> StudyOptions
pub fn to_study_options(&self) -> StudyOptions
Converts this entry into a chart StudyOptions configuration.
Note: Fundamental studies use ScriptType::IntervalScript on TradingView’s
WebSocket data feed.
Sourcepub async fn fetch_indicator(
&self,
user: Option<&UserCookies>,
) -> Result<PineIndicator>
pub async fn fetch_indicator( &self, user: Option<&UserCookies>, ) -> Result<PineIndicator>
Asynchronously fetches the full Pine indicator metadata, returning a PineIndicator.
The resulting PineIndicator can be directly passed into chart study configurations.