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: boolIs dialog open
favorites: HashSet<String>Favorite indicator IDs
Implementations§
Source§impl IndicatorDialog
impl IndicatorDialog
Sourcepub fn set_feed_capabilities(
&mut self,
capabilities: Option<&FeedCapabilities>,
instrument: Option<&Instrument>,
)
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.
Sourcepub fn preferences(&self) -> IndicatorPreferences
pub fn preferences(&self) -> IndicatorPreferences
Settings to save in the host’s user settings document. The dialog owns no storage.
Sourcepub fn set_preferences(&mut self, preferences: IndicatorPreferences)
pub fn set_preferences(&mut self, preferences: IndicatorPreferences)
Restore the user’s saved browser settings, including unavailable host studies.
Sourcepub fn with_factory(self, factory: IndicatorFactory) -> Self
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
Sourcepub fn set_metric_source(
&mut self,
feed: Option<Arc<dyn Datafeed>>,
symbol: &str,
)
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.
Sourcepub fn indicators(&self) -> &[IndicatorInfo]
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.
Sourcepub fn factory(&self) -> &IndicatorFactory
pub fn factory(&self) -> &IndicatorFactory
The factory that creates the listed studies, for a host that adds one by its id outside the dialog.
Sourcepub fn with_config(self, config: IndicatorDialogConfig) -> Self
pub fn with_config(self, config: IndicatorDialogConfig) -> Self
Set a custom dialog configuration; its TRANSPARENT colours follow the theme
Sourcepub fn open_for_chart(
&mut self,
chart: &Chart,
source: Option<StudySource>,
) -> bool
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.
Sourcepub fn open_tab(&mut self, tab: IndicatorTab)
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.
Sourcepub fn set_full(&mut self, full: bool)
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.
Sourcepub fn sync_open_state(&mut self, should_be_open: bool)
pub fn sync_open_state(&mut self, should_be_open: bool)
Sync dialog open/close state from an external flag.
Sourcepub fn show(&mut self, ctx: &Context, theme: &Theme) -> IndicatorDialogAction
pub fn show(&mut self, ctx: &Context, theme: &Theme) -> IndicatorDialogAction
Show the dialog with live theme colors
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for IndicatorDialog
impl !RefUnwindSafe for IndicatorDialog
impl !UnwindSafe for IndicatorDialog
impl Send for IndicatorDialog
impl Sync for IndicatorDialog
impl Unpin for IndicatorDialog
impl UnsafeUnpin for IndicatorDialog
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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