Skip to main content

Kagi

Struct Kagi 

Source
pub struct Kagi { /* private fields */ }
Expand description

Kagi lines: a new line starts when the price reverses by the reversal amount; lines are thick (yang) after rising above the previous shoulder and thin (yin) after falling below the previous waist. The last line is forming.

§Examples

use ferrochart_core::chart::SeriesOptions;
use ferrochart_core::transform::{Kagi, Reversal};
use ferrochart_core::{Chart, ChartOptions};

let mut chart = Chart::new(ChartOptions::default());
chart.add_transform_series(
    chart.main_pane(),
    Box::new(Kagi::new(Reversal::Percent(1.0))?),
    SeriesOptions::default(),
)?;

Implementations§

Source§

impl Kagi

Source

pub fn new(reversal: Reversal) -> Result<Self>

Kagi lines with reversal.

§Errors

crate::Error::InvalidArgument unless the amount is finite and positive.

Trait Implementations§

Source§

impl Clone for Kagi

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Kagi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SeriesTransform for Kagi

Source§

fn name(&self) -> &'static str

Name, e.g. "renko".
Source§

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)

Commits bar and writes the elements it finishes.
Source§

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

fn reset(&mut self)

Forgets all inputs.
Source§

fn box_size(&self) -> Option<f64>

Point & Figure: the price height of one box, to stack the X/O marks.

Auto Trait Implementations§

§

impl Forget for Kagi

§

impl Freeze for Kagi

§

impl Move for Kagi

§

impl RefUnwindSafe for Kagi

§

impl Send for Kagi

§

impl Sync for Kagi

§

impl Unpin for Kagi

§

impl UnsafeUnpin for Kagi

§

impl UnwindSafe for Kagi

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.