pub enum PriceSource {
Open,
High,
Close,
Low,
HL2,
HLC3,
OHLC4,
HLCC4,
TrueRange,
}Expand description
Price source extracted from an Ohlcv bar before feeding into an
indicator.
Each indicator is configured with a PriceSource that determines which
value (or derived value) to compute on.
Variants§
Open
Opening price.
High
Highest price.
Close
Closing price.
Low
Lowest price.
HL2
Median price: (high + low) / 2.
HLC3
Typical price: (high + low + close) / 3.
OHLC4
Average price: (open + high + low + close) / 4.
HLCC4
Weighted close: (high + low + close + close) / 4.
TrueRange
True range: max(high - low, |high - prev_close|, |low - prev_close|).
On the first bar (no previous close), falls back to high - low.
Trait Implementations§
Source§impl Clone for PriceSource
impl Clone for PriceSource
Source§fn clone(&self) -> PriceSource
fn clone(&self) -> PriceSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PriceSource
impl Debug for PriceSource
Source§impl Default for PriceSource
impl Default for PriceSource
Source§fn default() -> PriceSource
fn default() -> PriceSource
Returns the “default value” for a type. Read more
Source§impl Display for PriceSource
impl Display for PriceSource
Source§impl Hash for PriceSource
impl Hash for PriceSource
Source§impl PartialEq for PriceSource
impl PartialEq for PriceSource
impl Copy for PriceSource
impl Eq for PriceSource
impl StructuralPartialEq for PriceSource
Auto Trait Implementations§
impl Freeze for PriceSource
impl RefUnwindSafe for PriceSource
impl Send for PriceSource
impl Sync for PriceSource
impl Unpin for PriceSource
impl UnsafeUnpin for PriceSource
impl UnwindSafe for PriceSource
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