OPEN-SOURCE SCRIPT

Aura Trend & Candlestick Oracle [Pineify]

896
Aura Trend & Candlestick Oracle

This indicator layers EMA-based trend detection with candlestick pattern recognition, then gates the pattern signals through the prevailing trend direction. The idea: candlestick reversals are far more reliable when they fire in alignment with the macro trend rather than against it. A hammer in a downtrend is noise; the same hammer in an uptrend is a potential continuation entry after a pullback.

Key Features

  • EMA cloud (fast/slow) with dynamic color fill that shifts between bullish, bearish, and neutral states
  • Five candlestick patterns: Bullish Engulfing, Bearish Engulfing, Hammer, Shooting Star, Inverted Hammer / Hanging Man
  • Signals filtered by trend — bullish patterns only fire in uptrends, bearish patterns only in downtrends
  • Background shading highlights trend zones for quick chart-reading
  • Dashboard panel showing live trend status and current EMA values
  • Four alert conditions: BUY signal, SELL signal, EMA bullish crossover, EMA bearish crossunder


How It Works

Trend detection uses two exponential moving averages — a fast EMA (default 50) and a slow EMA (default 200). When the fast EMA is above the slow EMA, the script treats the market as an uptrend; when below, a downtrend. This classic crossover relationship provides the filtering layer for all pattern signals.

Candlestick pattern detection evaluates each bar's body size, wick lengths, and direction, then checks the previous bar's properties for multi-bar patterns:

  1. Engulfing patterns — the current candle's body fully wraps the prior candle's body in the opposite direction. Bullish Engulfing requires a red prior bar followed by a green bar that opens below the prior body low and closes above the prior body high.
  2. Hammer — lower wick exceeds 2× the body size, upper wick is less than half the body. No directional restriction on the body itself.
  3. Shooting Star / Inverted Hammer / Hanging Man — upper wick exceeds 2× body, lower wick less than half the body. The body color separates these: Inverted Hammer is green (treated as bullish), Hanging Man is red (treated as bearish). Shooting Star is the upper-wick pattern used for bearish signals.


How the Components Work Together

The EMA trend state acts as a regime filter, not just a visual layer. A bullish candlestick pattern (Engulfing, Hammer, Inverted Hammer) only triggers a BUY signal when fastEma > slowEma — the pattern fires into the trend, not against it. Similarly, bearish patterns only produce SELL signals when the fast EMA is below the slow EMA.

This prevents the common trap of fading reversals in strong trends. A hammer below the 200 EMA might signal a brief bounce, but it is not a high-probability long in a downtrend. By requiring trend alignment, the indicator reduces false positives from countertrend noise. The tradeoff is that signals at the beginning of a trend reversal — when the fast EMA has not yet crossed — will be missed. This is by design.

Trading Ideas and Insights

  • On higher timeframes (daily, weekly), use the EMA cloud crossover alert to identify macro trend shifts, then drop to a lower timeframe to look for BUY/SELL pattern signals for entry timing.
  • After a pullback to or near the fast EMA in an uptrend, a Hammer or Bullish Engulfing signal at that level adds confluence — price has retested the trend structure and showed rejection. Consider these setups stronger than patterns firing far from either EMA.
  • The Hanging Man (red candle with extended upper wick in an uptrend) triggers a SELL signal when the market is in a downtrend. In practice, watch for this pattern forming near prior resistance or the slow EMA during a counter-rally in a downtrend.
  • Use the dashboard panel to confirm trend state without scrolling back. On faster timeframes, the 50/200 EMA spread updates frequently; on crypto or forex pairs, consider adjusting the slow EMA to 100 to reduce lag.


Past candlestick patterns do not guarantee future price movement. All signals should be treated as areas of potential interest, not definitive entry triggers.

Unique Aspects

  • Trend-gating is the core differentiator here. Many candlestick indicators plot patterns on every bar regardless of context; this one explicitly suppresses countertrend signals at the calculation level, so the chart stays clean.
  • The Inverted Hammer is classified as bullish and the Hanging Man as bearish based on body color, using the upper-wick geometry. Some implementations treat these as the same pattern with identical signals; here they are split by color to reflect their different interpretations in technical analysis.
  • The EMA cloud uses transparency-adjusted fills that match the trend color, so the visual relationship between the two EMAs immediately communicates regime state without requiring a separate panel.


How to Use

  1. Add the indicator to any chart and timeframe. The EMA cloud and background shading appear immediately, showing the current trend regime.
  2. Watch for BUY labels (green) below bars during uptrend zones (green background) — these mark bars where a bullish pattern fired with trend confirmation.
  3. Watch for SELL labels (red) above bars during downtrend zones (red background).
  4. Set up alerts via the Alerts panel: choose "Aura BUY Signal" or "Aura SELL Signal" for pattern-filtered signals, or "Trend Shift to Uptrend/Downtrend" for EMA crossover notifications.
  5. Check the dashboard (top-right corner) for live trend status and EMA values on the current bar.


Customization

  • Fast EMA Length (default: 50) — Controls the short-term trend line. Lower values increase sensitivity and produce more cloud crossovers; higher values smooth out the regime filter.
  • Slow EMA Length (default: 200) — The long-term trend anchor. The 50/200 combination is a widely watched institutional reference; on shorter timeframes, consider 20/50 or 9/21.
  • Color Candles by Trend — When enabled, all candles recolor to match the current trend state. Disable if you prefer standard OHLC coloring or are using another candle-coloring indicator.
  • Bullish / Bearish / Neutral Colors — All visual elements (cloud, candles, background, EMAs) derive from these three color inputs, so changing them updates the entire indicator at once.


Conclusion

Aura Trend & Candlestick Oracle combines two well-understood techniques — EMA trend detection and candlestick pattern recognition — with a regime filter that suppresses countertrend noise. It works best on trending markets where the EMA structure is well-defined; in choppy, sideways conditions, expect frequent EMA crossovers and fewer valid pattern signals. Traders who already use candlestick patterns and want an automatic trend-alignment layer without managing multiple indicators will find this a practical consolidation.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.