pub struct FryPanBottom { /* private fields */ }Expand description
Frying Pan Bottom — a gently rounded bottom across the lookback window: prices decline, flatten near the centre, then recover above where they started.
over the last `period` closes:
the minimum close sits in the middle third of the window (the "bowl")
the latest close is above the first close (the rim is recovered)
signal = +1 when both hold, else 0The frying pan is a bullish accumulation pattern: a saucer-shaped base where
selling dries up, the curve flattens, and price lifts off the rim. Detecting it
requires the low point to be central (a symmetric bowl, not a one-sided drop)
and the close to have climbed back above the window’s opening level, confirming
the breakout from the base. The output is +1.0 (pattern) or 0.0.
The first value lands after period inputs; each update scans the window in
O(period).
§Example
use wickra_core::{Candle, Indicator, FryPanBottom};
let mut indicator = FryPanBottom::new(9).unwrap();
// A U-shaped base then recovery.
let closes = [100.0, 98.0, 96.0, 95.0, 96.0, 98.0, 101.0, 103.0, 105.0];
let mut last = None;
for &cl in &closes {
let c = Candle::new(cl, cl + 0.5, cl - 0.5, cl, 1_000.0, 0).unwrap();
last = indicator.update(c);
}
assert_eq!(last, Some(1.0));Implementations§
Source§impl FryPanBottom
impl FryPanBottom
Sourcepub fn new(period: usize) -> Result<FryPanBottom, Error>
pub fn new(period: usize) -> Result<FryPanBottom, Error>
Construct a Frying Pan Bottom over period bars.
§Errors
Returns Error::InvalidPeriod if period < 5 (a bowl needs room for a
central low between recovering sides).
Trait Implementations§
Source§impl Clone for FryPanBottom
impl Clone for FryPanBottom
Source§fn clone(&self) -> FryPanBottom
fn clone(&self) -> FryPanBottom
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 FryPanBottom
impl Debug for FryPanBottom
Source§impl Indicator for FryPanBottom
impl Indicator for FryPanBottom
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 FryPanBottom
impl RefUnwindSafe for FryPanBottom
impl Send for FryPanBottom
impl Sync for FryPanBottom
impl Unpin for FryPanBottom
impl UnsafeUnpin for FryPanBottom
impl UnwindSafe for FryPanBottom
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