In this article
After this article, you can
- Transform OHLC under price reflection while exchanging High and Low.
- Separate geometric symmetry from additional algorithm filters.
Terms at hand: Price gap · Backtesting · Stop loss · Relative Strength Index (RSI) · Trend
Piercing Line and Dark Cloud Cover describe opposite two-candle geometries: the second Close penetrates the first body after a decline or rise. The shape does not identify participants, confirm a completed reversal or establish an edge after costs. Define the gap, body-size and trend rules before comparing observations.
What are the piercing line and dark cloud cover patterns?
For our strict geometric version, let M=(O1+C1)/2. Piercing requires C1<O1,C2>O2,O2<L1 and M<C2<O1. Dark Cloud requires C1>O1,C2<O2,O2>H1 and O1<C2<M. Equality at the gap or midpoint fails these chosen rules. A wick crossing M is insufficient. TA-Lib has extra historical conditions, so the code is not simply this geometry with an inferred trend.
Use the midpoint of the first body, not (H1+L1)/2; the gap test still needs its extreme. An engulfing checks different body coverage. Shape comparison alone establishes neither trader psychology nor predictive strength.
Body penetration is geometry, not a success rate
A penetration of 70% says where the second Close lies relative to the first body, not a 70% chance of profit. A deeper Close changes classification or a declared strategy input; it does not prove a stronger reversal. Save exact prices and strict/inclusive boundaries.
These patterns differ in body coverage; that geometry does not establish a universal ranking of predictive strength. Engulfing covers the previous body, while piercing line and dark cloud cover penetrate more than half without fully engulfing it under their stated rules. A harami checks containment of a smaller body. Compare outcomes under explicit context, data-feed and entry rules before claiming that one shape is stronger.
Reflected prices require swapping High and Low
Check two-candle geometry before comparing pattern names. Price reflection reverses inequalities and exchanges extrema.
Scroll sideways to see the full diagram
Our geometric example is not the complete TA-Lib algorithm. First O/H/L/C=110/112/98/100; second=97/108/96/107. Reflection gives O′=210−O,C′=210−C,H′=210−L,L′=210−H. We test neither trend, historical body averages nor trade outcome. TA-Lib CDLPIERCING compares second Open with first Low and second Close with the first-body midpoint; the complete implementation also has historical filters.
Originally O₂=97 is below Low₁=98, while C₂=107 exceeds midpoint105 and stays below O₁=110. After reflection O₂′=113 exceeds High₁′=112; C₂′=103 is below105 and above O₁′=100. Penetration fractions are(107−100)/10 and(110−103)/10. This symmetry of our inequalities does not settle the later discussion of asymmetric historical TA-Lib filters.
What does it look like in an example?
Our separate hypothetical EUR/USD example assumes the required prior decline and chosen large-body rule. Candle 1 has O 1.0900,H 1.0910,L 1.0795,C 1.0800; candle 2 has O 1.0790,H 1.0880,L 1.0780,C 1.0870. M=1.0850; O2<L1 and M<C2<O1. Penetration=(1.0870−1.0800)/(1.0900−1.0800)=70%. H/L complete the old O/C example so its strict gap can actually be checked. These invented inputs establish geometry, not a full code result or trade.
Is a price gap required on the forex market?
Vendor definitions differ. TradingView requires second Open outside first Low/High; CandleScanner permits equality at that extreme. ChartSchool’s descriptions instead compare with the prior Close. Specify which one is tested, with a version and exact body/trend criteria. Do not combine samples under one supposedly universal “classic” rule.
A no-gap variant is a different rule, not mandatory correction of the strict one. For example, retaining first O=1.1000/C=1.0900/L=1.0890, a second O 1.0900/C1.0960 recovers 60% of the body but fails O2<L1. FX is not an unconditionally gap-free stream: OANDA US documents instrument-dependent breaks and possible gaps on reopening. This scope is not every provider’s trading schedule.
Where do you place the entry, stop-loss and target?
Recognition occurs after the second Close. A further close or level touch can be added as a separate strategy confirmation, moving the availability time. Define it before testing instead of assigning the earlier entry retrospectively. The RSI indicator can be another declared filter, but a low reading does not establish its incremental value.
A complete plan must independently specify side, entry, volume, stop, exit and costs. For Forex execution, long entry uses Ask and closing sale Bid; a short reverses those sides. Ordinary stops can fill beyond their trigger, and fill-based P&L already includes spread. A support or resistance filter is another hypothesis, not proof that the formation works best there.
The most common traps with these patterns
A separate hypothetical price model uses first O/H/L/C = 1.1000/1.1020/1.0890/1.0900 and second 1.0880/1.0980/1.0870/1.0970. Body midpoint 1.0950 differs from range midpoint 1.0955; penetration is 70%. Its opposite example 1.0900/1.1010/1.0880/1.1000 then 1.1020/1.1030/1.0920/1.0930 penetrates 70% downward. These are independent geometric examples, not success probabilities.
Geometric reflection need not produce identical detector decisions. In our synthetic test, 12 earlier bars have O/H/L/C = 100/112/95/104, or 100/112/95/109. Append 100/102/89/90 then 88/98/87/97, and reflect the entire history with p′=200−p, swapping High and Low. With default TA-Lib C 0.6.4 settings, the 4-body history gives Piercing 100 / Dark Cloud −100; the 9-body history gives 0/−100. Piercing requires both bodies to exceed their respective prior 10-body averages; Dark Cloud requires only the first and uses chosen penetration 0.5. With the 9-body history, the second threshold is (9×9+10)/10=9.1, so its body 9 fails Piercing. Neither function itself measures prior trend. The Morning Star is another named geometry, not automatically a stronger signal.
The preserved historical CSV classifies 120 closed Kraken EUR/USD H1 bars, 21–25 September 2026, with zero non-zero codes for these two pinned classifiers. That sample does not measure profitability or all broker Forex feeds. Our independent standard-library check reproduces these 240 codes and the synthetic counterexample; it is an emulation, not a fresh native TA-Lib run or an evaluation of all 18 detectors.
What to do tomorrow
- Identify source, price side, interval and exact definition, including gap, body-size averages and trend rule. Calculate a few examples by hand, including equality and near-boundary cases.
- Record all qualifying and rejected cases. Evaluate a predeclared location filter separately rather than assume it removes more false signals than indicators.
- Before you treat a pattern as a signal, mark the low of the whole two-candle structure, measure the distance to the nearest price barrier, and compare it with the distance from your entry to where the protective order would sit; if the target lies right next to the stop, skip the trade.
- Save signal-availability time and actual fills. A later confirmation changes the sample and possible entry price; compare both complete rule versions rather than assume waiting improves performance.
- Read the candlestick material in the technical analysis section in our educational library to see the piercing line and dark cloud cover alongside other reversal formations, and compare their partial nature with a full engulfing before you trade them live.
Check your understanding
One short exercise
About 2 min · you can try again
A candle has H114,L102. What extrema follow under p′=210−p?
- H′108 and L′96.
- H′96 and L′108.
- H′114 and L′102.
Check the answer and explanation
H′108 and L′96.
The higher reflected price comes from old Low:210−102=108. The lower comes from old High:210−114=96.
Frequently asked
What are the piercing line and dark cloud cover patterns?
How does the piercing line differ from the engulfing pattern?
Is a price gap required for these patterns to form on forex?
How do you set the entry, stop-loss and target on these patterns?
Sources & bibliography
-
StockCharts ChartSchool Candlestick Bullish Reversal Patterns · A description of the piercing pattern’s two-candle structure and its conventional bullish-reversal interpretation. chartschool.stockcharts.com ↗
-
StockCharts ChartSchool Candlestick Bearish Reversal Patterns · A description of the dark-cloud-cover pattern’s two-candle structure and its conventional bearish-reversal interpretation. chartschool.stockcharts.com ↗
-
StockCharts ChartSchool Candlestick Pattern Dictionary · An alphabetical reference placing piercing line and dark cloud cover among related candlestick formations. chartschool.stockcharts.com ↗
-
Candlecharts.com (Steve Nison) Candlestick Trading Courses — Shop · Steve Nison’s website offering candlestick trading courses. candlecharts.com ↗
-
TA-Lib CDLPIERCING source — C version 0.6.4 · Pinned code requires strict Low gap and two bodies exceeding their respective historical averages; its output does not check trend or predict profitability. raw.githubusercontent.com ↗
-
TA-Lib CDLDARKCLOUDCOVER source — C version 0.6.4 · Pinned code uses only the first long-body filter and a penetration parameter, so geometric reflection need not give symmetric classifications. raw.githubusercontent.com ↗
-
OANDA Corporation US Forex & Crypto Trading Hours of Operation · The named US product schedule documents breaks and reopening gap risks; it does not define every broker’s clock or guarantee stop execution. www.oanda.com ↗
