Piercing Line Trading System - MANUAL

27 February 2026, 13:38
Ich Khiem Nguyen
0
16

PART
Section
Description
1 INTRODUCTION
Product introduction, what the product helps you with
     
2 INSTALLATION & SETUP
System requirements, step-by-step installation guide

Guide to Installing Free Indicators and EAs Included with the Mirage Trading System Purchase

3 INTERFACE DISPLAY
Explanation of the components displayed on the chart

 User Guide: Trading Lines & Signal Tracking System
The system automatically draws Entry, Stop Loss, and Take Profit lines (TP 1–4) on the chart, tracks price action for hits, records Win/Loss results, and displays real-time performance statistics.
  User Guide : Visualization, Zone Fill, Signal Dashboard & Cancelled Signals  When you attach an indicator to a chart, the system renders the following visual components for each detected signal

User Guide: MTF SCAN & Dashboard User Guide 
MTF SCAN automatically scans all Market Watch symbols across 8 timeframes (M1 to W1) and displays results on a Dashboard grid directly on your chart.
  User Guide : Chart Theme User Guide  Chart Theme is a feature that changes the entire chart color scheme in MetaTrader 5 — including the background, candles, grid, text, and Bid/Ask lines — with a single click.
4 CORE CONCEPTS
Fundamental concepts that the system is built upon

 User Guide: Market Structure Functionality in the Trading System
Identifies trend direction (Uptrend, Downtrend, Ranging) by analyzing swing highs/lows, and detects key events: BOS (trend continuation) and CHoCH (potential trend reversal).

User Guide : Signal Types, States, and Lifecycle  A signal is the system's notification when it detects a qualifying candlestick pattern on the chart. Each signal tells you the expected price direction and provides suggested entry, stop loss, and take profit levels.

5 SIGNAL FILTERS
Filters that refine and validate trading signals

 User Guide: Trade Direction (Direction Filter) in the Trading System
Defines the allowed trading direction (Buy only, Sell only, both, or neither) as the first filter before searching for entry signals, based on current market trend.

 User Guide: Signal Zone Filter in the Trading System
Eliminates signals not near important price zones, retaining only those connected to market structures (swing high/low, BOS, CHoCH) to reduce noise.

 User Guide: StoplossHunt Filter User Guide — Filtering "SL Sweep" Signals
Identifies higher-probability signals by checking whether price "swept stoploss" before forming a pattern.
   User Guide : Extreme Zone Filter
Extreme Zone Filter is a signal filtering feature that helps avoid entering trades when price is at the top or bottom of a Donchian price channel.
  User Guide: Opposite Signal Filter  The Opposite Signal Filter is an automatic feature that prevents new signals from appearing when you already have an active trade running in the opposite direction.The principle is very simple: Don't buy when you're selling. Don't sell when you're buying.
  User Guide : Quality Filter User Guide  Quality Filter is a feature that helps you receive only the best signals — price patterns formed clearly, with balanced proportions and high reliability — and reject weak signals, dull patterns, and those below standard.
 6  TRADE MANAGEMENT  
  User Guide : Risk/Reward & SL Method User Guide Risk/Reward (R:R) is the ratio between the amount of money you accept losing (Risk) and the amount of money you expect to gain (Reward) in a single trade.
  User Guide: Trailing Stop Loss (TSL) User Guide Regular Stop Loss (SL) stays fixed in one place. You set SL at 1990.00, and it stays there forever — even if price has risen to 2030.00.Trailing Stop Loss (TSL) is different. It automatically moves in your favor when price advances. As price moves up, TSL moves up with it. When price stalls or reverses, TSL holds the best position it reached.
7 CONFIGURATION PARAMETERS GUIDE
Detailed guide to each configuration parameter
   SIGNAL SCANNING CONFIGURATION GUIDE - MIRAGE TRADING SYSTEM EA  Guide to mastering signal scanning settings within the Inputs tab, optimizing trade discovery on a single chart or across the entire market.
 8  ALERTS & NOTIFICATIONS  
   User Guide: Alerts & Notifications User Guide  Configure push notifications, and on-screen popups when new signals are detected.
 9 SYSTEM RISKS & LIMITATIONS  Notes on system risks and limitations

1. INTRODUCTION

PiercingLineTradingSystem 1.00

2-Bar Bullish Reversal Pattern with Penetration-Depth Analysis

Author: Ich Khiem Nguyen | MQL5: https://www.mql5.com/en/users/khiemni/seller

What is PiercingLineTradingSystem?

