Evening Star is a three-candle formation examined as a reversal candidate after rising prices. It is distinct from Unique Three River Bottom, which TA-Lib implements with different geometry and a bullish classification. A pattern code is a recognition result, not a forecast. We will calculate the evening-star conditions on explicitly fictional prices.

Evening Star and Unique Three River are different patterns

TA-Lib’s Evening Star uses a long bullish first body, a short second body separated above it by a body gap, and a bearish third body longer than its short-body threshold. The final Close must be strictly below C1 − p × body 1. The default penetration p is 0.3. Our main worked variant uses p = 0.5, the first-body midpoint; the separate diagram illustrates p = 0.3. Neither threshold is a probability of decline.

Unique Three River instead begins with a long bearish candle, a contained bearish second body with a lower Low, and a short non-bearish third body opening above the second Low. Its code does not require C3 below C2, although the comment describes that placement as preferable. Do not infer an Evening Star alias from three candles or the article’s legacy URL. The guide to candlestick patterns worth knowing first introduces the broader family.

A numerical check of the three-river distinction

Use fictional O/H/L/C in arbitrary units: twelve earlier bars (100,108, 98,103), followed by (100,101, 80, 90) and (95, 96, 75, 92). Compare two third candles, (77, 80, 76, 79) and (93, 95, 92, 94). Under the default source conditions, both give Unique Three River +100 and Evening Star 0. The third closes lie on opposite sides of C2 = 92, yet that comparison is not a required predicate. These are synthetic classification checks, not market performance.

The first body is 10 units, above the earlier mean 3. The second body is 3, lies inside the first, closes above C1 and has Low 75 below Low 80. The third bodies are 2 and 1, below their preceding mean (8 × 3 + 10 + 3)/10 = 3.7, and both Opens exceed 75. Adding C3 < C2 would select only the first variant. It would be a custom subgroup, not a correction of the function or evidence that either example subsequently rose.

The mirror image: the morning star

The morning star is the bullish counterpart examined after a decline. Check its own detector conditions, rather than treating sunrise and dusk metaphors as promises of gains or losses. The preceding context is separate from a function that only tests the specified candle geometry.

Requiring the middle candle to meet a doji definition adds a distinct condition; it does not establish a stronger trade. The abandoned baby pattern and three black crows also have their own geometric rules. Similar reversal labels are not interchangeable detector specifications or a ranking of profitability.

Four units can mean 40% or 10%

First Close 110 to third Close 106 spans 4 units. The first body is 10; the full range 40. Body penetration is 4/10 = 40%; dividing by range gives 4/40 = 10%. Changing the denominator can reject the same Close under our separate 30% example threshold, despite unchanged price.

Two denominators for one penetrationFictional first candle: Open 100, Close 110, High 125, Low 85. Its body spans ten units, its full range forty. Third Close 106 is four units below first Close: forty percent of body or ten percent of range.First candle: body 10, range 40C3 = 106From C1: 4 units4/10 = 40% of body4/40 = 10% of range30% body threshold: level 107106 < 107: penetration passes
The filled body and full wick range are different lengths. The third Close level is dashed.

For our separate 30%-body variant, compare 106 with 110 − 0.30 × 10 = 107: penetration passes. Incorrectly substituting 40 gives threshold 98, which this Close does not cross downward. “30% of the candle” is ambiguous: name the segment and its starting point. This example differs from the article’s midpoint rule. Correct penetration is only one pattern condition and does not forecast the next price.

Assumptions: Invented first candle: O = 100; C = 110; H = 125; L = 85. Last Close 106. We compare only penetration, not a complete Evening Star flag. All values share one arbitrary price unit; no financial result is supplied. Official material: TA-Lib 0.6.4: CDLEVENINGSTAR.

How to trade the evening star step by step

Define the prior rising context before testing, and record the feed and candle boundaries. Here a body gap means min(O2, C2) > max(O1, C1), not separated full H–L ranges. The stated Evening Star code imposes no second-to-third body-gap condition or second-candle color requirement. If you remove its first body gap for an FX experiment, label that as a modified version.

The middle candle need not have the highest High of all three. Check all maxima before using an above-star reference, and keep that choice separate from detector recognition. A target, position size and optional RSI indicator filter need explicit rules. Neither a second price-derived indicator nor a higher timeframe is independent evidence of an edge, and an ordinary stop does not guarantee its trigger price.

For the full fictional EUR/USD example, assume one pip = 0.0001 and ten earlier bodies of 20 pips each. No historical prices or executed trades are being reported.

CandleOpenHighLowCloseBody
11.09201.10301.09101.1020100 pips
21.10301.10501.10101.104010 pips
31.10351.10451.09501.096075 pips

The second body starts 10 pips above C1, but L2 = 1.1010 remains below H1 = 1.1030, so the candle ranges overlap. O3 = 1.1035 is inside the second body; no second-to-third body gap exists or is required by this code. Historical body thresholds are 20 pips for candle 1, (9 × 20 + 100)/10 = 28 for candle 2 and (8 × 20 + 100 + 10)/10 = 27 for candle 3. Thus 100 > 20, 10 ≤ 28 and 75 > 27.

For p = 0.3, the threshold is 1.1020 − 0.3 × 0.0100 = 1.0990. For our p = 0.5 variant it is 1.0970. Close 3 = 1.0960 falls strictly below both, with penetration (1.1020 − 1.0960)/0.0100 = 60% of the first body. Equality at a threshold fails the strict rule. These arithmetic checks are not a fresh run of the compiled detector.

Change only Close 3 to 1.0980: penetration becomes 40%, so the 30% condition passes and the 50% condition fails. The third body becomes 55 pips, still above 27. The unchanged diagram separately uses O1=100, C1=110, H1=125, L1=85, C3=106:4/10=40% of body versus 4/40=10% of range. Its 30%-body threshold 107 passes; substituting the range gives an incorrect threshold 98. Denominator choice is one recognition condition, not the complete pattern flag.

The most common mistakes when trading the evening star

Keep contextual selection, detector conditions and execution timing separate. A function can recognize its geometry without evaluating a prior trend. If recognition needs final C3, do not issue a completed historical signal before that bar closes. A next-available-price entry and a later minimum-break rule are different strategy versions, neither inherently safer.

Do not soften gaps, equality or historical body-size rules only after noticing an attractive FX chart. Those are version changes. Nor can this geometry expose trader emotions or make the engulfing pattern an automatic confirming advantage. Evaluate every qualifying signal, order handling, fees and exits on data not used to choose the rules.

What to do tomorrow

  1. Record the detector version, penetration parameter, body-size history and prior-context rule. Do not conflate Evening Star with Unique Three River.
  2. Check body gaps separately from full candle ranges and name the penetration denominator explicitly.
  3. Test equality and alternative third closes without changing the other model inputs. A more restrictive threshold does not itself imply a better trading result.
  4. Recognize only information available at the decision time, then specify orders, volume, expiry, exits and costs independently. Demo practice or a week of selected examples does not certify future performance.

To place the evening star in a broader context, a good starting point is the technical analysis section in our library.