Struct SymbolInfo

Source
pub struct SymbolInfo { /* private fields */ }
Expand description

Symbol metadata used by syminfo.* builtins.

Implementations§

Source§

impl SymbolInfo

Source

pub fn with_description(self, description: impl Into<String>) -> Self

Sets the description of the symbol.

Source

pub fn with_type(self, type_: SymbolType) -> Self

Sets the type of the symbol.

Source

pub fn with_country(self, country: impl Into<String>) -> Self

Sets the country of the symbol.

Source

pub fn with_isin(self, isin: impl Into<String>) -> Self

Sets the ISIN of the symbol.

Source

pub fn with_root(self, root: impl Into<String>) -> Self

Sets the root of the symbol.

Source

pub fn with_min_move(self, min_move: i32) -> Self

Sets the min move of the symbol.

Source

pub fn with_price_scale(self, price_scale: i32) -> Self

Sets the price scale of the symbol.

Source

pub fn with_point_value(self, point_value: f64) -> Self

Sets the point value of the symbol.

Source

pub fn with_currency(self, currency: Currency) -> Self

Sets the currency of the symbol.

Source

pub fn with_expiration_date(self, expiration_date: OffsetDateTime) -> Self

Sets the expiration date of the symbol.

Source

pub fn with_current_contract(self, current_contract: impl Into<String>) -> Self

Sets the current contract of the symbol.

Source

pub fn with_base_currency(self, base_currency: Currency) -> Self

Sets the base currency of the symbol.

Source

pub fn with_employees(self, employees: i64) -> Self

Sets the number of employees of the symbol.

Source

pub fn with_industry(self, industry: impl Into<String>) -> Self

Sets the industry of the symbol.

Source

pub fn with_sector(self, sector: impl Into<String>) -> Self

Sets the sector of the symbol.

Source

pub fn with_min_contract(self, min_contract: f64) -> Self

Sets the minimum contract size of the symbol.

Source

pub fn with_volume_type(self, volume_type: VolumeType) -> Self

Sets the volume type of the symbol.

Source

pub fn market(&self) -> &Market

Returns the market the symbol belongs to.

Source

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

Returns the description of the symbol.

Source

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

Returns the type of market the symbol belongs to.

Source

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
Source

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”.
Source

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”.
Source

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.

Source

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.

Source

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.

Source

pub fn currency(&self) -> Currency

Returns the currency of the symbol’s prices.

For example:

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

pub fn timezone(&self) -> TimeZone

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

Source

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

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

Source

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

Returns the ticker identifier of the underlying contract.

Source

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”.
Source

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

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

Source

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

Returns the industry of the company (for stocks).

Source

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

Returns the sector of the company (for stocks).

Source

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

Returns the minimum contract size for the symbol.

Source

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

Returns the volume type of the current symbol.

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

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

Returns the date of the latest recommendations update.

Source

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

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

Source

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

Returns the number of shareholders the company has.

Source

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.

Source

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.

Source

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

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

Source

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

Returns the date of the latest target price update.

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

pub fn min_tick(&self) -> f64

Returns the min tick value for the current symbol.

Trait Implementations§

Source§

impl Clone for SymbolInfo

Source§

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

impl Debug for SymbolInfo

Source§

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

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

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

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 Serialize for SymbolInfo

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

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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>,