Doji Signals with Close-to-Two-Bars-Ago Direction Filters
Summary
This educational script identifies doji candles by comparing the open and close, with an input that sets the maximum body size. It associates a doji with a directional condition based on whether the current close is below or above the close from two bars earlier. The resulting state marks short or long positions, colors bars according to the state, and submits corresponding strategy entries. User inputs also specify take-profit and stop-loss distances in pips.
The document defines a doji as a candle with equal open and close, while the implementation also permits a small body. It provides source code but no backtest results, market context, or evidence of profitability. The position-state and exit calculations are implemented through several repeated assignments, so the precise behavior should be checked in the intended platform before drawing conclusions. The accompanying description explicitly presents the script as educational and focused on changing bar colors.
Key ideas
- A doji is identified by a small open-to-close body, with an adjustable minimum-size threshold.
- The script uses the close relative to its value two bars earlier to determine directional states.
- It colors bars and submits long or short entries while using pip-based profit and loss thresholds.
- No empirical performance results or market-specific validation are provided.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.