PiercingLineTradingSystem detects Piercing Line candlestick patterns on your MetaTrader 5 charts automatically. The indicator evaluates each completed bar pair against six structural gates, scores surviving patterns across six weighted quality factors, and enters immediately at the close of the signal candle when a valid Piercing Line is confirmed. Entry price, stop loss, and take profit levels are drawn directly on the chart so you can assess the trade rather than perform the calculations manually.


What Is a Piercing Line Pattern?

A Piercing Line is a two-candle bullish reversal formation that appears after a downtrend. The first candle is a Long Black (bearish) candle that establishes a baseline. The second candle opens below the close of the first candle (a dislocation gap), then closes above the 50% midpoint of the first candle's body but remains below the first candle's open, completing the reversal signal.

The Piercing Line signals renewed buying momentum after a selling phase. Rather than immediately closing above the first candle (which would create an Engulfing pattern), the second candle's partial penetration into the first candle's body represents a measured recovery — buyers are stepping in but have not yet overcome all sellers. This structure is more common than full Engulfing and often precedes continuation of the upward move.

Bulkowski's research ranks the Piercing Line at 13 out of 103 candlestick patterns with a 64% reversal rate. The Piercing Line is the bullish counterpart of the Dark Cloud Cover (bearish) pattern.

Bullish Piercing Line

Appears after a downtrend. Bar 1 is a Long Black candle (large bearish body). Bar 2 opens below close1 (dislocation), then closes above the 50% midpoint of bar 1's body, confirming that buyers have absorbed the selling and begun pushing price higher. When this structure forms after at least two declining bars, the indicator classifies it as a Piercing Line.

Downtrend Context Detection

The indicator examines the three bars immediately before bar 1 of the potential pattern. If at least two of those bars are declining (lower closes), the pattern is classified as a Piercing Line. If the context is ambiguous — fewer than two declining bars — the indicator defaults to detecting based on whether the first candle is bearish enough (Long Black body). The Bulkowski statistics (64% reversal rate) are based on downtrend context.


How the Indicator Finds Patterns

The indicator evaluates each potential two-bar pattern against six sequential gates. All six must pass for a signal to be generated.

  1. Bar 1 Direction gate: Bar 1 must be bearish (close < open). This establishes the downtrend setup.

  2. Bar 1 Long Black gate: Bar 1's body must represent at least the minimum required body/ATR multiple (Standard: 0.25×, Strict: 0.50×). This confirms that bar 1 is a significant bearish candle, not a small doji.

  3. Bar 1 Body Ratio gate: Bar 1's body must represent at least the minimum required fraction of total range (Standard: 50%, Strict: 65%). This confirms that the bearish move dominated the candle structure.

  4. Bar 2 Dislocation gate: Bar 2's open must fall below bar 1's close by at least the minimum dislocation amount (Standard: 0.02× ATR, Strict: 0.05× ATR). This gap down opening signals a continuation of selling before buyers step in.

  5. Bar 2 Penetration gate: Bar 2's close must exceed the 50% midpoint of bar 1's body (penetration > 0.50). This confirms that buyers have pushed back into bar 1's range, establishing the reversal structure.

  6. Bar 2 NOT Engulfing gate: Bar 2's close must remain below bar 1's open (close2 < open1). If close2 >= open1, the pattern is a Bullish Engulfing (a different pattern with higher conviction) rather than a Piercing Line.

Only candles passing all six gates proceed to quality scoring and signal registration.


Quality Score — Evaluating Pattern Strength

Every pattern that clears detection receives a quality score between 0.00 and 1.00. Six factors contribute to this score, each weighted by its contribution to the Piercing Line's reversal reliability.

Quality Factors

Factor Weight What It Measures Direction
QF-1: Penetration Depth 0.35 How deep bar 2 penetrates into bar 1's body — deeper is better Ideal [0.50, 0.95]
QF-2: Body/ATR 0.25 Bar 1's body size relative to recent volatility — larger is better Ideal [0.60, 2.50]
QF-3: Dislocation ATR 0.20 Size of the gap down opening (open2 - close1) / ATR Ideal [0.05, 0.40]
QF-4: Bar 1 Body Ratio 0.10 Proportion of bar 1's range occupied by its body Ideal [0.70, 1.00]
QF-5: Relative Body 0.05 Bar 2's body compared to bar 1's body Ideal [0.70, 1.30]
QF-6: Direction Changed 0.05 Confirmation that bar 2 reversed the direction — always 1.0 for valid PRL [0.90, 1.00]

QF-1 (Penetration Depth) carries the highest weight (0.35) because the depth to which bar 2 penetrates bar 1's body is the core structural requirement of the Piercing Line — deeper penetration indicates stronger buyer confidence and commitment.

