pub struct DxState {
pub prev_dx: Float,
pub prev_true_range: Float,
pub prev_plus_dm: Float,
pub prev_minus_dm: Float,
pub prev_high: Float,
pub prev_low: Float,
pub prev_close: Float,
pub period: usize,
}Expand description
§DX calculation state
This struct holds the state of the calculation. It is used to calculate the next values in a incremental way.
§Attributes
Previous outputs values
prev_dx: The last calculated DX value.
State values
prev_true_range: The previous true range value.prev_plus_dm: The previous positive directional movement (+DM) value.prev_minus_dm: The previous negative directional movement (-DM) value.prev_high: The previous high price.prev_low: The previous low price.prev_close: The previous close price.
Parameters
period: The period used for the DX calculation.
Fields§
§prev_dx: FloatThe last calculated DX value.
prev_true_range: FloatThe previous true range value.
prev_plus_dm: FloatThe previous positive directional movement (+DM) value.
prev_minus_dm: FloatThe previous negative directional movement (-DM) value.
prev_high: FloatThe previous high price.
prev_low: FloatThe previous low price.
prev_close: FloatThe previous close price.
period: usizeThe period used for the DX calculation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DxState
impl RefUnwindSafe for DxState
impl Send for DxState
impl Sync for DxState
impl Unpin for DxState
impl UnsafeUnpin for DxState
impl UnwindSafe for DxState
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