# Abandoned Baby

Abandoned Baby is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Detects the strict abandoned baby: a long trend candle, a doji whose whole range gaps clear of both neighbors, then a gap back that closes at least 30% into the first body, after a prior trend on a 10 EMA. Each pattern shades both gaps, plans an entry with the stop at the doji extreme and a 2R target, and tracks gap fills and outcomes in a dashboard.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Aug 17, 2026.
- Access: free.
- Concepts: [abandoned baby](https://www.luxalgo.com/library/concept/abandoned-baby/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=qh37vf8k0d20h86rxozr2co9
- Page: https://www.luxalgo.com/library/indicator/abandoned-baby/

The **Abandoned Baby** is a sophisticated technical indicator that identifies the rare and powerful reversal candlestick pattern of the same name. By isolating a price point that has been effectively orphaned from its neighbors by price gaps, the indicator provides traders with a clear visual signal of exhaustion and potential trend reversal. This pattern consists of three distinct components: a large trend candle, a gapped doji or small-bodied candle, and a third candle that gaps in the opposite direction, signaling a decisive shift in market sentiment. By automating the detection of these events and providing a built-in trade management framework, it helps traders capitalize on sharp, high-conviction pivots.

## How to Trade the Abandoned Baby?

The Abandoned Baby pattern represents a complete rejection of the previous move. A bullish setup requires a significant downtrend, followed by a gap down to a doji, and then a gap up that pushes the third candle significantly into the body of the first. Conversely, a bearish setup requires a preceding uptrend. 

Traders should look for signals that occur at price extremes, as these often indicate the highest probability of success. The indicator highlights these levels and provides customizable trade plans. You can choose to enter on the close of the third candle or wait for a price break beyond its high or low for additional confirmation. Because the doji represents a specific area of interest, the opposite extreme of this candle serves as a logical stop loss. If the price returns to this zone, the isolation of the pattern is effectively negated, and the trade should be closed to manage risk. The built-in dashboard allows you to track the performance of these signals, monitoring targets reached, stops hit, or trades closed due to time constraints.

## Abandoned Baby Settings

### Pattern Rules
* **Gap Rule**: Choose between Strict (shadows must clear the gap) or Relaxed (only bodies need to clear the gap). Strict patterns are rarer and often more significant.
* **Doji Body % of Range**: Defines the maximum percentage of the candle's total high-low range that the real body can occupy to be considered a doji.
* **Body Average Length**: The number of bars used to calculate the average body length to define the initial trend candle.
* **First Candle Body Multiplier**: Determines how large the first trend candle must be relative to the average body.
* **Third Candle Penetration %**: The percentage of the first candle's body that the third candle must close into, verifying the strength of the reversal.

### Trend Context
* **Require Prior Trend**: Toggle whether the pattern must be preceded by an established trend.
* **Trend EMA Length**: The period for the exponential moving average used to define the current trend direction.
* **Extreme Lookback**: The number of bars scanned to determine if the doji represents a new local high or low.

### Trade Plan
* **Entry**: Select between entering on the third candle close or waiting for a price break beyond the third candle.
* **Break Window**: The number of bars allowed for a price break to trigger if the "Third Candle Break" mode is active.
* **Target (R)**: The reward-to-risk ratio used to set the take profit level.
* **Maximum Hold (Bars)**: The number of bars to keep a trade open before closing it if no target or stop is hit.

## Frequently Asked Questions

### What is the difference between Strict and Relaxed gap rules?
The Strict rule requires the entire candle range, including shadows, to clear the gaps, which is the traditional definition of the pattern. The Relaxed rule allows for gaps between real bodies only, which catches more variants but represents a lower conviction setup.

### What does the Location grade in the tooltip signify?
The location grade indicates whether the doji candle has printed a fresh extreme relative to a defined lookback period. A completion at a new extreme suggests the exhaustion point is more significant than one appearing during a range-bound phase.

### How is the target R-multiple calculated?
The target is calculated as a multiple of the risk, which is defined as the distance between the entry price and the doji's extreme. Using the doji extreme as the stop loss ensures that the target reflects the specific volatility of the setup.

## Related indicators

- [On-neck / In-neck / Thrusting](https://www.luxalgo.com/library/indicator/on-neck-in-neck-thrusting/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/on-neck-in-neck-thrusting.md
- [Rising/falling Three Methods](https://www.luxalgo.com/library/indicator/rising-falling-three-methods/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/rising-falling-three-methods.md
- [Swing Highs/Lows & Candle Patterns](https://www.luxalgo.com/library/indicator/swing-highs-lows-candle-patterns/) (Hammer): markdown at https://www.luxalgo.com/library/indicator/swing-highs-lows-candle-patterns.md
- [Reversal Candlestick Structure](https://www.luxalgo.com/library/indicator/reversal-candlestick-structure/) (Hammer): markdown at https://www.luxalgo.com/library/indicator/reversal-candlestick-structure.md
- [Candlestick Structure](https://www.luxalgo.com/library/indicator/candlestick-structure/) (Doji): markdown at https://www.luxalgo.com/library/indicator/candlestick-structure.md
- [Evening Star](https://www.luxalgo.com/library/indicator/evening-star/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/evening-star.md
- [Hanging Man](https://www.luxalgo.com/library/indicator/hanging-man/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/hanging-man.md
- [Candlestick Channels](https://www.luxalgo.com/library/indicator/candlestick-channels/) (Hammer): markdown at https://www.luxalgo.com/library/indicator/candlestick-channels.md

---

Source: https://www.luxalgo.com/library/indicator/abandoned-baby/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
