Skip to content
All library documents

Candlestick Pattern Signals with Trend Filters and Position Exits

Article TradingView scripts

Summary

This strategy detects a broad collection of bullish and bearish candlestick formations, including reversal and continuation patterns. Candle attributes such as body size, shadow length, direction, and gaps are compared with recent averages and pattern-specific rules. Users can select bullish, bearish, or both pattern types and enable or disable individual formations.

An optional trend filter uses price relative to a 50-period moving average, or the ordering of 50- and 200-period averages. Detected bullish patterns trigger long entries and bearish patterns trigger short entries; opposing signals and price-based conditions close positions. The script includes a configurable stop-loss input, but the exit logic also closes positions under other price conditions. It supplies no backtest results or evidence that the many patterns remain predictive across instruments or timeframes, and the excerpt omits much of the pattern implementation.

Key ideas

  • The script uses candle geometry and price relationships to identify many bullish and bearish patterns.
  • A selectable moving-average rule can require a trend context for pattern detection.
  • Bullish and bearish detections drive long and short entries, with opposing signals used to exit.
  • The code includes a stop-loss setting and additional price-based exit rules.
  • No performance evaluation or evidence of predictive value is provided.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.