Skip to main content

FundamentalRegistryEntry

Struct FundamentalRegistryEntry 

Source
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: Ustr

Canonical TradingView metric identifier (e.g., "total_revenue_fy", "ebitda_ttm").

§script_id: Ustr

Pine study identifier part (e.g., "STD;Total_Revenue_FY").

§script_version: Ustr

Pine study version string (e.g., "1.0" or "4").

§script_name: Ustr

Human-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

Source

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.

Source

pub fn fund_id(&self) -> &str

Returns the fundamental metric identifier as a string slice.

Source

pub fn script_id(&self) -> &str

Returns the Pine Script study identifier part as a string slice.

Source

pub fn script_version(&self) -> &str

Returns the Pine Script study version as a string slice.

Source

pub fn script_name(&self) -> &str

Returns the human-readable script name as a string slice.

Source

pub fn financial_period(&self) -> Option<&FinancialPeriod>

Returns the financial period, if present.

Source

pub fn fundamental_category(&self) -> Option<&str>

Returns the accounting category, if present.

Source

pub fn short_description(&self) -> Option<&str>

Returns the short description, if present.

Source

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"
Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for FundamentalRegistryEntry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FundamentalRegistryEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FundamentalRegistryEntry

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for FundamentalRegistryEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for FundamentalRegistryEntry

Source§

impl Ord for FundamentalRegistryEntry

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for FundamentalRegistryEntry

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for FundamentalRegistryEntry

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for FundamentalRegistryEntry

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FundamentalRegistryEntry

Source§

impl TryFrom<PineInfo> for FundamentalRegistryEntry

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(info: PineInfo) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more