pub trait Indicator: Send {
Show 76 methods
// Required methods
fn name(&self) -> &str;
fn calculate(&mut self, data: &[Bar]);
fn values(&self) -> &IndicatorValues;
fn colors(&self) -> Vec<Color32>;
fn set_colors(&mut self, colors: Vec<Color32>);
fn set_visible(&mut self, visible: bool);
fn clone_box(&self) -> Box<dyn Indicator>;
// Provided methods
fn projections(&self) -> &[StudyProjection] { ... }
fn table(&self) -> Option<&StudyTable> { ... }
fn has_settings(&self) -> bool { ... }
fn projection_fill_color(&self, projection: &StudyProjection) -> Color32 { ... }
fn plot_label_colors(&self, _line: usize) -> Option<(Color32, Color32)> { ... }
fn marker_style(&self) -> Option<PlotStyle> { ... }
fn level_style(&self, _value: f64) -> LineStyle { ... }
fn level_fill_color(&self) -> Color32 { ... }
fn plot_style(&self, line: usize) -> PlotStyle { ... }
fn legend_visible(&self, line: usize) -> bool { ... }
fn plot_tagged(&self, line: usize) -> bool { ... }
fn plot_output(&self, line: usize) -> usize { ... }
fn plot_offset(&self, line: usize) -> isize { ... }
fn plot_color(&self, line: usize, bar: usize) -> Option<Color32> { ... }
fn provisional_after(&self, line: usize) -> Option<usize> { ... }
fn plot_text(&self, line: usize, bar: usize) -> Option<String> { ... }
fn fills(&self) -> Vec<StudyFill> { ... }
fn plot_value(&self, line: usize, bar: usize) -> Option<f64> { ... }
fn settings(&self) -> StudySettings { ... }
fn snapshot_settings(&self) -> StudySettingsSnapshot { ... }
fn restore_settings(
&mut self,
snapshot: &StudySettingsSnapshot,
) -> Result<(), StudyError> { ... }
fn apply_settings(
&mut self,
inputs: &[(String, InputValue)],
settings: StudySettings,
) -> Result<(), StudyError> { ... }
fn set_visible_range(&mut self, range: Range<usize>) -> bool { ... }
fn set_timeframe(&mut self, timeframe: Timeframe) { ... }
fn set_bar_clock(&mut self, clock: &BarClock) -> bool { ... }
fn value_format(&self) -> StudyFormat { ... }
fn scale(&self) -> StudyScale { ... }
fn scale_mapping(&self) -> Option<PriceMap> { ... }
fn set_scale_mapping(&mut self, mapping: Option<PriceMap>) { ... }
fn set_value_formatter(
&mut self,
formatter: Option<Arc<dyn PriceFormatter>>,
) -> bool { ... }
fn format_value(&self, value: f64) -> String { ... }
fn format_plot_value(&self, line: usize, value: f64) -> String { ... }
fn precision(&self) -> Option<usize> { ... }
fn data_requests(&self) -> Vec<StudyDataRequest> { ... }
fn data_start(&self, request: &StudyDataRequest) -> Option<DateTime<Utc>> { ... }
fn update_data(
&mut self,
data: &[Bar],
from: usize,
sources: &[StudyData<'_>],
) { ... }
fn source(&self) -> Option<StudySource> { ... }
fn update_source(&mut self, data: &[Bar], from: usize, source: &[f64]) { ... }
fn inputs(&self) -> Vec<StudyInput> { ... }
fn set_input(
&mut self,
id: &str,
value: InputValue,
) -> Result<(), StudyError> { ... }
fn desc(&self) -> &str { ... }
fn order_flow_inputs(&self) -> &[OrderFlowInput] { ... }
fn needs_order_flow(&self) -> bool { ... }
fn update(&mut self, data: &[Bar], from: usize) { ... }
fn is_incremental(&self) -> bool { ... }
fn set_instrument(&mut self, instrument: Option<&Instrument>) -> bool { ... }
fn set_time_scale_events(&mut self, events: &[TimeScaleEvent]) -> bool { ... }
fn line_style(&self, line: usize) -> IndicatorLineStyle { ... }
fn candles(&self) -> &[StudyCandle] { ... }
fn drawings(&self) -> &[Drawing] { ... }
fn tpo(&self) -> Option<&TPOConfig> { ... }
fn zones(&self) -> &[StudyZone] { ... }
fn zones_cover_whole_bars(&self) -> bool { ... }
fn labels(&self) -> &[StudyLabel] { ... }
fn labels_on_price(&self) -> bool { ... }
fn set_label_precision(&mut self, precision: Option<usize>) { ... }
fn volume_profiles(&self, visible: Range<usize>) -> Vec<StudyProfile> { ... }
fn markers(&self) -> &[IndicatorMarker] { ... }
fn extend_right(&self) -> bool { ... }
fn plot_label(&self) -> Option<(usize, String)> { ... }
fn set_color(&mut self, line_idx: usize, color: Color32) { ... }
fn is_overlay(&self) -> bool { ... }
fn pane(&self) -> StudyPane { ... }
fn set_overlay(&mut self, _overlay: bool) -> bool { ... }
fn set_scale(&mut self, _scale: StudyScale) -> bool { ... }
fn is_volume(&self) -> bool { ... }
fn line_count(&self) -> usize { ... }
fn line_names(&self) -> Vec<String> { ... }
fn is_visible(&self) -> bool { ... }
}Expand description
The core trait that every technical indicator must implement.
The trait defines the full indicator lifecycle: naming, calculation,
value access, color management, and display properties. It is
object-safe so indicators can be stored as Box<dyn Indicator> in
the IndicatorRegistry.
§Implementors
All built-in indicators implement this trait (e.g. SMA, RSI, MACD with the
studies feature), and users can implement it
for their own indicators or use CustomIndicator
to define one at runtime via a closure.
§Lifecycle
- Construct the indicator with desired parameters. Built-in indicators
raise a length (period, smoothing, level or row count) of 0 to 1, and
clamp a float parameter (multiplier, percentage, divisor, threshold or
tick size) into the range its constructor or setter documents, NaN to
the bottom of that range. No length, parameter or bar value makes
calculatepanic or allocate without bound. - Call
calculatewith bar data. - Read results via
values. - The rendering layer queries
is_overlay,colors,line_names, etc. for drawing.
§Non-finite bars
A bar whose inputs, the fields a study reads, are not finite has no value, and the
study computes every other bar as if that bar were not in the series, so running
state carries over it unchanged. A window study may also leave the windows that
contain it without a value. The chart’s datafeed drops such bars before they reach a
study, so this matters to direct callers of calculate.
Required Methods§
Sourcefn name(&self) -> &str
fn name(&self) -> &str
Return the short display name of this indicator (e.g. "SMA", "RSI", "MACD").
Sourcefn calculate(&mut self, data: &[Bar])
fn calculate(&mut self, data: &[Bar])
Compute the indicator’s output from the given bar data.
After this call, values returns one
IndicatorValue per input bar. Implementations should clear
any previous state so the indicator can be recalculated on new data.
Sourcefn values(&self) -> &IndicatorValues
fn values(&self) -> &IndicatorValues
Return the computed output columns, with NaN for missing values.
The length of the returned output matches the length of the data
slice most recently passed to calculate.
Sourcefn colors(&self) -> Vec<Color32>
fn colors(&self) -> Vec<Color32>
Return the plot colours and any extra palette entries used by fills or per-bar colouring.
Extra palette entries are saved with the study and do not add output columns. Their layout is specific to the study.
Sourcefn set_colors(&mut self, colors: Vec<Color32>)
fn set_colors(&mut self, colors: Vec<Color32>)
Replace all line colors at once.
For single-line indicators, pass a Vec with one color.
For multi-line indicators, pass one color per line.
Sourcefn set_visible(&mut self, visible: bool)
fn set_visible(&mut self, visible: bool)
Show or hide this indicator.
Provided Methods§
Sourcefn projections(&self) -> &[StudyProjection]
fn projections(&self) -> &[StudyProjection]
Sparse projected price bands, with fractional endpoints in future whitespace.
Sourcefn table(&self) -> Option<&StudyTable>
fn table(&self) -> Option<&StudyTable>
A labelled table of the latest study statistics, drawn independently of the plots.
Sourcefn has_settings(&self) -> bool
fn has_settings(&self) -> bool
Whether this study stores presentation edits itself. Charts wrap other studies once.
Sourcefn projection_fill_color(&self, projection: &StudyProjection) -> Color32
fn projection_fill_color(&self, projection: &StudyProjection) -> Color32
Colour inside a projected price band.
Sourcefn plot_label_colors(&self, _line: usize) -> Option<(Color32, Color32)>
fn plot_label_colors(&self, _line: usize) -> Option<(Color32, Color32)>
Optional background and text colours for captions on plotted markers.
Sourcefn marker_style(&self) -> Option<PlotStyle>
fn marker_style(&self) -> Option<PlotStyle>
Optional presentation of crossing markers; absent uses directional triangles.
Sourcefn level_style(&self, _value: f64) -> LineStyle
fn level_style(&self, _value: f64) -> LineStyle
Stroke pattern for a pane level at the given value.
Sourcefn level_fill_color(&self) -> Color32
fn level_fill_color(&self) -> Color32
Colour of the band between the outer pane levels.
Sourcefn plot_style(&self, line: usize) -> PlotStyle
fn plot_style(&self, line: usize) -> PlotStyle
Presentation defaults for a zero-based output line. Any line is accepted: one at or past
line_count, which renderers do not draw, still gets a style, so an
implementation must not panic on it. The default takes the line’s colour from
colors, white for a line without one, and its width from
line_style.
Sourcefn legend_visible(&self, line: usize) -> bool
fn legend_visible(&self, line: usize) -> bool
Whether output line appears in the legend. Defaults to plot visibility; a study can
retain a labelled readout for a quantity excluded from its plot and scale by default.
Sourcefn plot_tagged(&self, line: usize) -> bool
fn plot_tagged(&self, line: usize) -> bool
Whether plot line shows its last value in a tag on the price scale while the chart
shows study values. By default every plot of a study with up to four plots does and no
plot of a study with more, whose values stay in the legend, so that the tags leave the
scale’s tick labels readable. A study on a chart starts from this choice and keeps the
user’s in StudySettings::untagged_plots.
Sourcefn plot_output(&self, line: usize) -> usize
fn plot_output(&self, line: usize) -> usize
The output whose visibility in the style tab also applies to plot line, for a plot past
line_count that draws zones or candles for one of the outputs. The
default is line itself.
Sourcefn plot_offset(&self, line: usize) -> isize
fn plot_offset(&self, line: usize) -> isize
Horizontal displacement in bars. Positive values draw into future whitespace. Values remain indexed by their source bar; missing bars still occupy a position.
Sourcefn plot_color(&self, line: usize, bar: usize) -> Option<Color32>
fn plot_color(&self, line: usize, bar: usize) -> Option<Color32>
Optional per-bar colour, overriding the plot colour at a source bar.
Sourcefn provisional_after(&self, line: usize) -> Option<usize>
fn provisional_after(&self, line: usize) -> Option<usize>
The last source bar whose value on a zero-based line is final. The segments after it can
still move with later bars and are drawn dashed when the line is solid. None, the
default, draws the whole line as styled.
Sourcefn plot_text(&self, line: usize, bar: usize) -> Option<String>
fn plot_text(&self, line: usize, bar: usize) -> Option<String>
Optional text beside the shape a circle, cross or triangle plot draws at a source bar: under an upward triangle and over the other shapes, in the shape’s colour.
Sourcefn fills(&self) -> Vec<StudyFill>
fn fills(&self) -> Vec<StudyFill>
Filled bands, painted beneath this study’s plots. Missing endpoints break a band.
Sourcefn plot_value(&self, line: usize, bar: usize) -> Option<f64>
fn plot_value(&self, line: usize, bar: usize) -> Option<f64>
Value at a displayed bar, accounting for the plot’s displacement.
Sourcefn settings(&self) -> StudySettings
fn settings(&self) -> StudySettings
Current applied presentation, initialized from the study’s own defaults.
Sourcefn snapshot_settings(&self) -> StudySettingsSnapshot
fn snapshot_settings(&self) -> StudySettingsSnapshot
Capture editable inputs and presentation without copying calculated values.
The chart presentation wrapper also retains visibility before interval filtering.
Custom presentations can use super::StudySettingsSnapshot::capture with their
global visibility toggle to do the same.
Sourcefn restore_settings(
&mut self,
snapshot: &StudySettingsSnapshot,
) -> Result<(), StudyError>
fn restore_settings( &mut self, snapshot: &StudySettingsSnapshot, ) -> Result<(), StudyError>
Restore a snapshot from this study. Recalculate against current data afterwards.
The default applies changed inputs and presentation through Self::apply_settings.
Returns an error if the snapshot is no longer accepted.
Sourcefn apply_settings(
&mut self,
inputs: &[(String, InputValue)],
settings: StudySettings,
) -> Result<(), StudyError>
fn apply_settings( &mut self, inputs: &[(String, InputValue)], settings: StudySettings, ) -> Result<(), StudyError>
Apply a complete edit atomically. Charts wrap studies in ConfiguredStudy,
which validates inputs on a clone before replacing the calculation and presentation.
Sourcefn set_visible_range(&mut self, range: Range<usize>) -> bool
fn set_visible_range(&mut self, range: Range<usize>) -> bool
Visible source bars, end exclusive, supplied after pan, zoom and resize and before autoscaling. Returns whether values need recalculation. Direct callers may supply it too.
Sourcefn set_timeframe(&mut self, timeframe: Timeframe)
fn set_timeframe(&mut self, timeframe: Timeframe)
The chart’s current interval, supplied when added and when the interval changes.
Sourcefn set_bar_clock(&mut self, clock: &BarClock) -> bool
fn set_bar_clock(&mut self, clock: &BarClock) -> bool
Source bar calendar, including the chart’s selected timezone and session anchor. Returns whether cached values must be recalculated. Direct callers default to UTC.
Sourcefn value_format(&self) -> StudyFormat
fn value_format(&self) -> StudyFormat
Units of this study’s values. Placement defaults preserve price overlays and numeric panes.
Sourcefn scale(&self) -> StudyScale
fn scale(&self) -> StudyScale
Scale used in the pane selected by is_overlay.
Sourcefn scale_mapping(&self) -> Option<PriceMap>
fn scale_mapping(&self) -> Option<PriceMap>
Price mapping supplied by the chart for a shared scale, independent of pane bounds. Custom presentation implementations can retain it to support shared scales.
Sourcefn set_scale_mapping(&mut self, mapping: Option<PriceMap>)
fn set_scale_mapping(&mut self, mapping: Option<PriceMap>)
Updates the chart’s shared-scale mapping. None restores the ordinary pane mapping.
Sourcefn set_value_formatter(
&mut self,
formatter: Option<Arc<dyn PriceFormatter>>,
) -> bool
fn set_value_formatter( &mut self, formatter: Option<Arc<dyn PriceFormatter>>, ) -> bool
Replaces value formatting when supported by the presentation. None restores the
declared units and precision. Returns false when this study owns its formatting.
Sourcefn format_value(&self, value: f64) -> String
fn format_value(&self, value: f64) -> String
Format a value using the declared units and current precision override.
Sourcefn format_plot_value(&self, line: usize, value: f64) -> String
fn format_plot_value(&self, line: usize, value: f64) -> String
Formats one output, including readouts whose units differ from the study’s scale.
The default uses format_value.
Sourcefn precision(&self) -> Option<usize>
fn precision(&self) -> Option<usize>
Decimal places for study readouts, or the format’s default precision.
Sourcefn data_requests(&self) -> Vec<StudyDataRequest>
fn data_requests(&self) -> Vec<StudyDataRequest>
Additional histories this study needs. The chart resolves defaults, requests history and live updates from its feed, and supplies them before recalculating the study.
Sourcefn data_start(&self, request: &StudyDataRequest) -> Option<DateTime<Utc>>
fn data_start(&self, request: &StudyDataRequest) -> Option<DateTime<Utc>>
The oldest time this study reads from request, one of its
data_requests. A connected feed stops loading older
history of that series once it holds a bar at or before the earliest such time of the
studies reading it, and loads more when that time moves earlier. None, the default,
and a time before the chart’s first bar load the series back to that bar. Price-based
chart types such as Renko do not use the times and always load it back to that bar.
Sourcefn update_data(&mut self, data: &[Bar], from: usize, sources: &[StudyData<'_>])
fn update_data(&mut self, data: &[Bar], from: usize, sources: &[StudyData<'_>])
Update with requested histories. Studies using only chart bars keep the default.
Pass 0 when a requested history changes; nonzero from retains the same requested
histories and follows update’s unchanged-prefix contract.
Sourcefn source(&self) -> Option<StudySource>
fn source(&self) -> Option<StudySource>
The single price series this study reads, or None for OHLC or multi-source studies.
Configured studies expose this as a Source input. Study references use chart ids and
undisplaced output columns; missing or cyclic references produce missing values.
Sourcefn update_source(&mut self, data: &[Bar], from: usize, source: &[f64])
fn update_source(&mut self, data: &[Bar], from: usize, source: &[f64])
Update using an aligned source column. Missing source values remain gaps. The default substitutes the source for OHLC and retains the bar’s other fields.
Sourcefn inputs(&self) -> Vec<StudyInput>
fn inputs(&self) -> Vec<StudyInput>
Current editable inputs. A host study can supply the same schema as built-ins.
Sourcefn set_input(&mut self, id: &str, value: InputValue) -> Result<(), StudyError>
fn set_input(&mut self, id: &str, value: InputValue) -> Result<(), StudyError>
Change a calculation input, rejecting unknown ids with super::StudyError::UnknownInput
and wrong types and invalid values with super::StudyError::InvalidInput.
On success cached values are cleared; calculate again or let the chart refresh.
Sourcefn desc(&self) -> &str
fn desc(&self) -> &str
Return a human-readable description of what this indicator measures.
Defaults to an empty string. Override to provide a tooltip-friendly
summary such as "Relative Strength Index - Momentum oscillator (0-100)".
Sourcefn order_flow_inputs(&self) -> &[OrderFlowInput]
fn order_flow_inputs(&self) -> &[OrderFlowInput]
Order-flow sources this study reads: OrderFlowInputs of
fixed aggregations, footprints or books. A chart with a feed connects them before its
updates are coalesced, gives them its instrument’s tick size, applies the trade store’s
retention and the replay cutoff, and updates the study from the first bar that changed.
Hosts without a feed push events through the handles and recalculate. Several studies may
return the same source; it receives each event once.
Sourcefn needs_order_flow(&self) -> bool
fn needs_order_flow(&self) -> bool
Whether the study has results only with its
order_flow_inputs, so that it cannot be calculated on the bars
of another interval or symbol, whose order flow the chart does not hold. The default is
whether it names any. A study that builds its results from the bars and refines them with
order flow where the chart holds it returns false, and keeps its Interval input.
Sourcefn update(&mut self, data: &[Bar], from: usize)
fn update(&mut self, data: &[Bar], from: usize)
Bring values up to date after data[from..] changed or grew,
given that data[..from] is unchanged since the previous call. The values equal those of
calculate on the same data, bit for bit. After bars are
prepended, or after a setting of the study changed, pass 0; after bars are removed from
the end pass the new length.
The default recomputes everything.
Sourcefn is_incremental(&self) -> bool
fn is_incremental(&self) -> bool
Whether live updates avoid recomputing unaffected history. Causal studies do work
independent of the series length; studies that redraw earlier legs or periods also
revisit the bars whose output changes. Earlier corrections may recompute in full.
Defaults to false.
Sourcefn set_instrument(&mut self, instrument: Option<&Instrument>) -> bool
fn set_instrument(&mut self, instrument: Option<&Instrument>) -> bool
Apply the chart instrument’s time zone and trading session. Returns true
if calculation settings changed and the caller must recalculate from bar 0.
The chart calls this on add and before calculation after its symbol or metadata changes.
None clears chart metadata and restores the study’s own settings.
Studies independent of instrument metadata keep the default.
Sourcefn set_time_scale_events(&mut self, events: &[TimeScaleEvent]) -> bool
fn set_time_scale_events(&mut self, events: &[TimeScaleEvent]) -> bool
The typed events the chart holds for its symbol, those given to
Chart::set_time_scale_events, in the order supplied. Returns true if calculation
settings changed and the caller must recalculate from bar 0. The chart calls this on add
and before calculation. Studies that read no events keep the default.
Sourcefn line_style(&self, line: usize) -> IndicatorLineStyle
fn line_style(&self, line: usize) -> IndicatorLineStyle
Rendering style of an overlay line. Defaults to a 1 px line in its configured colour.
Any line is accepted, as for plot_style.
Sourcefn candles(&self) -> &[StudyCandle]
fn candles(&self) -> &[StudyCandle]
Candle bodies and wicks, rendered in place of line plots when nonempty. Source ranges and OHLCV remain available to hosts for per-bar readouts.
Sourcefn drawings(&self) -> &[Drawing]
fn drawings(&self) -> &[Drawing]
Drawing geometry generated by this study, styled as plot 0, empty by default.
Calculations belong in calculate; use tools whose renderer needs only their anchors
and settings, such as trend lines, parallel channels, Fibonacci levels and pitchforks.
Sourcefn tpo(&self) -> Option<&TPOConfig>
fn tpo(&self) -> Option<&TPOConfig>
Market Profile settings of a study whose session profiles the chart builds with
to_tpo_profiles and draws on the price pane, beside
each session’s bars, as it does for the TPO chart type. None by default.
Sourcefn zones(&self) -> &[StudyZone]
fn zones(&self) -> &[StudyZone]
Price bands painted beneath this study’s plots, stored per zone rather than per bar. Empty by default.
Sourcefn zones_cover_whole_bars(&self) -> bool
fn zones_cover_whole_bars(&self) -> bool
Whether each of zones spans its bars from the left edge of the first to
the right edge of the last, as study candles do, rather than from the centre of the first
to the centre of the last. Off by default.
Sourcefn labels(&self) -> &[StudyLabel]
fn labels(&self) -> &[StudyLabel]
Text beside study values, in order of bar. The chart draws the labels near the visible
bars, in the colour of their plot, inside the plot area, so they never run under the
price axis. Empty by default. Keep the text from the last calculation: it is drawn every
frame.
Sourcefn labels_on_price(&self) -> bool
fn labels_on_price(&self) -> bool
Draw labels on the main price chart, even when the study has its
own pane. Label prices use the main series’ scale. Off by default.
Sourcefn set_label_precision(&mut self, precision: Option<usize>)
fn set_label_precision(&mut self, precision: Option<usize>)
The decimal places the study’s presentation settings set for the prices in
labels, None when they set none and the instrument’s decimals apply.
The text is written when the study calculates, so calculate again afterwards, as a chart
does after any settings edit. Studies without price labels keep the default.
Sourcefn volume_profiles(&self, visible: Range<usize>) -> Vec<StudyProfile>
fn volume_profiles(&self, visible: Range<usize>) -> Vec<StudyProfile>
Price-row volume profiles intersecting a half-open visible source-bar range. Fixed and calendar profiles include their whole selected span, even offscreen bars. Visible-range studies recompute for this range; ordinary studies return no profiles.
Sourcefn markers(&self) -> &[IndicatorMarker]
fn markers(&self) -> &[IndicatorMarker]
Shapes attached to study values, empty by default.
Sourcefn extend_right(&self) -> bool
fn extend_right(&self) -> bool
Extend the last two values of each overlay line to the plot’s right edge.
Sourcefn plot_label(&self) -> Option<(usize, String)>
fn plot_label(&self) -> Option<(usize, String)>
An annotation beside the latest value of a zero-based overlay line.
Sourcefn set_color(&mut self, line_idx: usize, color: Color32)
fn set_color(&mut self, line_idx: usize, color: Color32)
Set the color of a single line by its zero-based index.
This is a convenience wrapper around colors
and set_colors. If line_idx is out of
range the call is silently ignored.
Sourcefn is_overlay(&self) -> bool
fn is_overlay(&self) -> bool
Whether this indicator is drawn on the main price chart (overlay) or in a separate sub-pane.
Returns true for overlays (e.g. SMA, Bollinger Bands, Ichimoku),
false for oscillators and volume indicators that need their own
Y-axis (e.g. RSI, MACD, OBV). Defaults to true.
Sourcefn pane(&self) -> StudyPane
fn pane(&self) -> StudyPane
Default separate-pane layout and reference levels, independent of the study name.
ConfiguredStudy returns its levels where its settings place
them, in their colours, and a hidden level in Color32::TRANSPARENT, which still bounds
the fill.
Sourcefn set_overlay(&mut self, _overlay: bool) -> bool
fn set_overlay(&mut self, _overlay: bool) -> bool
Changes placement between the main chart and a separate pane. Returns whether this study supports the change. The chart’s presentation wrapper does.
Sourcefn set_scale(&mut self, _scale: StudyScale) -> bool
fn set_scale(&mut self, _scale: StudyScale) -> bool
Changes the scale used in the study’s pane.
Returns whether this study supports the change. The chart’s presentation wrapper does.
Sourcefn is_volume(&self) -> bool
fn is_volume(&self) -> bool
Volume plots use an independent zero-based scale: up columns, down columns and MA. Renderers size columns to 80% of the bar pitch and format values as volume.
Sourcefn line_count(&self) -> usize
fn line_count(&self) -> usize
The number of output columns this indicator plots. Renderers draw lines
0..line_count().
For example, SMA returns 1, MACD returns 3 (MACD line, signal,
histogram), and Ichimoku returns 5. Defaults to the number of
line_names.
Sourcefn line_names(&self) -> Vec<String>
fn line_names(&self) -> Vec<String>
Return display names for each line, used in chart legends.
The length of the returned Vec must match line_count.
Defaults to a single entry containing name.
Sourcefn is_visible(&self) -> bool
fn is_visible(&self) -> bool
Whether this indicator should currently be rendered.
Defaults to true. Toggle with set_visible.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".