pub struct SinglePrints { /* private fields */ }Expand description
Single Prints — the number of price levels (bins) in the rolling profile that were touched by exactly one bar, marking zones of low acceptance / fast movement.
for each of `bins` price levels over the last `period` candles:
touches = number of bars whose high-low range covers that level
SinglePrints = count of levels with touches == 1In Market Profile a “single print” is a price the market traded through so quickly that only one time-period printed there — a footprint of an aggressive, one-sided move with little two-way trade. Single prints often act as support or resistance on a retest (the imbalance gets “repaired”) and mark the edges of rapid moves. Counting them per profile gives a streaming gauge of how much of the recent range was traversed without acceptance: a high count means a fast, trending, low-rotation market; a low count means a balanced, well-traded range.
The output is a non-negative count. The first value lands after period
candles; each update rebuilds the touch histogram in O(period · bins).
§Example
use wickra_core::{Candle, Indicator, SinglePrints};
let mut indicator = SinglePrints::new(20, 24).unwrap();
let mut last = None;
for i in 0..40 {
let base = 100.0 + f64::from(i); // a one-directional ramp -> many single prints
let c = Candle::new(base, base + 0.5, base - 0.5, base, 1_000.0, 0).unwrap();
last = indicator.update(c);
}
assert!(last.is_some());Implementations§
Trait Implementations§
Source§impl Clone for SinglePrints
impl Clone for SinglePrints
Source§fn clone(&self) -> SinglePrints
fn clone(&self) -> SinglePrints
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SinglePrints
impl Debug for SinglePrints
Source§impl Indicator for SinglePrints
impl Indicator for SinglePrints
Source§type Input = Candle
type Input = Candle
f64 for a price, or Candle / Tick).Source§fn update(&mut self, candle: Candle) -> Option<f64>
fn update(&mut self, candle: Candle) -> Option<f64>
None if the indicator is still warming up.Source§fn reset(&mut self)
fn reset(&mut self)
Source§fn warmup_period(&self) -> usize
fn warmup_period(&self) -> usize
None output can be produced.Auto Trait Implementations§
impl Freeze for SinglePrints
impl RefUnwindSafe for SinglePrints
impl Send for SinglePrints
impl Sync for SinglePrints
impl Unpin for SinglePrints
impl UnsafeUnpin for SinglePrints
impl UnwindSafe for SinglePrints
Blanket Implementations§
Source§impl<T> BatchExt for Twhere
T: Indicator,
impl<T> BatchExt for Twhere
T: Indicator,
Source§fn batch(&mut self, inputs: &[Self::Input]) -> Vec<Option<Self::Output>>
fn batch(&mut self, inputs: &[Self::Input]) -> Vec<Option<Self::Output>>
None during warmup) per input.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more