Skip to main content

IndicatorDialog

Struct IndicatorDialog 

Source
pub struct IndicatorDialog {
    pub is_open: bool,
    pub favorites: HashSet<String>,
    /* private fields */
}
Expand description

Indicator Dialog

Modal dialog for searching and adding indicators. It lists studies from its IndicatorFactory, filtered by the supplied source and feed capabilities; a click or Enter on a row adds that study with its default inputs and leaves the dialog open for the next one. Edit the inputs of an added study with IndicatorSettingsDialog.

Fields§

§is_open: bool

Is dialog open

§favorites: HashSet<String>

Favorite indicator IDs

Implementations§

Source§

impl IndicatorDialog

Source

pub fn set_feed_capabilities( &mut self, capabilities: Option<&FeedCapabilities>, instrument: Option<&Instrument>, )

Restrict studies in the factory’s Order flow category to services explicitly declared for the resolved instrument. Pass Chart::feed_capabilities and Chart::instrument when they change. Missing metadata declares no services. Other categories and saved favorites are unchanged. Until the first call every study is offered. Requirements are cached between updates.

Source

pub fn preferences(&self) -> IndicatorPreferences

Settings to save in the host’s user settings document. The dialog owns no storage.

Source

pub fn set_preferences(&mut self, preferences: IndicatorPreferences)

Restore the user’s saved browser settings, including unavailable host studies.

Source

pub fn new() -> Self

Create a new indicator dialog with the built-in studies

Source

pub fn with_factory(self, factory: IndicatorFactory) -> Self

List and create the studies of factory, such as the built-ins and the host’s own added with IndicatorFactory::register

Source

pub fn set_metric_source( &mut self, feed: Option<Arc<dyn Datafeed>>, symbol: &str, )

List the metrics a feed offers for this instrument alongside the technical studies. Replacing the feed or symbol discards pending replies from the previous source.

Source

pub fn indicators(&self) -> &[IndicatorInfo]

The catalogue sorted by display name, including the feed’s metrics. Entries hidden by source or feed capability filters remain in this list.

Source

pub fn factory(&self) -> &IndicatorFactory

The factory that creates the listed studies, for a host that adds one by its id outside the dialog.

Source

pub fn with_config(self, config: IndicatorDialogConfig) -> Self

Set a custom dialog configuration; its TRANSPARENT colours follow the theme

Source

pub fn open(&mut self)

Open the dialog on the Indicators tab with the search field focused

Source

pub fn open_for_chart( &mut self, chart: &Chart, source: Option<StudySource>, ) -> bool

Open for chart. source preselects an input for an Add indicator action: the dialog then lists only the studies that accept a source, and each one added carries it, through ConfiguredStudy where needed. A study output chart does not have leaves the dialog closed.

Source

pub fn open_tab(&mut self, tab: IndicatorTab)

Open the dialog on tab with the search field focused. Dedicated pages open among the built-ins; an unavailable page opens on the first populated page.

Source

pub fn set_full(&mut self, full: bool)

Whether the chart takes no more studies. The dialog then says so and adds none; call it before each show, as the cap can be reached while the dialog is open.

Source

pub fn close(&mut self)

Close the dialog

Source

pub fn is_open(&self) -> bool

Check if dialog is open

Source

pub fn sync_open_state(&mut self, should_be_open: bool)

Sync dialog open/close state from an external flag.

Source

pub fn show(&mut self, ctx: &Context, theme: &Theme) -> IndicatorDialogAction

Show the dialog with live theme colors

Trait Implementations§

Source§

impl Default for IndicatorDialog

Source§

fn default() -> Self

Returns the “default value” for a type. 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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

impl<T> MaybeSend for T
where T: Send + Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

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.