Score Grades

  • Grade A (0.80 - 1.00) — Excellent: Bar 2 closes near or above bar 1's midpoint with large dislocation gap and substantial bar 1 body
  • Grade B (0.60 - 0.79) — Good: Reliable setups with solid penetration and meaningful body metrics
  • Grade C (0.40 - 0.59) — Average: Valid structure but penetration is moderate; use with additional confirmation
  • Grade D (0.20 - 0.39) — Below Average: Marginal setup; higher false signal risk
  • Grade F (0.00 - 0.19) — Poor: Avoid trading these signals

Quality Threshold

The default minimum quality is 0.30. Adjusting this threshold changes which patterns appear on the chart:

  • 0.50 - 0.65: Shows only the most structurally sound Piercing Lines with strong penetration depth and large dislocation gaps — fewer signals with higher per-signal quality
  • 0.20 - 0.30: Shows more signals including weaker penetration examples — useful for research or studying the pattern across different market conditions
  • Tip: Start with the default 0.30 on your chosen symbol and timeframe and observe several dozen signals before adjusting

Entry Mode: Immediate

Piercing Line patterns use immediate entry at the close of bar 2 (the signal candle) rather than pending stop orders. When a valid Piercing Line is confirmed on bar close, the system enters the trade at that moment rather than waiting for a breakout above bar 1's open.

This reflects the nature of the pattern: bar 2's close above the 50% midpoint is the signal event. Waiting for a breakout would delay entry beyond the confirmation point. Immediate entry captures the move as defined by the pattern's structure.

Trading Levels

Bullish Piercing Line:

  • Entry = close of bar 2 (the signal candle)
  • Stop Loss = pattern low − 0.25×ATR

The pattern low is the minimum of bar 1's low and bar 2's low. The stop loss buffer of 0.25×ATR is placed beyond this extreme. A break below the pattern low invalidates the reversal premise.

Take profit levels are calculated from entry using configurable risk-reward multiples (default: 1R, 2R, 3R, 5R from entry to stop distance).


What You See on the Chart

When a Piercing Line pattern passes all detection gates and quality filters, the indicator draws the following:

Signal Markers

  • Arrow icons: Green upward arrows mark Piercing Line patterns. Gray arrows indicate signals blocked by an active filter such as the Opposite Signal filter.
  • Quality labels: A numeric score (e.g., "0.72") appears near each signal, showing how the pattern ranked across all six quality factors.

Trading Lines

  • Entry line: An orange horizontal line at the immediate entry level — the close of bar 2
  • Stop Loss line: A red horizontal line labeled "SL" — placed below the pattern low with an ATR buffer
  • Take Profit lines: Up to four green horizontal lines labeled TP1 through TP4, spaced at configurable R:R multiples from the entry level

Visual Zones

  • Pattern highlight: A shaded rectangle spans both bars of the Piercing Line, making it easy to identify which pair triggered the signal. The risk zone between entry and SL is shaded in red; reward zones between entry and each TP level are shaded progressively lighter.
  • Tracking dots: Small colored dots update as the signal state changes — white for pending (immediate entry, tracking), yellow for active, green for target hit, red for stop hit.

Signal Lifecycle

  1. Active: Immediate entry placed at bar 2 close — trade is live
  2. Target Hit: Price reached a take profit level
  3. Stop Hit: Price reached the stop loss
  4. Cancelled: Signal invalidated before close

Settings You Can Adjust

Detection Parameters

Setting What It Does Default When to Change
ATR Period for volatility Bars used to calculate ATR, normalizing all range-based thresholds to current volatility 14 Increase to 20+ for smoother ATR on noisy markets
Max Bars to Scan (history depth) Historical bars scanned on first load to display past patterns 3000 Increase for more history on higher timeframes
Min Bars Between Patterns Minimum gap between two consecutive signals 5 Increase to 7-10 if signals cluster; decrease to 3 for more
Detection Preset Switches between Standard, Strict, and Custom modes PRESET_STANDARD Use Strict for higher-conviction setups
Quality Score Filter Enables the quality filter true Keep enabled for live trading
Min Quality (0.0-1.0) Minimum quality score a pattern must achieve to display 0.30 Raise to 0.50+ for fewer but stronger signals

Detection Preset Values

Parameter STANDARD STRICT
Min Body/ATR (Bar 1) 0.25 0.50
Min Body Ratio (Bar 1) 0.50 (50%) 0.65 (65%)
Min Dislocation ATR 0.02 0.05
Require Trend Bars 2 3

