Piercing Line Candlestick Pattern: Midpoint and Gap Rules
A piercing line candlestick pattern is a possible bullish reversal after a decline: a bearish candle is followed by a bullish candle that closes above the midpoint of the first real body. The opening gap matters. TradingView requires an open below the prior low; a pattern without that gap needs a different rule label. The completed shape does not establish that the downtrend has ended.
Key Takeaways
- The midpoint uses the first open and close. A wick above it does not satisfy a closing-price rule.
- A strict low-gap pattern and a relaxed continuous-market variant produce different signal sets.
- Full body engulfing concerns the candle bodies; it does not require engulfing both wicks.
- An additional confirmation candle introduces delay. Evaluate that tradeoff with specified rules and costs.
Measure the body midpoint before calling the pattern
Use the first candle open and close, not its high and low: midpoint = (first open + first close) / 2. The second close must exceed that value. This page keeps a piercing label only while that close remains below the first open, separating a partial recovery from full body engulfing. A close exactly at the midpoint fails the strict greater-than test.
- Check for a preceding decline and record how your detector defines it.
- Require a bearish first candle with a substantial body and a bullish second candle.
- Specify the opening-gap convention before counting signals.
- Evaluate the second close after the candle finishes, not from its intrabar high.
An illustrative midpoint calculation
Assume a decline leads into a first candle that opens at 110 and closes at 100, with a low of 99. Its body midpoint is 105. A second candle opening at 98 and closing at 106 meets the strict gap and midpoint tests. The recovery into the first body is (106 - 100) / (110 - 100) = 60%. That percentage measures penetration, not a probability of profit.
| Second close | Body recovery | Classification in this example |
|---|---|---|
| 104 | 40% | Below the midpoint; fails |
| 105 | 50% | At the midpoint; fails the strict threshold |
| 106 | 60% | Piercing line |
| 111 | 110% | Full body engulfing; relabel the pattern |
| Bar | Open | High | Low | Close |
|---|---|---|---|---|
| Prior decline | 114 | 115 | 109 | 110 |
| First candle | 110 | 111 | 99 | 100 |
| Second candle | 98 | 107 | 97 | 106 |
Hollow bodies close at or above the open. Filled bodies close below the open.
Illustrative OHLC values, not historical prices or a backtest. The first body spans 100 to 110; its midpoint is 105. Earlier trend history is assumed and is not fully shown.
Stocks, forex and crypto: name the gap convention
TradingView and StockCharts publish different opening tests. TradingView specifies an open below the previous low, while StockCharts describes an open below the previous close. A session break on a stock chart can produce either case. On bars within a continuous trading session, the next open may equal the previous close, so a strict gap detector can reject a visually similar recovery. Check the actual OHLC and session setting rather than relaxing the rule silently.
| Convention | Second open | Interpretation |
|---|---|---|
| TradingView strict gap | Below 99 | Below the entire prior range |
| StockCharts close gap | Below 100 | May remain inside the prior range |
| Custom continuous-market variant | At 100, or within a stated tolerance | Removes the strict gap; test and report separately |
- If using a tolerance, state its unit and maximum value, such as one minimum price tick.
- Keep symbol, timeframe and regular or extended session settings fixed when comparing detections.
- A forex or crypto label does not waive the selected gap condition.
Piercing line versus bullish engulfing
The distinction is how much of the first real body the second candle covers. In the example, a 106 close recovers part of the 100-to-110 body; a 111 close covers it fully when paired with the 98 open. Bullish engulfing does not require the second high and low to engulf the first wicks. Classifying the shape does not establish which pattern has a better trading expectancy.
Separate pattern completion from trade confirmation
An unfinished second candle can rise above the midpoint and then close below it. Waiting for its closing update fixes that particular ambiguity. Requiring a later candle to close above the second high is an additional strategy condition: it delays the decision and can change the entry price. It is not part of the two-candle shape and does not guarantee a successful reversal.
- Illustrative research rule: after the example closes at 106, require the next candle to close above 107; otherwise skip the setup.
- Illustrative invalidation: cancel that setup if price trades below the two-candle low of 97 before the confirmation close.
- If both levels are crossed within one historical bar, OHLC alone may not reveal the order. Specify how the test handles that case.
- For a strategy test, define the fill timing, exit, sizing, spread, commissions and slippage separately. A stop level is not a guaranteed fill price.
Pineify next step
Turn your chosen definition into inspectable rules
Use Pineify AI Coding Agent to draft a detector with a penetration threshold, gap mode, trend filter and closed-candle requirement. Compare its labels with the worked example and near misses before using it. The Visual Editor offers a separate route for combining available conditions; custom gap variants may require generated code. This page explains the pattern and does not scan live markets.
Sources and verification
Last verified:
- TradingView: Piercing - Bullish, strict gap and trend inputs
- StockCharts ChartSchool: bullish reversal patterns and piercing definition
- TradingView: Engulfing - Bullish, body versus full range
- TradingView Pine Script: bar states and closing updates
- TradingView Pine Script: repainting and higher-timeframe inputs
Educational information, not investment advice. All numerical examples are hypothetical. A candlestick pattern can fail, and trading can result in losses. A historical test does not guarantee future results.