pub struct OpenRangePosition { /* private fields */ }Expand description
EMA of (open − low) / (high − low) per bar.
For each bar the raw value is:
raw = (open - low) / (high - low) when high > low
= 0 when high == low (flat bar)Ranges from 0.0 (opened at low) to 1.0 (opened at high). A persistent
high value indicates systematic gap-up opens (bullish gap pressure); a
persistent low value indicates gap-down opens (bearish gap pressure).
Returns a value after the first bar (EMA seeds with the first raw value).
§Errors
Returns FinError::InvalidPeriod if period == 0.
§Example
use fin_primitives::signals::indicators::OpenRangePosition;
use fin_primitives::signals::Signal;
let orp = OpenRangePosition::new("orp", 10).unwrap();
assert_eq!(orp.period(), 10);Implementations§
Trait Implementations§
Source§impl Signal for OpenRangePosition
impl Signal for OpenRangePosition
Source§fn period(&self) -> usize
fn period(&self) -> usize
Returns the number of bars required before the signal produces a value.
Source§fn is_ready(&self) -> bool
fn is_ready(&self) -> bool
Returns
true if the signal has accumulated enough bars to produce a value.Source§fn reset(&mut self)
fn reset(&mut self)
Resets the signal to its initial state as if no bars had been seen. Read more
Source§fn update_bar(&mut self, bar: &OhlcvBar) -> Result<SignalValue, FinError>
fn update_bar(&mut self, bar: &OhlcvBar) -> Result<SignalValue, FinError>
Auto Trait Implementations§
impl Freeze for OpenRangePosition
impl RefUnwindSafe for OpenRangePosition
impl Send for OpenRangePosition
impl Sync for OpenRangePosition
impl Unpin for OpenRangePosition
impl UnsafeUnpin for OpenRangePosition
impl UnwindSafe for OpenRangePosition
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