pub struct Index { /* private fields */ }Expand description
A stock market index backed by configured data providers.
Created via Providers::index.
Implementations§
Source§impl Index
impl Index
Sourcepub async fn quote(&self) -> Result<IndexQuote>
pub async fn quote(&self) -> Result<IndexQuote>
Fetch the current quote for this index.
Source§impl Index
impl Index
Sourcepub async fn indicators(
&self,
interval: Interval,
range: TimeRange,
) -> Result<IndicatorsSummary>
pub async fn indicators( &self, interval: Interval, range: TimeRange, ) -> Result<IndicatorsSummary>
Compute all technical indicators from this handle’s chart data.
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>
Compute a single technical indicator from this handle’s chart data.
Sourcepub async fn risk(
&self,
interval: Interval,
range: TimeRange,
) -> Result<RiskSummary>
pub async fn risk( &self, interval: Interval, range: TimeRange, ) -> Result<RiskSummary>
Compute a risk summary (VaR, Sharpe/Sortino/Calmar, max drawdown)
from this handle’s chart data. Annualised with this asset class’s
trading calendar, so non-daily intervals scale correctly. beta
is always None (no benchmark for non-equity handles).
Auto Trait Implementations§
impl !Freeze for Index
impl !RefUnwindSafe for Index
impl !UnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnsafeUnpin for Index
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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