Skip to content
All library documents

A Doji-Based Directional Strategy with Price-Change Signals

Article TradingView scripts

Summary

This script identifies doji-like candles using a configurable maximum body size, with an additional exact equality check between open and close. It establishes a bullish state when such a candle occurs while the close is above its value two bars earlier, and a bearish state when the close is below that reference. Those states drive long or short entries and corresponding chart colors. The inputs also include take-profit and stop-loss distances expressed in pips.

The source describes the pattern as a candle with matching open and close, but the implemented detection also applies a body-size threshold and directional comparison. It provides no market, timeframe, test results, or evidence that the signals are profitable. The script's warning frames it as educational and notes that it changes bar colors, so readers should examine its state and exit logic carefully before interpreting it as a validated trading system.

Key ideas

  • The script classifies candles using a small-body threshold and exact open-close equality.
  • A qualifying candle above or below the close from two bars earlier sets a directional state.
  • The directional state triggers long or short entries and changes chart coloring.
  • Take-profit and stop-loss distances are user-configurable in pips.
  • No performance evidence or validation across markets and timeframes is provided.

Tags

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