Struct yata::methods::renko::RenkoBlock

source ·
pub struct RenkoBlock {
    pub open: ValueType,
    pub close: ValueType,
    pub volume: ValueType,
}
Expand description

Single unit for Renko charts

May be produced by RenkoOutput iterator.

Fields§

§open: ValueType

Current block’s open value

§close: ValueType

Current block’s close value

§volume: ValueType

Average block’s volume value

Implementations§

source§

impl RenkoBlock

source

pub fn upper_bound(&self) -> ValueType

Returns upper bound of the block

source

pub fn lower_bound(&self) -> ValueType

Returns lower bound of the block

source

pub fn sign(&self) -> i8

Returns sign of the block

Trait Implementations§

source§

impl Clone for RenkoBlock

source§

fn clone(&self) -> RenkoBlock

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for RenkoBlock

source§

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

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

impl OHLCV for RenkoBlock

source§

fn open(&self) -> ValueType

Should return an open value of the period
source§

fn close(&self) -> ValueType

Should return an close value of the candle
source§

fn high(&self) -> ValueType

Should return an highest value of the period
source§

fn low(&self) -> ValueType

Should return an lowest value of the period
source§

fn volume(&self) -> ValueType

Should return volume value for the period
source§

fn tp(&self) -> ValueType

Calculates Typical price. It’s just a simple (High + Low + Close) / 3 Read more
source§

fn hl2(&self) -> ValueType

Calculates arithmetic average of high and low values of the candle Read more
source§

fn ohlc4(&self) -> ValueType

Calculates arithmetic average of high, low, open and close values of the candle Read more
source§

fn clv(&self) -> ValueType

CLV = [(close - low) - (high - close)] / (high - low) Read more
source§

fn tr(&self, prev_candle: &dyn OHLCV) -> ValueType

Calculates True Range over last two candles Read more
source§

fn tr_close(&self, prev_close: ValueType) -> ValueType

Calculates True Range over last two candles using close price from the previous candle.
source§

fn validate(&self) -> bool

Validates candle attributes Read more
source§

fn source(&self, source: Source) -> ValueType

Returns Source field value of the candle. Read more
source§

fn volumed_price(&self) -> ValueType

Volumed price Read more
source§

fn is_rising(&self) -> bool

Checks if candle is “rising”: it’s close value greater than open value
source§

fn is_falling(&self) -> bool

Checks if candle is “falling”: it’s close value smaller than open value
source§

impl PartialEq for RenkoBlock

source§

fn eq(&self, other: &RenkoBlock) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for RenkoBlock

source§

impl StructuralPartialEq for RenkoBlock

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
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,

§

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>,

§

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>,

§

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.