pub struct LiquidityPoolEngine { /* private fields */ }Expand description
Detects BSL/SSL pools from Equal High/Low pivot clusters and classifies every interaction as a stop hunt, a breakout, or (for a previously broken pool) a reclaim.
Over the last 2 · pivot_len + 1 bars (pivot_len at least 2) the middle bar is a pivot high
when no other bar’s high is above its own and a pivot low when no other low is below its own;
ties count. A pivot high joins the first active BSL pool whose price lies within
tolerance_pct percent of it (relative to the pool’s price): the pool gains a touch and moves
to (pool + pivot) / 2. Without such a pool the pivot forms a new one. Pivot lows form SSL
pools the same way.
Then every pool is checked against the current bar, including one formed on this bar. An
active BSL pool whose price the high exceeds is stop-hunted when the close is back below it
and broken through otherwise; a broken-through BSL pool is reclaimed once a close falls back
below it. SSL pools mirror this with the low and closes above. value: the number of active
pools. First output with bar 2 · pivot_len + 1.
Implementations§
Source§impl LiquidityPoolEngine
impl LiquidityPoolEngine
pub fn new(pivot_len: usize, tolerance_pct: f64) -> Self
pub fn with_defaults() -> Self
pub fn pools(&self) -> &[LiquidityPool]
Trait Implementations§
Source§impl Indicator for LiquidityPoolEngine
impl Indicator for LiquidityPoolEngine
fn name(&self) -> &str
fn warmup_period(&self) -> usize
fn reset(&mut self)
fn on_bar(&mut self, bar: &Bar) -> Option<IndicatorOutput>
fn alerts(&self) -> Vec<IndicatorAlert>
Source§fn on_checked_bar(
&mut self,
bar: &Bar,
) -> Result<Option<IndicatorOutput>, BarValidationError>
fn on_checked_bar( &mut self, bar: &Bar, ) -> Result<Option<IndicatorOutput>, BarValidationError>
Indicator::on_bar.