Skip to main content

Ticker

Struct Ticker 

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

The primary entry point for querying financial data for a single symbol.

Data is fetched on first access and cached. Use the builder pattern via Ticker::builder for custom configuration.

Implementations§

Source§

impl Ticker

Source

pub async fn new(symbol: impl Into<String>) -> Result<Self>

Creates a new ticker with default configuration.

Source

pub fn builder(symbol: impl Into<String>) -> TickerBuilder

Creates a new builder for Ticker.

Source

pub fn symbol(&self) -> &str

Returns the ticker symbol.

Source

pub fn client_handle(&self) -> ClientHandle

Returns a handle to the underlying Yahoo Finance session.

Pass to other builders via .client(handle) to share the authenticated session without a new auth handshake.

§Panics

Panics if this ticker was created via Providers with no Yahoo provider configured. For session sharing across multiple tickers, prefer Providers::ticker instead.

Source

pub async fn quote(&self) -> Result<Quote>

Get full quote data, optionally including logo URLs.

Source

pub async fn quote_value(&self) -> Result<Value>

Get quote data as a JSON value, with FormattedValue fields transformed according to the format configured via TickerBuilder::format.

By default (Raw), every FormattedValue field is flattened to its plain numeric value — no .raw/.fmt unwrapping needed. Use ValueFormat::Pretty for human-readable strings or ValueFormat::Both to preserve the full object.

Source

pub async fn chart(&self, interval: Interval, range: TimeRange) -> Result<Chart>

Get historical OHLCV chart data.

Source

pub async fn chart_range( &self, interval: Interval, start: i64, end: i64, ) -> Result<Chart>

Get chart data for a custom start/end timestamp range.

Source

pub async fn dividends(&self, range: TimeRange) -> Result<Vec<Dividend>>

Get dividend history.

Source

pub async fn dividend_analytics( &self, range: TimeRange, ) -> Result<DividendAnalytics>

Compute dividend analytics for the requested time range.

Source

pub async fn splits(&self, range: TimeRange) -> Result<Vec<Split>>

Get stock split history.

Source

pub async fn capital_gains(&self, range: TimeRange) -> Result<Vec<CapitalGain>>

Get capital gains distribution history.

Source

pub async fn recommendations(&self, limit: u32) -> Result<Recommendation>

Get analyst recommendations and similar symbols.

Source

pub async fn news(&self) -> Result<Vec<News>>

Get news articles for this symbol.

Source

pub async fn options(&self, date: Option<i64>) -> Result<Options>

Get the options chain.

Source

pub async fn financials( &self, stmt_type: StatementType, frequency: Frequency, ) -> Result<FinancialStatement>

Get financial statements.

Source

pub async fn indicators( &self, interval: Interval, range: TimeRange, ) -> Result<IndicatorsSummary>

Calculate all technical indicators from chart data.

Source

pub async fn edgar_submissions(&self) -> Result<EdgarSubmissions>

Get SEC EDGAR filing history for this symbol.

Always uses EDGAR directly — this is an EDGAR-specific API (CIK-based submission history and XBRL company facts) that no other provider replicates. For routable provider-agnostic filing data use filings instead.

Source

pub async fn edgar_company_facts(&self) -> Result<CompanyFacts>

Get SEC EDGAR company facts (structured XBRL financial data).

Always uses EDGAR directly — XBRL us-gaap/ifrs/dei fact data is unique to the SEC’s EDGAR API. For routable filing data use filings.

Source

pub async fn filings(&self) -> Result<ProviderFilings>

Fetch SEC filings via the configured Capability::FILINGS provider.

Routes through the provider system; EDGAR is always available as a fallback (auto-injected when no explicit FILINGS route is set). To prefer Polygon: .route(Capability::FILINGS, &[Provider::Polygon, Provider::Edgar]).

For the full EDGAR submissions response or structured XBRL data, use edgar_submissions / edgar_company_facts.

Source

pub async fn indicator( &self, indicator: Indicator, interval: Interval, range: TimeRange, ) -> Result<IndicatorResult>

Calculate a specific technical indicator over a time range.

Source

pub async fn backtest<S: Strategy>( &self, strategy: S, interval: Interval, range: TimeRange, config: Option<BacktestConfig>, ) -> Result<BacktestResult>

Run a backtest with the given strategy and configuration.

Source

pub async fn backtest_with_benchmark<S: Strategy>( &self, strategy: S, interval: Interval, range: TimeRange, config: Option<BacktestConfig>, benchmark: &str, ) -> Result<BacktestResult>

Run a backtest and compare performance against a benchmark symbol.

Source

pub async fn risk( &self, interval: Interval, range: TimeRange, benchmark: Option<&str>, ) -> Result<RiskSummary>

Compute a risk summary for this symbol.

Source§

impl Ticker

Source

pub async fn price(&self) -> Result<Option<Price>>

Source

pub async fn summary_detail(&self) -> Result<Option<SummaryDetail>>

Source

pub async fn financial_data(&self) -> Result<Option<FinancialData>>

Source

pub async fn key_stats(&self) -> Result<Option<DefaultKeyStatistics>>

Source

pub async fn asset_profile(&self) -> Result<Option<AssetProfile>>

Source

pub async fn calendar_events(&self) -> Result<Option<CalendarEvents>>

Source

pub async fn earnings(&self) -> Result<Option<Earnings>>

Source

pub async fn earnings_trend(&self) -> Result<Option<EarningsTrend>>

Source

pub async fn earnings_history(&self) -> Result<Option<EarningsHistory>>

Source

pub async fn recommendation_trend(&self) -> Result<Option<RecommendationTrend>>

Source

pub async fn insider_holders(&self) -> Result<Option<InsiderHolders>>

Source

pub async fn insider_transactions(&self) -> Result<Option<InsiderTransactions>>

Source

pub async fn institution_ownership( &self, ) -> Result<Option<InstitutionOwnership>>

Source

pub async fn fund_ownership(&self) -> Result<Option<FundOwnership>>

Source

pub async fn major_holders(&self) -> Result<Option<MajorHoldersBreakdown>>

Source

pub async fn share_purchase_activity( &self, ) -> Result<Option<NetSharePurchaseActivity>>

Source

pub async fn quote_type(&self) -> Result<Option<QuoteTypeData>>

Source

pub async fn summary_profile(&self) -> Result<Option<SummaryProfile>>

Source

pub async fn sec_filings(&self) -> Result<Option<SecFilings>>

Source

pub async fn grading_history(&self) -> Result<Option<UpgradeDowngradeHistory>>

Source

pub async fn fund_performance(&self) -> Result<Option<FundPerformance>>

Source

pub async fn fund_profile(&self) -> Result<Option<FundProfile>>

Source

pub async fn top_holdings(&self) -> Result<Option<TopHoldings>>

Source

pub async fn index_trend(&self) -> Result<Option<IndexTrend>>

Source

pub async fn industry_trend(&self) -> Result<Option<IndustryTrend>>

Source

pub async fn sector_trend(&self) -> Result<Option<SectorTrend>>

Source

pub async fn equity_performance(&self) -> Result<Option<EquityPerformance>>

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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> Same for T

Source§

type Output = T

Should always be Self
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.
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
Source§

impl<T> PlanCallbackArgs for T

Source§

impl<T> PlanCallbackOut for T