OPEN-SOURCE SCRIPT

Objective Doji Highlight (Range-Relative)

85
This indicator highlights Doji candles using an objective, mathematics-based rule: a bar is Doji when the absolute difference between its open and close is less than or equal to a user-defined fraction (x) of that bar’s high–low range.

How it works:

Compute body size as the absolute difference between open and close.

Compute the bar’s range as high minus low.

Classify as Doji when body size ≤ x × range.

Only Doji candles are colored; non-Doji bars remain unchanged.

Inputs

Doji threshold (x of range): tolerance (0–1) controlling how small the body must be relative to the range.

Doji Candle Color: visual color for detected Doji candles.

Example:
If x = 0.10 and a candle has high = 100 and low = 90 (range = 10), the maximum allowed body is 1.
If the difference between open and close is ≤ 1, the candle is marked as Doji.

Why it can be useful
Doji candles are often studied as signs of market indecision. This tool provides a clear, parameter-based way to identify them consistently across any timeframe, without discretionary interpretation.

Notes & limitations

Works with standard candlesticks (not Heikin Ashi, Renko, or other synthetic bar types).

Visualization and research only: it does not produce buy/sell signals and makes no performance claims.

No repainting from future data; the logic uses only the current bar’s prices.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.