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
impl Ticker
Sourcepub async fn new(symbol: impl Into<String>) -> Result<Self>
pub async fn new(symbol: impl Into<String>) -> Result<Self>
Creates a new ticker with default configuration.
Sourcepub fn builder(symbol: impl Into<String>) -> TickerBuilder
pub fn builder(symbol: impl Into<String>) -> TickerBuilder
Creates a new builder for Ticker.
Sourcepub fn client_handle(&self) -> ClientHandle
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.
Sourcepub async fn quote(&self) -> Result<Quote>
pub async fn quote(&self) -> Result<Quote>
Get full quote data, optionally including logo URLs.
Sourcepub async fn quote_value(&self) -> Result<Value>
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.
Sourcepub async fn chart(&self, interval: Interval, range: TimeRange) -> Result<Chart>
pub async fn chart(&self, interval: Interval, range: TimeRange) -> Result<Chart>
Get historical OHLCV chart data.
Sourcepub async fn chart_range(
&self,
interval: Interval,
start: i64,
end: i64,
) -> Result<Chart>
pub async fn chart_range( &self, interval: Interval, start: i64, end: i64, ) -> Result<Chart>
Get chart data for a custom start/end timestamp range.
Sourcepub async fn dividend_analytics(
&self,
range: TimeRange,
) -> Result<DividendAnalytics>
pub async fn dividend_analytics( &self, range: TimeRange, ) -> Result<DividendAnalytics>
Compute dividend analytics for the requested time range.
Sourcepub async fn capital_gains(&self, range: TimeRange) -> Result<Vec<CapitalGain>>
pub async fn capital_gains(&self, range: TimeRange) -> Result<Vec<CapitalGain>>
Get capital gains distribution history.
Sourcepub async fn recommendations(&self, limit: u32) -> Result<Recommendation>
pub async fn recommendations(&self, limit: u32) -> Result<Recommendation>
Get analyst recommendations and similar symbols.
Sourcepub async fn financials(
&self,
stmt_type: StatementType,
frequency: Frequency,
) -> Result<FinancialStatement>
pub async fn financials( &self, stmt_type: StatementType, frequency: Frequency, ) -> Result<FinancialStatement>
Get financial statements.
Sourcepub async fn indicators(
&self,
interval: Interval,
range: TimeRange,
) -> Result<IndicatorsSummary>
pub async fn indicators( &self, interval: Interval, range: TimeRange, ) -> Result<IndicatorsSummary>
Calculate all technical indicators from chart data.
Sourcepub async fn edgar_submissions(&self) -> Result<EdgarSubmissions>
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.
Sourcepub async fn edgar_company_facts(&self) -> Result<CompanyFacts>
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.
Sourcepub async fn filings(&self) -> Result<ProviderFilings>
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.
Sourcepub async fn indicator(
&self,
indicator: Indicator,
interval: Interval,
range: TimeRange,
) -> Result<IndicatorResult>
pub async fn indicator( &self, indicator: Indicator, interval: Interval, range: TimeRange, ) -> Result<IndicatorResult>
Calculate a specific technical indicator over a time range.
Sourcepub async fn backtest<S: Strategy>(
&self,
strategy: S,
interval: Interval,
range: TimeRange,
config: Option<BacktestConfig>,
) -> Result<BacktestResult>
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.
Sourcepub async fn backtest_with_benchmark<S: Strategy>(
&self,
strategy: S,
interval: Interval,
range: TimeRange,
config: Option<BacktestConfig>,
benchmark: &str,
) -> Result<BacktestResult>
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§impl Ticker
impl Ticker
pub async fn price(&self) -> Result<Option<Price>>
pub async fn summary_detail(&self) -> Result<Option<SummaryDetail>>
pub async fn financial_data(&self) -> Result<Option<FinancialData>>
pub async fn key_stats(&self) -> Result<Option<DefaultKeyStatistics>>
pub async fn asset_profile(&self) -> Result<Option<AssetProfile>>
pub async fn calendar_events(&self) -> Result<Option<CalendarEvents>>
pub async fn earnings(&self) -> Result<Option<Earnings>>
pub async fn earnings_trend(&self) -> Result<Option<EarningsTrend>>
pub async fn earnings_history(&self) -> Result<Option<EarningsHistory>>
pub async fn recommendation_trend(&self) -> Result<Option<RecommendationTrend>>
pub async fn insider_holders(&self) -> Result<Option<InsiderHolders>>
pub async fn insider_transactions(&self) -> Result<Option<InsiderTransactions>>
pub async fn institution_ownership( &self, ) -> Result<Option<InstitutionOwnership>>
pub async fn fund_ownership(&self) -> Result<Option<FundOwnership>>
pub async fn major_holders(&self) -> Result<Option<MajorHoldersBreakdown>>
pub async fn quote_type(&self) -> Result<Option<QuoteTypeData>>
pub async fn summary_profile(&self) -> Result<Option<SummaryProfile>>
pub async fn sec_filings(&self) -> Result<Option<SecFilings>>
pub async fn grading_history(&self) -> Result<Option<UpgradeDowngradeHistory>>
pub async fn fund_performance(&self) -> Result<Option<FundPerformance>>
pub async fn fund_profile(&self) -> Result<Option<FundProfile>>
pub async fn top_holdings(&self) -> Result<Option<TopHoldings>>
pub async fn index_trend(&self) -> Result<Option<IndexTrend>>
pub async fn industry_trend(&self) -> Result<Option<IndustryTrend>>
pub async fn sector_trend(&self) -> Result<Option<SectorTrend>>
pub async fn equity_performance(&self) -> Result<Option<EquityPerformance>>
Auto Trait Implementations§
impl Freeze for Ticker
impl !RefUnwindSafe for Ticker
impl Send for Ticker
impl Sync for Ticker
impl Unpin for Ticker
impl UnsafeUnpin for Ticker
impl !UnwindSafe for Ticker
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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