Skip to main content

SymbolInfo

Struct SymbolInfo 

pub struct SymbolInfo {
Show 35 fields pub symbol: Symbol, pub market: Market, pub description: Option<String>, pub type_: Option<SymbolType>, pub country: Option<String>, pub isin: Option<String>, pub root: Option<String>, pub min_move: i32, pub price_scale: i32, pub point_value: f64, pub currency: Currency, pub expiration_date: Option<OffsetDateTime>, pub current_contract: Option<String>, pub base_currency: Option<Currency>, pub employees: Option<i64>, pub industry: Option<String>, pub sector: Option<String>, pub min_contract: Option<f64>, pub recommendations_buy: Option<i32>, pub recommendations_buy_strong: Option<i32>, pub recommendations_hold: Option<i32>, pub recommendations_sell: Option<i32>, pub recommendations_sell_strong: Option<i32>, pub recommendations_date: Option<OffsetDateTime>, pub recommendations_total: Option<i32>, pub shareholders: Option<i64>, pub shares_outstanding_float: Option<f64>, pub shares_outstanding_total: Option<f64>, pub target_price_average: Option<f64>, pub target_price_date: Option<OffsetDateTime>, pub target_price_estimates: Option<f64>, pub target_price_high: Option<f64>, pub target_price_low: Option<f64>, pub target_price_median: Option<f64>, pub volume_type: Option<VolumeType>,
}
Expand description

Symbol metadata used by syminfo.* builtins.

Fields§

§symbol: Symbol

The symbol.

§market: Market

The market the symbol belongs to.

§description: Option<String>

The description of the symbol.

§type_: Option<SymbolType>

The type of market the symbol belongs to.

§country: Option<String>

Returns the two-letter code of the country where the symbol is traded, in the ISO 3166-1 alpha-2 format, or None if the exchange is not directly tied to a specific country.

For example, on “NASDAQ:AAPL” it will return “US”, on “LSE:AAPL” it will return “GB”, and on “BITSTAMP:BTCUSD” it will return None.

§isin: Option<String>

Representing a symbol’s associated International Securities Identification Number (ISIN).

An ISIN is a 12-character alphanumeric code that uniquely identifies a security globally.

For example, the ISIN for Apple Inc. is “US0378331005”.

§root: Option<String>

Root for derivatives like futures contract.

For example, for the futures contract “ESZ4” (E-mini S&P 500 December 2024), the root would be “ES”.

§min_move: i32

Returns a whole number used to calculate the smallest increment between a symbol’s price movements (syminfo.mintick).

It is the numerator in the syminfo.mintick formula: syminfo.min_move / syminfo.price_scale = syminfo.mintick.

§price_scale: i32

Returns a whole number used to calculate the smallest increment between a symbol’s price movements (syminfo.mintick).

It is the denominator in the syminfo.mintick formula: syminfo.min_move / syminfo.price_scale = syminfo.mintick.

§point_value: f64

The chart price of a security multiplied by the point value equals the actual price of the traded security.

For all types of security except futures, the point value is usually equal to 1 and can therefore be ignored. For futures, the prices shown on the chart are either the cost of a single futures contract, in which case the point value is 1, or the price of a single unit of the underlying commodity, in which case the point value represents the number of units included in a single contract.

§currency: Currency

Returns a string containing the code representing the currency of the symbol’s prices.

For example, this variable returns “USD” for “NASDAQ:AAPL” and “JPY” for “EURJPY”.

§expiration_date: Option<OffsetDateTime>

Representing the start of the last day of the current futures contract.

§current_contract: Option<String>

The ticker identifier of the underlying contract.

§base_currency: Option<Currency>

The base currency of the symbol.

For example, in the pair “EURUSD”, the base currency is “EUR”, in the pair “BTCUSDT”, the base currency is “BTC”.

§employees: Option<i64>

Number of employees in the company (for stocks).

§industry: Option<String>

Industry of the company (for stocks).

§sector: Option<String>

Sector of the company (for stocks).

§min_contract: Option<f64>

Minimum contract size for the symbol.

§recommendations_buy: Option<i32>

The number of buy recommendations from analysts covering this stock.

§recommendations_buy_strong: Option<i32>

The number of strong buy recommendations from analysts covering this stock.

§recommendations_hold: Option<i32>

The number of hold recommendations from analysts covering this stock.

§recommendations_sell: Option<i32>

The number of sell recommendations from analysts covering this stock.

§recommendations_sell_strong: Option<i32>

The number of strong sell recommendations from analysts covering this stock.

§recommendations_date: Option<OffsetDateTime>

The date of the latest recommendations update.

§recommendations_total: Option<i32>

The total number of recommendations from analysts covering this stock.

§shareholders: Option<i64>

The number of shareholders the company has.

§shares_outstanding_float: Option<f64>

The total number of shares outstanding a company has available, excluding any of its restricted shares.

§shares_outstanding_total: Option<f64>

The total number of shares outstanding a company has available, including restricted shares held by insiders, major shareholders, and employees.

§target_price_average: Option<f64>

The latest average yearly price target for the symbol predicted by analysts.

§target_price_date: Option<OffsetDateTime>

The date of the latest target price update.

§target_price_estimates: Option<f64>

The latest total number of price target predictions for the current symbol.

§target_price_high: Option<f64>

The last highest yearly price target for the symbol predicted by analysts.

§target_price_low: Option<f64>

The last lowest yearly price target for the symbol predicted by analysts.

§target_price_median: Option<f64>

The median of the last yearly price targets for the symbol predicted by analysts.

