pub struct SymbolInfo { /* private fields */ }Expand description
Symbol metadata used by syminfo.* builtins.
Implementations§
Source§impl SymbolInfo
impl SymbolInfo
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets the description of the symbol.
Sourcepub fn with_type(self, type_: SymbolType) -> Self
pub fn with_type(self, type_: SymbolType) -> Self
Sets the type of the symbol.
Sourcepub fn with_country(self, country: impl Into<String>) -> Self
pub fn with_country(self, country: impl Into<String>) -> Self
Sets the country of the symbol.
Sourcepub fn with_min_move(self, min_move: i32) -> Self
pub fn with_min_move(self, min_move: i32) -> Self
Sets the min move of the symbol.
Sourcepub fn with_price_scale(self, price_scale: i32) -> Self
pub fn with_price_scale(self, price_scale: i32) -> Self
Sets the price scale of the symbol.
Sourcepub fn with_point_value(self, point_value: f64) -> Self
pub fn with_point_value(self, point_value: f64) -> Self
Sets the point value of the symbol.
Sourcepub fn with_currency(self, currency: Currency) -> Self
pub fn with_currency(self, currency: Currency) -> Self
Sets the currency of the symbol.
Sourcepub fn with_expiration_date(self, expiration_date: OffsetDateTime) -> Self
pub fn with_expiration_date(self, expiration_date: OffsetDateTime) -> Self
Sets the expiration date of the symbol.
Sourcepub fn with_current_contract(self, current_contract: impl Into<String>) -> Self
pub fn with_current_contract(self, current_contract: impl Into<String>) -> Self
Sets the current contract of the symbol.
Sourcepub fn with_base_currency(self, base_currency: Currency) -> Self
pub fn with_base_currency(self, base_currency: Currency) -> Self
Sets the base currency of the symbol.
Sourcepub fn with_employees(self, employees: i64) -> Self
pub fn with_employees(self, employees: i64) -> Self
Sets the number of employees of the symbol.
Sourcepub fn with_industry(self, industry: impl Into<String>) -> Self
pub fn with_industry(self, industry: impl Into<String>) -> Self
Sets the industry of the symbol.
Sourcepub fn with_sector(self, sector: impl Into<String>) -> Self
pub fn with_sector(self, sector: impl Into<String>) -> Self
Sets the sector of the symbol.
Sourcepub fn with_min_contract(self, min_contract: f64) -> Self
pub fn with_min_contract(self, min_contract: f64) -> Self
Sets the minimum contract size of the symbol.
Sourcepub fn with_volume_type(self, volume_type: VolumeType) -> Self
pub fn with_volume_type(self, volume_type: VolumeType) -> Self
Sets the volume type of the symbol.
Sourcepub fn description(&self) -> Option<&String>
pub fn description(&self) -> Option<&String>
Returns the description of the symbol.
Sourcepub fn type_(&self) -> Option<SymbolType>
pub fn type_(&self) -> Option<SymbolType>
Returns the type of market the symbol belongs to.
Sourcepub 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
Sourcepub 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”.
Sourcepub 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”.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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”
Sourcepub fn timezone(&self) -> TimeZone
pub fn timezone(&self) -> TimeZone
Returns the timezone of the exchange of the chart’s main series.
Sourcepub 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.
Sourcepub fn current_contract(&self) -> Option<&String>
pub fn current_contract(&self) -> Option<&String>
Returns the ticker identifier of the underlying contract.
Sourcepub 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”.
Sourcepub fn employees(&self) -> Option<i64>
pub fn employees(&self) -> Option<i64>
Returns the number of employees in the company (for stocks).
Sourcepub fn min_contract(&self) -> Option<f64>
pub fn min_contract(&self) -> Option<f64>
Returns the minimum contract size for the symbol.
Sourcepub fn volume_type(&self) -> Option<VolumeType>
pub fn volume_type(&self) -> Option<VolumeType>
Returns the volume type of the current symbol.
Sourcepub fn recommendations_buy(&self) -> Option<i32>
pub fn recommendations_buy(&self) -> Option<i32>
Returns the number of buy recommendations from analysts covering this stock.
Sourcepub 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.
Sourcepub fn recommendations_hold(&self) -> Option<i32>
pub fn recommendations_hold(&self) -> Option<i32>
Returns the number of hold recommendations from analysts covering this stock.
Sourcepub fn recommendations_sell(&self) -> Option<i32>
pub fn recommendations_sell(&self) -> Option<i32>
Returns the number of sell recommendations from analysts covering this stock.
Sourcepub 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.
Sourcepub fn recommendations_date(&self) -> Option<&OffsetDateTime>
pub fn recommendations_date(&self) -> Option<&OffsetDateTime>
Returns the date of the latest recommendations update.
Sourcepub 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.
Sourcepub 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.
Sourcepub fn target_price_date(&self) -> Option<&OffsetDateTime>
pub fn target_price_date(&self) -> Option<&OffsetDateTime>
Returns the date of the latest target price update.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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§
Source§impl Clone for SymbolInfo
impl Clone for SymbolInfo
Source§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 moreSource§impl Debug for SymbolInfo
impl Debug for SymbolInfo
Source§impl<'de> Deserialize<'de> for SymbolInfo
impl<'de> Deserialize<'de> for SymbolInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SymbolInfo
impl RefUnwindSafe for SymbolInfo
impl Send for SymbolInfo
impl Sync for SymbolInfo
impl Unpin 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<T> Pointable for T
impl<T> Pointable for T
§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.