#[non_exhaustive]pub enum CandlePattern {
Show 20 variants
MorningStar,
EveningStar,
ThreeWhiteSoldiers,
ThreeBlackCrows,
BullishEngulfing,
BearishEngulfing,
BullishHarami,
BearishHarami,
PiercingLine,
DarkCloudCover,
TweezerTop,
TweezerBottom,
Doji,
SpinningTop,
BullishMarubozu,
BearishMarubozu,
Hammer,
InvertedHammer,
HangingMan,
ShootingStar,
}Expand description
A detected candlestick pattern.
Returned per-bar by patterns. Each bar carries at most one pattern;
three-bar patterns take precedence over two-bar, which take precedence over
one-bar.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MorningStar
Bullish three-bar reversal: large bearish → small indecision star → large bullish that closes above the first bar’s midpoint.
EveningStar
Bearish three-bar reversal: large bullish → small indecision star → large bearish that closes below the first bar’s midpoint.
ThreeWhiteSoldiers
Bullish continuation: three consecutive bullish bars, each opening within the prior bar’s body and closing at a new high.
ThreeBlackCrows
Bearish continuation: three consecutive bearish bars, each opening within the prior bar’s body and closing at a new low.
BullishEngulfing
Bullish reversal: bearish bar followed by a larger bullish bar whose body fully engulfs the prior bar’s body.
BearishEngulfing
Bearish reversal: bullish bar followed by a larger bearish bar whose body fully engulfs the prior bar’s body.
BullishHarami
Bullish reversal: large bearish bar followed by a smaller bar (any colour, including Doji) whose body is contained within the prior bar’s body. A Doji inner bar is a “Harami Cross” — an even stronger signal.
BearishHarami
Bearish reversal: large bullish bar followed by a smaller bar (any colour, including Doji) whose body is contained within the prior bar’s body. A Doji inner bar is a “Harami Cross” — an even stronger signal.
PiercingLine
Bullish reversal: bearish bar followed by a bullish bar that opens below the prior close and closes above the prior body’s midpoint.
DarkCloudCover
Bearish reversal: bullish bar followed by a bearish bar that opens above the prior close and closes below the prior body’s midpoint.
TweezerTop
Bearish reversal at resistance: two candles sharing the same high.
TweezerBottom
Bullish reversal at support: two candles sharing the same low.
Doji
Indecision: open ≈ close (body ≤ 5 % of total range), wicks on both sides.
SpinningTop
Indecision: small body (≤ 30 % of range) with meaningful wicks on both sides.
BullishMarubozu
Bullish strength: nearly wick-free bullish candle (body ≥ 90 % of range).
BearishMarubozu
Bearish strength: nearly wick-free bearish candle (body ≥ 90 % of range).
Hammer
Potential bullish reversal: hammer shape (long lower wick) after a downtrend.
InvertedHammer
Potential bullish reversal: inverted-hammer shape (long upper wick) after a downtrend.
HangingMan
Potential bearish reversal: hammer shape (long lower wick) after an uptrend.
ShootingStar
Potential bearish reversal: inverted-hammer shape (long upper wick) after an uptrend.
Implementations§
Source§impl CandlePattern
impl CandlePattern
Sourcepub fn sentiment(self) -> PatternSentiment
pub fn sentiment(self) -> PatternSentiment
Returns the directional bias of this pattern.
§Example
use finance_query::indicators::{CandlePattern, PatternSentiment};
assert_eq!(CandlePattern::Hammer.sentiment(), PatternSentiment::Bullish);
assert_eq!(CandlePattern::ShootingStar.sentiment(), PatternSentiment::Bearish);
assert_eq!(CandlePattern::Doji.sentiment(), PatternSentiment::Neutral);Trait Implementations§
Source§impl Clone for CandlePattern
impl Clone for CandlePattern
Source§fn clone(&self) -> CandlePattern
fn clone(&self) -> CandlePattern
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CandlePattern
impl Debug for CandlePattern
Source§impl<'de> Deserialize<'de> for CandlePattern
impl<'de> Deserialize<'de> for CandlePattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for CandlePattern
impl Hash for CandlePattern
Source§impl PartialEq for CandlePattern
impl PartialEq for CandlePattern
Source§impl Serialize for CandlePattern
impl Serialize for CandlePattern
impl Copy for CandlePattern
impl Eq for CandlePattern
impl StructuralPartialEq for CandlePattern
Auto Trait Implementations§
impl Freeze for CandlePattern
impl RefUnwindSafe for CandlePattern
impl Send for CandlePattern
impl Sync for CandlePattern
impl Unpin for CandlePattern
impl UnsafeUnpin for CandlePattern
impl UnwindSafe for CandlePattern
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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