Custom Threshold Parameters

Setting What It Does Default When to Change
[Custom] Min Body/ATR (Bar 1) Minimum bar 1 body size as a multiple of ATR 0.25 Increase to 0.40+ to require larger first candles
[Custom] Min Body Ratio (Bar 1) Minimum bar 1 body as a fraction of total range 0.50 Increase to 0.60 for more dominant bearish bodies
[Custom] Min Dislocation ATR Minimum gap-down opening (open2 - close1) / ATR 0.02 Increase to 0.03 to require larger dislocations
[Custom] Require Trend Bars Minimum prior declining bars to confirm downtrend context 2 Increase to 3 for stricter downtrend confirmation
SL Buffer (xATR beyond pattern extreme) Offset placed beyond the pattern low 0.25 Increase to 0.35 on volatile instruments
Trend SMA Period Period for trend-related calculations if used 20 Increase to 30 for longer-term trend context

Settings Tips

  • Begin with the Standard preset and default quality threshold on your chosen symbol; observe at least two to three weeks of signals before adjusting
  • If Standard produces too many signals on XAUUSD H1, raise Min Quality to 0.50 rather than switching to Strict — this preserves detection sensitivity while filtering out weaker structural examples
  • The dislocation gate (0.02× ATR Standard) allows small gaps; on volatile instruments, increase to 0.03 for more pronounced reversals
  • Avoid cutting the SL buffer below 0.20×ATR — the pattern low is the logical invalidation point for the reversal, and some retesting of that level is normal before the move develops

Best Timeframes and Markets

  • H1 — Quality: High | Frequency: Medium | Best for: Day traders seeking clear reversal setups at intraday support and resistance levels; recommended starting point
  • H4 — Quality: High | Frequency: Lower | Best for: Swing traders who want well-formed Piercing Line patterns with strong follow-through potential
  • M15 — Quality: Medium | Frequency: High | Best for: Scalpers wanting frequent Piercing Line signals during active session hours
  • D1 — Quality: Highest | Frequency: Low | Best for: Position traders seeking textbook Piercing Line formations at major daily structure levels

Best Markets

  • XAUUSD (Gold): Piercing Line patterns on H1 and H4 frequently mark significant intraday reversal points, particularly during London and New York session crossovers
  • Major forex pairs (EURUSD, GBPUSD, USDJPY): Piercing Line formations are common at key intraday levels, especially near round numbers and session open prices
  • Indices (US30, NAS100): Piercing Line patterns near prior lows can mark intraday turning points after sharp sell-offs
  • Oil (USOIL): Strong Piercing Line formations appear after sharp downward moves on H1 and H4

The indicator works on any symbol and timeframe. H1 with the Standard preset on XAUUSD is the recommended starting configuration.


Getting Started — Quick Setup

  1. Open MetaTrader 5 and load a chart (XAUUSD on H1 is a good starting point)
  2. In the Navigator panel (Ctrl+N), expand Indicators → Custom and locate PiercingLineTradingSystem
  3. Drag the indicator onto the chart
  4. In the settings dialog, select Detection Preset (Standard recommended for first use) and click OK — the indicator will scan history and display detected patterns immediately
  5. Observe the signals: green upward arrows indicate Piercing Line patterns
  6. Check the quality score on each signal — focus on patterns scoring 0.50 or higher when starting out
  7. Optional: Enable alerts in the ALERTS section to receive notifications when new patterns form in real-time

All Features at a Glance

  • Automatic Bullish Piercing Line two-candle detection on any symbol and timeframe
  • 6-gate structural detection: bar 1 direction, bar 1 long black body/ATR, bar 1 body ratio, bar 2 dislocation, bar 2 penetration depth (HARD RULE), bar 2 not engulfing
  • 6-factor weighted quality scoring (penetration depth 0.35, body/ATR 0.25, dislocation ATR 0.20, body ratio 0.10, relative body 0.05, direction changed 0.05)
  • Downtrend context detection using 3-bar prior price action: downCount >= 2 → Piercing Line
  • 3 detection presets: Standard, Strict, Custom (user-defined thresholds)
  • Immediate entry at bar 2 candle close (not pending order)
  • Signal states and lifecycle tracking
  • Quality filter to suppress weak patterns below threshold
  • Extreme zone filter (overbought/oversold rejection)
  • Stoploss hunt filter (liquidity sweep validation)
  • Opposite signal filter (prevent conflicting signals)
  • Risk/Reward with 3 stop loss methods (Donchian Channel, ATR, Pattern)
  • Up to 4 take profit levels (TP1-TP4) at configurable R:R ratios
  • Donchian Channel trailing stop loss
  • MTF Scanner (up to 150 symbols × 8 timeframes)
  • Market structure analysis (BOS / CHOCH)
  • 4-channel alert system (popup, sound, push, email)
  • Signal statistics dashboard
  • Professional chart themes (Dark, Light, Custom)
  • EA signal buffers for automated trading

