diff --git a/src/indicators.py b/src/indicators.py index 3c4b9c4..dbb5c10 100644 --- a/src/indicators.py +++ b/src/indicators.py @@ -456,6 +456,282 @@ class CDL_ThreeInside(CandlestickPattern): return talib.CDL3INSIDE(opens, highs, lows, closes) +class CDL_TwoCrows(CandlestickPattern): + """Two Crows - Bearish reversal pattern with gap up followed by bearish engulfing.""" + def detect(self, opens, highs, lows, closes): + return talib.CDL2CROWS(opens, highs, lows, closes) + + +class CDL_ThreeLineStrike(CandlestickPattern): + """Three Line Strike - Continuation pattern with three candles followed by opposite engulfing.""" + def detect(self, opens, highs, lows, closes): + return talib.CDL3LINESTRIKE(opens, highs, lows, closes) + + +class CDL_ThreeOutside(CandlestickPattern): + """Three Outside Up/Down - Engulfing pattern confirmed by third candle.""" + def detect(self, opens, highs, lows, closes): + return talib.CDL3OUTSIDE(opens, highs, lows, closes) + + +class CDL_ThreeStarsInSouth(CandlestickPattern): + """Three Stars in South - Rare bullish reversal with three decreasing bearish candles.""" + def detect(self, opens, highs, lows, closes): + return talib.CDL3STARSINSOUTH(opens, highs, lows, closes) + + +class CDL_AbandonedBaby(CandlestickPattern): + """Abandoned Baby - Strong reversal with doji gap isolated from surrounding candles.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLABANDONEDBABY(opens, highs, lows, closes) + + +class CDL_AdvanceBlock(CandlestickPattern): + """Advance Block - Bearish reversal showing weakening bullish momentum.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLADVANCEBLOCK(opens, highs, lows, closes) + + +class CDL_BeltHold(CandlestickPattern): + """Belt Hold - Single candle reversal opening at extreme and closing near opposite.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLBELTHOLD(opens, highs, lows, closes) + + +class CDL_Breakaway(CandlestickPattern): + """Breakaway - Five candle reversal pattern breaking away from trend.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLBREAKAWAY(opens, highs, lows, closes) + + +class CDL_ClosingMarubozu(CandlestickPattern): + """Closing Marubozu - Marubozu with no shadow on closing end.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLCLOSINGMARUBOZU(opens, highs, lows, closes) + + +class CDL_ConcealBabySwallow(CandlestickPattern): + """Concealing Baby Swallow - Rare bullish pattern with four candles.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLCONCEALBABYSWALL(opens, highs, lows, closes) + + +class CDL_CounterAttack(CandlestickPattern): + """Counter Attack - Two candle reversal with opposite colors closing at same price.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLCOUNTERATTACK(opens, highs, lows, closes) + + +class CDL_DojiStar(CandlestickPattern): + """Doji Star - Doji that gaps away from previous candle, signaling reversal.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLDOJISTAR(opens, highs, lows, closes) + + +class CDL_DragonflyDoji(CandlestickPattern): + """Dragonfly Doji - Doji with long lower shadow, potential bullish reversal.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLDRAGONFLYDOJI(opens, highs, lows, closes) + + +class CDL_EveningDojiStar(CandlestickPattern): + """Evening Doji Star - Bearish reversal with doji as the star.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLEVENINGDOJISTAR(opens, highs, lows, closes) + + +class CDL_GapSideSideWhite(CandlestickPattern): + """Gap Side-by-Side White - Continuation pattern with gap and two similar candles.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLGAPSIDESIDEWHITE(opens, highs, lows, closes) + + +class CDL_GravestoneDoji(CandlestickPattern): + """Gravestone Doji - Doji with long upper shadow, potential bearish reversal.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLGRAVESTONEDOJI(opens, highs, lows, closes) + + +class CDL_HangingMan(CandlestickPattern): + """Hanging Man - Hammer-like pattern at top of uptrend, bearish signal.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLHANGINGMAN(opens, highs, lows, closes) + + +class CDL_HaramiCross(CandlestickPattern): + """Harami Cross - Harami pattern where second candle is a doji.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLHARAMICROSS(opens, highs, lows, closes) + + +class CDL_HighWave(CandlestickPattern): + """High Wave - Candle with very long upper and lower shadows, extreme indecision.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLHIGHWAVE(opens, highs, lows, closes) + + +class CDL_Hikkake(CandlestickPattern): + """Hikkake - Inside bar breakout failure pattern.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLHIKKAKE(opens, highs, lows, closes) + + +class CDL_HikkakeMod(CandlestickPattern): + """Modified Hikkake - Variation of hikkake with specific confirmation.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLHIKKAKEMOD(opens, highs, lows, closes) + + +class CDL_HomingPigeon(CandlestickPattern): + """Homing Pigeon - Bullish harami variant with both candles bearish.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLHOMINGPIGEON(opens, highs, lows, closes) + + +class CDL_IdenticalThreeCrows(CandlestickPattern): + """Identical Three Crows - Three crows opening at previous close.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLIDENTICAL3CROWS(opens, highs, lows, closes) + + +class CDL_InNeck(CandlestickPattern): + """In-Neck - Bearish continuation with second candle closing near first's low.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLINNECK(opens, highs, lows, closes) + + +class CDL_Kicking(CandlestickPattern): + """Kicking - Two marubozu candles of opposite color with gap between.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLKICKING(opens, highs, lows, closes) + + +class CDL_KickingByLength(CandlestickPattern): + """Kicking By Length - Kicking pattern determined by longer marubozu.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLKICKINGBYLENGTH(opens, highs, lows, closes) + + +class CDL_LadderBottom(CandlestickPattern): + """Ladder Bottom - Five candle bullish reversal pattern.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLLADDERBOTTOM(opens, highs, lows, closes) + + +class CDL_LongLeggedDoji(CandlestickPattern): + """Long-Legged Doji - Doji with very long upper and lower shadows.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLLONGLEGGEDDOJI(opens, highs, lows, closes) + + +class CDL_LongLine(CandlestickPattern): + """Long Line Candle - Candle with unusually long body.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLLONGLINE(opens, highs, lows, closes) + + +class CDL_MatchingLow(CandlestickPattern): + """Matching Low - Two candles with same low, potential bullish reversal.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLMATCHINGLOW(opens, highs, lows, closes) + + +class CDL_MatHold(CandlestickPattern): + """Mat Hold - Five candle bullish continuation pattern.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLMATHOLD(opens, highs, lows, closes) + + +class CDL_MorningDojiStar(CandlestickPattern): + """Morning Doji Star - Bullish reversal with doji as the star.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLMORNINGDOJISTAR(opens, highs, lows, closes) + + +class CDL_OnNeck(CandlestickPattern): + """On-Neck - Bearish continuation with second candle closing at first's low.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLONNECK(opens, highs, lows, closes) + + +class CDL_RickshawMan(CandlestickPattern): + """Rickshaw Man - Long-legged doji with open/close at center.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLRICKSHAWMAN(opens, highs, lows, closes) + + +class CDL_RiseFallThreeMethods(CandlestickPattern): + """Rising/Falling Three Methods - Five candle continuation pattern.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLRISEFALL3METHODS(opens, highs, lows, closes) + + +class CDL_SeparatingLines(CandlestickPattern): + """Separating Lines - Continuation pattern with opposite candle opening at same price.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLSEPARATINGLINES(opens, highs, lows, closes) + + +class CDL_ShortLine(CandlestickPattern): + """Short Line Candle - Candle with unusually short body.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLSHORTLINE(opens, highs, lows, closes) + + +class CDL_StalledPattern(CandlestickPattern): + """Stalled Pattern - Bearish reversal showing weakening uptrend.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLSTALLEDPATTERN(opens, highs, lows, closes) + + +class CDL_StickSandwich(CandlestickPattern): + """Stick Sandwich - Bullish reversal with matching lows around opposite candle.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLSTICKSANDWICH(opens, highs, lows, closes) + + +class CDL_Takuri(CandlestickPattern): + """Takuri - Dragonfly doji variant with very long lower shadow.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLTAKURI(opens, highs, lows, closes) + + +class CDL_TasukiGap(CandlestickPattern): + """Tasuki Gap - Continuation pattern with gap partially filled.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLTASUKIGAP(opens, highs, lows, closes) + + +class CDL_Thrusting(CandlestickPattern): + """Thrusting - Bearish continuation similar to in-neck but closing higher.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLTHRUSTING(opens, highs, lows, closes) + + +class CDL_TriStar(CandlestickPattern): + """Tri-Star - Three doji pattern signaling major reversal.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLTRISTAR(opens, highs, lows, closes) + + +class CDL_UniqueThreeRiver(CandlestickPattern): + """Unique Three River - Rare bullish reversal with three specific candles.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLUNIQUE3RIVER(opens, highs, lows, closes) + + +class CDL_UpsideGapTwoCrows(CandlestickPattern): + """Upside Gap Two Crows - Bearish reversal with gap up followed by two bearish candles.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLUPSIDEGAP2CROWS(opens, highs, lows, closes) + + +class CDL_XSideGapThreeMethods(CandlestickPattern): + """Side Gap Three Methods - Continuation pattern filling a gap.""" + def detect(self, opens, highs, lows, closes): + return talib.CDLXSIDEGAP3METHODS(opens, highs, lows, closes) + + # Register indicators in the registry indicators_registry['Volume'] = Volume indicators_registry['SMA'] = SMA @@ -486,6 +762,52 @@ indicators_registry['CDL_EVENINGSTAR'] = CDL_EveningStar indicators_registry['CDL_3WHITESOLDIERS'] = CDL_ThreeWhiteSoldiers indicators_registry['CDL_3BLACKCROWS'] = CDL_ThreeBlackCrows indicators_registry['CDL_3INSIDE'] = CDL_ThreeInside +indicators_registry['CDL_2CROWS'] = CDL_TwoCrows +indicators_registry['CDL_3LINESTRIKE'] = CDL_ThreeLineStrike +indicators_registry['CDL_3OUTSIDE'] = CDL_ThreeOutside +indicators_registry['CDL_3STARSINSOUTH'] = CDL_ThreeStarsInSouth +indicators_registry['CDL_ABANDONEDBABY'] = CDL_AbandonedBaby +indicators_registry['CDL_ADVANCEBLOCK'] = CDL_AdvanceBlock +indicators_registry['CDL_BELTHOLD'] = CDL_BeltHold +indicators_registry['CDL_BREAKAWAY'] = CDL_Breakaway +indicators_registry['CDL_CLOSINGMARUBOZU'] = CDL_ClosingMarubozu +indicators_registry['CDL_CONCEALBABYSWALL'] = CDL_ConcealBabySwallow +indicators_registry['CDL_COUNTERATTACK'] = CDL_CounterAttack +indicators_registry['CDL_DOJISTAR'] = CDL_DojiStar +indicators_registry['CDL_DRAGONFLYDOJI'] = CDL_DragonflyDoji +indicators_registry['CDL_EVENINGDOJISTAR'] = CDL_EveningDojiStar +indicators_registry['CDL_GAPSIDESIDEWHITE'] = CDL_GapSideSideWhite +indicators_registry['CDL_GRAVESTONEDOJI'] = CDL_GravestoneDoji +indicators_registry['CDL_HANGINGMAN'] = CDL_HangingMan +indicators_registry['CDL_HARAMICROSS'] = CDL_HaramiCross +indicators_registry['CDL_HIGHWAVE'] = CDL_HighWave +indicators_registry['CDL_HIKKAKE'] = CDL_Hikkake +indicators_registry['CDL_HIKKAKEMOD'] = CDL_HikkakeMod +indicators_registry['CDL_HOMINGPIGEON'] = CDL_HomingPigeon +indicators_registry['CDL_IDENTICAL3CROWS'] = CDL_IdenticalThreeCrows +indicators_registry['CDL_INNECK'] = CDL_InNeck +indicators_registry['CDL_KICKING'] = CDL_Kicking +indicators_registry['CDL_KICKINGBYLENGTH'] = CDL_KickingByLength +indicators_registry['CDL_LADDERBOTTOM'] = CDL_LadderBottom +indicators_registry['CDL_LONGLEGGEDDOJI'] = CDL_LongLeggedDoji +indicators_registry['CDL_LONGLINE'] = CDL_LongLine +indicators_registry['CDL_MATCHINGLOW'] = CDL_MatchingLow +indicators_registry['CDL_MATHOLD'] = CDL_MatHold +indicators_registry['CDL_MORNINGDOJISTAR'] = CDL_MorningDojiStar +indicators_registry['CDL_ONNECK'] = CDL_OnNeck +indicators_registry['CDL_RICKSHAWMAN'] = CDL_RickshawMan +indicators_registry['CDL_RISEFALL3METHODS'] = CDL_RiseFallThreeMethods +indicators_registry['CDL_SEPARATINGLINES'] = CDL_SeparatingLines +indicators_registry['CDL_SHORTLINE'] = CDL_ShortLine +indicators_registry['CDL_STALLEDPATTERN'] = CDL_StalledPattern +indicators_registry['CDL_STICKSANDWICH'] = CDL_StickSandwich +indicators_registry['CDL_TAKURI'] = CDL_Takuri +indicators_registry['CDL_TASUKIGAP'] = CDL_TasukiGap +indicators_registry['CDL_THRUSTING'] = CDL_Thrusting +indicators_registry['CDL_TRISTAR'] = CDL_TriStar +indicators_registry['CDL_UNIQUE3RIVER'] = CDL_UniqueThreeRiver +indicators_registry['CDL_UPSIDEGAP2CROWS'] = CDL_UpsideGapTwoCrows +indicators_registry['CDL_XSIDEGAP3METHODS'] = CDL_XSideGapThreeMethods class Indicators: diff --git a/src/templates/new_indicator_popup.html b/src/templates/new_indicator_popup.html index 8668d1e..cc00084 100644 --- a/src/templates/new_indicator_popup.html +++ b/src/templates/new_indicator_popup.html @@ -392,6 +392,205 @@ const indicatorInfo = { ` + }, + 'CDL_2CROWS': { + description: 'Two Crows - Bearish reversal with gap up followed by two bearish candles, second engulfing first.', + svg: null + }, + 'CDL_3LINESTRIKE': { + description: 'Three Line Strike - Three candles in trend direction followed by opposite candle that engulfs all three.', + svg: null + }, + 'CDL_3OUTSIDE': { + description: 'Three Outside Up/Down - Engulfing pattern confirmed by third candle continuing in reversal direction.', + svg: null + }, + 'CDL_3STARSINSOUTH': { + description: 'Three Stars in South - Rare bullish reversal with three decreasing bearish candles showing exhaustion.', + svg: null + }, + 'CDL_ABANDONEDBABY': { + description: 'Abandoned Baby - Strong reversal with doji that gaps away from both surrounding candles.', + svg: null + }, + 'CDL_ADVANCEBLOCK': { + description: 'Advance Block - Three bullish candles with decreasing bodies showing weakening momentum.', + svg: null + }, + 'CDL_BELTHOLD': { + description: 'Belt Hold - Single candle opening at extreme (high/low) and closing near opposite end.', + svg: null + }, + 'CDL_BREAKAWAY': { + description: 'Breakaway - Five candle reversal starting with gap and ending with candle breaking the pattern.', + svg: null + }, + 'CDL_CLOSINGMARUBOZU': { + description: 'Closing Marubozu - Marubozu with no shadow on closing end, showing strong conviction.', + svg: null + }, + 'CDL_CONCEALBABYSWALL': { + description: 'Concealing Baby Swallow - Rare four-candle bullish reversal pattern.', + svg: null + }, + 'CDL_COUNTERATTACK': { + description: 'Counter Attack - Two opposite-colored candles closing at the same price level.', + svg: null + }, + 'CDL_DOJISTAR': { + description: 'Doji Star - Doji that gaps away from previous candle, indicating potential reversal.', + svg: null + }, + 'CDL_DRAGONFLYDOJI': { + description: 'Dragonfly Doji - Doji with long lower shadow and no upper shadow. Bullish signal.', + svg: ` + + + ` + }, + 'CDL_EVENINGDOJISTAR': { + description: 'Evening Doji Star - Bearish three-candle reversal with doji as the middle star.', + svg: null + }, + 'CDL_GAPSIDESIDEWHITE': { + description: 'Gap Side-by-Side White - Continuation pattern with gap and two similar bullish candles.', + svg: null + }, + 'CDL_GRAVESTONEDOJI': { + description: 'Gravestone Doji - Doji with long upper shadow and no lower shadow. Bearish signal.', + svg: ` + + + ` + }, + 'CDL_HANGINGMAN': { + description: 'Hanging Man - Hammer-shaped candle at top of uptrend. Bearish reversal signal.', + svg: ` + + + ` + }, + 'CDL_HARAMICROSS': { + description: 'Harami Cross - Harami pattern where the second candle is a doji.', + svg: null + }, + 'CDL_HIGHWAVE': { + description: 'High Wave - Candle with very long upper and lower shadows, showing extreme indecision.', + svg: ` + + + ` + }, + 'CDL_HIKKAKE': { + description: 'Hikkake - Inside bar followed by false breakout and reversal.', + svg: null + }, + 'CDL_HIKKAKEMOD': { + description: 'Modified Hikkake - Hikkake variation with specific confirmation requirements.', + svg: null + }, + 'CDL_HOMINGPIGEON': { + description: 'Homing Pigeon - Bullish harami variant where both candles are bearish.', + svg: null + }, + 'CDL_IDENTICAL3CROWS': { + description: 'Identical Three Crows - Three bearish candles each opening at previous close.', + svg: null + }, + 'CDL_INNECK': { + description: 'In-Neck - Bearish continuation where second candle closes just at first candle low.', + svg: null + }, + 'CDL_KICKING': { + description: 'Kicking - Two marubozu candles of opposite color with gap between them.', + svg: null + }, + 'CDL_KICKINGBYLENGTH': { + description: 'Kicking By Length - Kicking pattern where direction is determined by longer marubozu.', + svg: null + }, + 'CDL_LADDERBOTTOM': { + description: 'Ladder Bottom - Five-candle bullish reversal at end of downtrend.', + svg: null + }, + 'CDL_LONGLEGGEDDOJI': { + description: 'Long-Legged Doji - Doji with very long shadows both above and below.', + svg: ` + + + ` + }, + 'CDL_LONGLINE': { + description: 'Long Line Candle - Candle with unusually long body relative to recent candles.', + svg: null + }, + 'CDL_MATCHINGLOW': { + description: 'Matching Low - Two candles with identical lows, potential support/reversal.', + svg: null + }, + 'CDL_MATHOLD': { + description: 'Mat Hold - Five-candle bullish continuation with small retracement.', + svg: null + }, + 'CDL_MORNINGDOJISTAR': { + description: 'Morning Doji Star - Bullish three-candle reversal with doji as the middle star.', + svg: null + }, + 'CDL_ONNECK': { + description: 'On-Neck - Bearish continuation where second candle closes exactly at first candle low.', + svg: null + }, + 'CDL_RICKSHAWMAN': { + description: 'Rickshaw Man - Long-legged doji with open and close at the center.', + svg: null + }, + 'CDL_RISEFALL3METHODS': { + description: 'Rising/Falling Three Methods - Five-candle continuation with small retracement candles.', + svg: null + }, + 'CDL_SEPARATINGLINES': { + description: 'Separating Lines - Continuation with opposite-colored candle opening at same price.', + svg: null + }, + 'CDL_SHORTLINE': { + description: 'Short Line Candle - Candle with unusually short body relative to recent candles.', + svg: null + }, + 'CDL_STALLEDPATTERN': { + description: 'Stalled Pattern - Three bullish candles where third shows exhaustion (small body at top).', + svg: null + }, + 'CDL_STICKSANDWICH': { + description: 'Stick Sandwich - Two candles with matching closes sandwiching an opposite candle.', + svg: null + }, + 'CDL_TAKURI': { + description: 'Takuri - Dragonfly doji variant with very long lower shadow, strong bullish signal.', + svg: null + }, + 'CDL_TASUKIGAP': { + description: 'Tasuki Gap - Gap continuation pattern where third candle partially fills the gap.', + svg: null + }, + 'CDL_THRUSTING': { + description: 'Thrusting - Bearish continuation similar to in-neck but closing slightly higher.', + svg: null + }, + 'CDL_TRISTAR': { + description: 'Tri-Star - Three consecutive doji candles signaling major reversal.', + svg: null + }, + 'CDL_UNIQUE3RIVER': { + description: 'Unique Three River - Rare bullish reversal with three specific candle formations.', + svg: null + }, + 'CDL_UPSIDEGAP2CROWS': { + description: 'Upside Gap Two Crows - Bearish reversal with gap up followed by two engulfing bearish candles.', + svg: null + }, + 'CDL_XSIDEGAP3METHODS': { + description: 'Side Gap Three Methods - Continuation pattern with gap being filled by third candle.', + svg: null } };