pub struct SupportResistance;Expand description
A stateless struct to encapsulate the support and resistance calculation logic.
Implementations§
Source§impl SupportResistance
impl SupportResistance
Sourcepub fn calculate(
price_data: &[HighLow],
period: usize,
) -> SupportResistanceLevels
pub fn calculate( price_data: &[HighLow], period: usize, ) -> SupportResistanceLevels
Calculates support and resistance levels from a slice of HighLow price data.
This method identifies levels using a fractal-based approach, looking for a candle
whose high is higher (for resistance) or low is lower (for support) than the
period candles on both sides.
§Arguments
price_data- A slice ofHighLowstructs representing the price history.period- The number of candles to check on each side of a potential fractal.
§Returns
A SupportResistanceLevels struct containing the identified levels.
Auto Trait Implementations§
impl Freeze for SupportResistance
impl RefUnwindSafe for SupportResistance
impl Send for SupportResistance
impl Sync for SupportResistance
impl Unpin for SupportResistance
impl UnwindSafe for SupportResistance
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