For detailed guides on each feature, see the MANUAL included with the indicator.


Common Questions

Q: What is the difference between a Piercing Line and a Bullish Engulfing?

Both patterns feature bar 2 closing higher than bar 2 opened. In a Piercing Line, bar 2's close remains below bar 1's open (close2 < open1), leaving part of bar 1 unengulfed — this measured recovery suggests a gradual shift from sellers to buyers. In a Bullish Engulfing, bar 2 closes above bar 1's open, completely closing inside bar 1's range — this represents full buyer dominance and typically carries higher conviction. The Piercing Line is more common and has a 64% reversal rate versus Engulfing's typically higher rate.

Q: Why does the indicator use immediate entry instead of a Buy Stop?

The Piercing Line's defining feature is that bar 2 closes above the 50% midpoint of bar 1's body — the reversal signal occurs at bar close, not at a breakout level above bar 1's open. Waiting for price to break above bar 1's open would delay entry well after the signal event. Immediate entry at bar 2 close captures the move as defined by the pattern's structure and typical market behavior following the pattern.

Q: Why is the penetration depth gate described as important?

Penetration depth (how far bar 2 closes into bar 1's body) is the core structural requirement of the Piercing Line. It represents the conviction of the reversal: deeper penetration indicates that buyers have confidently pushed back into the sellers' territory, establishing genuine reversal momentum. Patterns with deep penetration (close to or above the 75% level of bar 1's body) score substantially higher because they demonstrate stronger buyer commitment.

Q: What does "downtrend context" mean for the Piercing Line?

The indicator checks the three bars before bar 1 of the potential pattern. For a pattern to be classified as a Piercing Line, at least two of those bars must be declining (lower closes). This ensures the pattern forms in an actual downtrend rather than during a consolidation. The Bulkowski statistics (64% reversal rate) are based on this downtrend context.

Q: What if both Bullish and Bearish signals appear on the same area?

If the Opposite Signal filter is enabled (InpOppositeFilter = true), the indicator prevents conflicting signals from being registered simultaneously. When a signal in the opposite direction is already active, new signals will either be blocked entirely or shown as gray blocked arrows depending on the InpShowBlockedIndicator setting. For Piercing Line, this protects against bearish patterns (Dark Cloud Cover) appearing at the same bar pair.

Q: How do I reduce the number of signals?

Raise the Min Quality threshold to 0.50 or higher. You can also switch to the Strict preset (tighter body and dislocation thresholds), enable the Direction Filter to restrict signals to the dominant trend direction, or enable the Extreme Zone Filter to block signals near overbought extremes.


What's New — Version 1.00

This is the initial release of PiercingLineTradingSystem. Key features include:

  • Piercing Line bullish two-candle detection using 6-gate structural validation with hard-rule penetration depth enforcement
  • 6-factor weighted quality scoring with penetration depth dominance (0.35 weight) rewarding deep reversals
  • Downtrend context detection from 3-bar prior price action to distinguish Piercing Line from weak reversals
  • Standard and Strict presets, plus fully customizable Custom threshold mode
  • Immediate entry at bar 2 candle close — no pending stop order required
  • 7-layer filter chain (Quality, Extreme Zone, Direction, Stoploss Hunt, Signal Zone, Market Structure, Opposite Signal)
  • Multi-timeframe scanner covering up to 150 symbols and 8 timeframes simultaneously
  • Automated Entry/SL/TP levels with Donchian Channel trailing stop
  • 4-channel alert system (popup, sound, push notification, email)
  • EA signal buffers enabling automated trading systems to consume Piercing Line signals via iCustom()
  • Professional chart themes (Dark, Light, Custom) for extended trading sessions

Getting Help

If you have questions or need support:


Ready to Start?

PiercingLineTradingSystem identifies the structural moment when buyers push back into a downtrend by opening below the prior close and closing above the midpoint of that bearish candle. Attach the indicator to your chart, start with the Standard preset on XAUUSD H1, and observe how the penetration depth aligns with the reversals you would identify manually.

Happy trading!

Ich Khiem Nguyen


PiercingLineTradingSystem 1.00 — Created 2026-02-24