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: SymbolThe symbol.
market: MarketThe 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: i32Returns 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: i32Returns 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: f64The 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: CurrencyReturns 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.
The number of shareholders the company has.
The total number of shares outstanding a company has available, excluding any of its restricted shares.
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
impl SymbolInfo
pub fn description(&self) -> Option<&String>
pub fn description(&self) -> Option<&String>
Returns the description of the symbol.
pub fn type_(&self) -> Option<SymbolType>
pub fn type_(&self) -> Option<SymbolType>
Returns the type of market the symbol belongs to.
pub fn country(&self) -> Option<&String>
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>
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>
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
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
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
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
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
pub fn timezone(&self) -> Tz
Returns the exchange timezone for the chart’s main series.
pub fn expiration_date(&self) -> Option<&OffsetDateTime>
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>
pub fn current_contract(&self) -> Option<&String>
Returns the ticker identifier of the underlying contract.
pub fn base_currency(&self) -> Option<&Currency>
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 min_contract(&self) -> Option<f64>
pub fn min_contract(&self) -> Option<f64>
Returns the minimum contract size for the symbol.
pub fn volume_type(&self) -> Option<VolumeType>
pub fn volume_type(&self) -> Option<VolumeType>
Returns the volume type of the current symbol.
pub fn recommendations_buy(&self) -> Option<i32>
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>
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>
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>
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>
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>
pub fn recommendations_date(&self) -> Option<&OffsetDateTime>
Returns the date of the latest recommendations update.
pub fn recommendations_total(&self) -> Option<i32>
pub fn recommendations_total(&self) -> Option<i32>
Returns the total number of recommendations from analysts covering this stock.
Returns the number of shareholders the company has.
Returns the total number of shares outstanding a company has available, excluding any of its restricted shares.
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>
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>
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>
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>
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>
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>
pub fn target_price_median(&self) -> Option<f64>
Returns the median of the last yearly price targets for the symbol predicted by analysts.
Trait Implementations§
§impl Clone for SymbolInfo
impl Clone for SymbolInfo
§fn clone(&self) -> SymbolInfo
fn clone(&self) -> SymbolInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for SymbolInfo
impl Debug for SymbolInfo
§impl<'de> Deserialize<'de> for SymbolInfo
impl<'de> Deserialize<'de> for SymbolInfo
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SymbolInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SymbolInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for SymbolInfo
impl Serialize for SymbolInfo
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for SymbolInfo
impl RefUnwindSafe for SymbolInfo
impl Send for SymbolInfo
impl Sync for SymbolInfo
impl Unpin for SymbolInfo
impl UnsafeUnpin for SymbolInfo
impl UnwindSafe for SymbolInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.