pub struct RangeBars { /* private fields */ }Expand description
Bars whose high and low are a fixed distance apart. The last bar is forming.
§Examples
use ferrochart_core::chart::SeriesOptions;
use ferrochart_core::transform::RangeBars;
use ferrochart_core::{Chart, ChartOptions};
let mut chart = Chart::new(ChartOptions::default());
chart.add_transform_series(
chart.main_pane(),
Box::new(RangeBars::new(0.5)?),
SeriesOptions::default(),
)?;Implementations§
Source§impl RangeBars
impl RangeBars
Sourcepub fn new(range: f64) -> Result<Self>
pub fn new(range: f64) -> Result<Self>
Bars of range from high to low.
§Errors
crate::Error::InvalidArgument unless range is finite and positive.
Sourcepub fn with_kind(self, kind: SeriesKind) -> Result<Self>
pub fn with_kind(self, kind: SeriesKind) -> Result<Self>
Drawn as kind (Candlestick, the default, or OhlcBar).
§Errors
crate::Error::InvalidArgument for other kinds.
Trait Implementations§
Source§impl SeriesTransform for RangeBars
impl SeriesTransform for RangeBars
Source§fn output_kind(&self) -> SeriesKind
fn output_kind(&self) -> SeriesKind
How the output is drawn:
Candlestick, OhlcBar, Kagi or
PointFigure.Source§fn push(&mut self, bar: InputBar, out: &mut TransformOutput)
fn push(&mut self, bar: InputBar, out: &mut TransformOutput)
Commits
bar and writes the elements it finishes.Source§fn peek(&self, bar: InputBar, out: &mut TransformOutput)
fn peek(&self, bar: InputBar, out: &mut TransformOutput)
Writes, without changing the state, the elements
bar would finish
and the ones still forming if it were the last input.Auto Trait Implementations§
impl Forget for RangeBars
impl Freeze for RangeBars
impl Move for RangeBars
impl RefUnwindSafe for RangeBars
impl Send for RangeBars
impl Sync for RangeBars
impl Unpin for RangeBars
impl UnsafeUnpin for RangeBars
impl UnwindSafe for RangeBars
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