§volume_type: Option<VolumeType>

The volume type of the current symbol.

Implementations§

§

impl SymbolInfo

pub fn symbol(&self) -> &Symbol

Returns the symbol.

pub fn market(&self) -> &Market

Returns the market the symbol belongs to.

pub fn description(&self) -> Option<&String>

Returns the description of the symbol.

pub fn type_(&self) -> Option<SymbolType>

Returns the type of market the symbol belongs to.

pub fn country(&self) -> Option<&String>

Returns the two-letter code of the country where the symbol is traded, in the ISO 3166-1 alpha-2 format, or None if the exchange is not directly tied to a specific country.

For example:

  • “NASDAQ:AAPL” returns “US”
  • “LSE:AAPL” returns “GB”
  • “BITSTAMP:BTCUSD” returns None

pub fn isin(&self) -> Option<&String>

Returns the International Securities Identification Number (ISIN) of the symbol.

An ISIN is a 12-character alphanumeric code that uniquely identifies a security globally.

For example:

  • The ISIN for Apple Inc. is “US0378331005”.

pub fn root(&self) -> Option<&String>

Returns the root for derivatives like futures contracts.

For example:

  • For the futures contract “ESZ4” (E-mini S&P 500 December 2024), the root is “ES”.

pub fn min_move(&self) -> i32

Returns the smallest increment between a symbol’s price movements (syminfo.mintick).

This is the numerator in the syminfo.mintick formula: syminfo.min_move / syminfo.price_scale = syminfo.mintick.

pub fn price_scale(&self) -> i32

Returns the denominator used to calculate the smallest increment between a symbol’s price movements (syminfo.mintick).

This is the denominator in the syminfo.mintick formula: syminfo.min_move / syminfo.price_scale = syminfo.mintick.

pub fn point_value(&self) -> f64

Returns the point value of the symbol.

The chart price of a security multiplied by the point value equals the actual price of the traded security.

For all types of security except futures, the point value is usually equal to 1 and can therefore be ignored.

pub fn currency(&self) -> Currency

Returns the currency of the symbol’s prices.

For example:

  • “NASDAQ:AAPL” returns “USD”
  • “EURJPY” returns “JPY”

pub fn timezone(&self) -> Tz

Returns the exchange timezone for the chart’s main series.

pub fn expiration_date(&self) -> Option<&OffsetDateTime>

Returns the start of the last day of the current futures contract.

pub fn current_contract(&self) -> Option<&String>

Returns the ticker identifier of the underlying contract.

pub fn base_currency(&self) -> Option<&Currency>

Returns the base currency of the symbol.

For example:

  • In the pair “EURUSD”, the base currency is “EUR”.
  • In the pair “BTCUSDT”, the base currency is “BTC”.

pub fn employees(&self) -> Option<i64>

Returns the number of employees in the company (for stocks).

pub fn industry(&self) -> Option<&String>

Returns the industry of the company (for stocks).

pub fn sector(&self) -> Option<&String>

Returns the sector of the company (for stocks).

pub fn min_contract(&self) -> Option<f64>

Returns the minimum contract size for the symbol.

pub fn volume_type(&self) -> Option<VolumeType>

Returns the volume type of the current symbol.

pub fn recommendations_buy(&self) -> Option<i32>

Returns the number of buy recommendations from analysts covering this stock.

pub fn recommendations_buy_strong(&self) -> Option<i32>

Returns the number of strong buy recommendations from analysts covering this stock.

pub fn recommendations_hold(&self) -> Option<i32>

Returns the number of hold recommendations from analysts covering this stock.

pub fn recommendations_sell(&self) -> Option<i32>

Returns the number of sell recommendations from analysts covering this stock.

pub fn recommendations_sell_strong(&self) -> Option<i32>

Returns the number of strong sell recommendations from analysts covering this stock.

pub fn recommendations_date(&self) -> Option<&OffsetDateTime>

Returns the date of the latest recommendations update.

pub fn recommendations_total(&self) -> Option<i32>

Returns the total number of recommendations from analysts covering this stock.

pub fn shareholders(&self) -> Option<i64>

Returns the number of shareholders the company has.

pub fn shares_outstanding_float(&self) -> Option<f64>

Returns the total number of shares outstanding a company has available, excluding any of its restricted shares.

pub fn shares_outstanding_total(&self) -> Option<f64>

Returns the total number of shares outstanding a company has available, including restricted shares held by insiders, major shareholders, and employees.

pub fn target_price_average(&self) -> Option<f64>

Returns the latest average yearly price target for the symbol predicted by analysts.

pub fn target_price_date(&self) -> Option<&OffsetDateTime>

Returns the date of the latest target price update.

pub fn target_price_estimates(&self) -> Option<f64>

Returns the total number of price target predictions for the current symbol.

pub fn target_price_high(&self) -> Option<f64>

Returns the last highest yearly price target for the symbol predicted by analysts.

pub fn target_price_low(&self) -> Option<f64>

Returns the last lowest yearly price target for the symbol predicted by analysts.

pub fn target_price_median(&self) -> Option<f64>

Returns the median of the last yearly price targets for the symbol predicted by analysts.

pub fn min_tick(&self) -> f64

Returns the min tick value for the current symbol.

Trait Implementations§

§

impl Clone for SymbolInfo

§

fn clone(&self) -> SymbolInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
§

impl Debug for SymbolInfo

§

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

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for SymbolInfo

§

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

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

impl Serialize for SymbolInfo

§

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

Serialize this value into the given Serde serializer. Read more

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

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

§

fn vzip(self) -> V

Source§

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