OPEN-SOURCE SCRIPT
Doji @ Simple Areas — Strategy (v7)

Twisted FX — Doji @ Simple Areas — Strategy (v7) Educational strategy for standard candles. No financial advice. Use realistic commission + slippage in backtests. For community chat or videos, see the author’s Signature on their profile.
Summary: Doji reversals only where it matters—inside/near ATR-sized supply/demand areas built from swing pivots. Optional quality gating, HTF confluence, and zone-strength scoring help keep the good trades and filter the noise.
What it does
Builds supply/demand areas from swing pivots when the departure is strong enough (ATR-scaled).
Maintains zone lifecycle: tracks touches, confirms retests, expires old zones, and flips a broken zone into the opposite side (optional).
Waits for a doji near/in a zone (strict or loose definition), with optional next-bar confirmation.
Resolves side using (a) which zone you’re closest to, (b) penetration depth, and/or (c) EMA trend.
Optional filters: K-of-4 quality checks, HTF EMA gate, HTF swing-band proximity, and zone strength score.
How signals form
Detect doji (strict: tiny body+both wicks; loose: body ≤ range fraction)
Check near/inside zone (ATR proximity)
Choose side (penetration vs distance; EMA trend optional; prev-candle flip optional)
Optional next-bar confirmation away from the touched zone
Pass quality mode + strength gates; enter at close, stop beyond doji wick (+buffer), TP via RR multiple
Quality modes
Off: widest coverage
Soft: pass K-of-4 (wick rejection, edge-band close, fresh touch, approach impulse)
Strict: auto-tightens thresholds (deeper wick, tighter band, stronger approach, fresher touch) + “rescue” if nearby zone is very strong
Zone strength (0–10)
Based on retests, post-touch reaction, age, and integrity (not broken); separate minimums for Soft/Strict
HTF confluence (optional)
HTF EMA trend gate (longs with uptrend, shorts with downtrend)
HTF swing-band proximity (ATR band around HTF swings)
Defaults are off so you can evaluate the core edge first
Options to play with
Zones/visuals: pivot length, zone half-ATR, min departure, expiry, break tolerance, de-dupe, extend right, Show zones, Hide unconfirmed, nearest-K highlight
Confirmation: retest window (bars), wick-based retest depth (ATR), min bars between signals
Doji rules: strict/loose, body fraction, min range (ATR), near-zone distance (ATR)
Side resolver: use trend (EMAs), use penetration, prev-candle flip, next-bar confirm + confirm ATR
Quality: mode Off/Soft/Strict, K setting, wick penetration ATR, edge-band fraction, approach lookback/min ATR, fresh-touch spacing
Strength gate: min strength Soft/Strict
Risk: RR multiple, stop buffer (micropips/ticks), Fixed qty or Risk % of equity
HTF: timeframe, EMA lengths, swing len, HTF ATR band size
Defaults
Quality mode: Off
HTF trend gate: Off
Show zones: On
Flip on break: On
Tuning tips
Too few trades: Quality → Off/Soft, raise proxATR, lower minRetestsToShow, widen confirm window, enable wick-based retest
Too many losers: try Soft/Strict, raise minStrength*, enable next-bar confirm, raise approachMinATR, enable HTF trend
Confirmed-only is empty: lower minRetestsToShow (e.g., 1) and enable wick-based retest so strong rejections count
Visuals & debug
Toggle “Show zones” and “Hide unconfirmed”; nearest-K highlight brings focus
Debug mode prints veto reasons (quality/HTF/strength/prevFlip/confirm) to help tuning
Notes
Zones come from confirmed pivots; brand-new structure needs a few bars to appear
Research/education only; not financial advice
Changelog (v7.1.5)
Safer arrays, stable nearest-K highlight, strict tuned with rescue, zone-strength consistency loops, defaults set to Quality Off & HTF gate Off, debug veto labels
Keywords
supply demand, doji, wick rejection, ATR, EMA, HTF, RR, confluence, strict filter, zone strength, FX/crypto/indices
Summary: Doji reversals only where it matters—inside/near ATR-sized supply/demand areas built from swing pivots. Optional quality gating, HTF confluence, and zone-strength scoring help keep the good trades and filter the noise.
What it does
Builds supply/demand areas from swing pivots when the departure is strong enough (ATR-scaled).
Maintains zone lifecycle: tracks touches, confirms retests, expires old zones, and flips a broken zone into the opposite side (optional).
Waits for a doji near/in a zone (strict or loose definition), with optional next-bar confirmation.
Resolves side using (a) which zone you’re closest to, (b) penetration depth, and/or (c) EMA trend.
Optional filters: K-of-4 quality checks, HTF EMA gate, HTF swing-band proximity, and zone strength score.
How signals form
Detect doji (strict: tiny body+both wicks; loose: body ≤ range fraction)
Check near/inside zone (ATR proximity)
Choose side (penetration vs distance; EMA trend optional; prev-candle flip optional)
Optional next-bar confirmation away from the touched zone
Pass quality mode + strength gates; enter at close, stop beyond doji wick (+buffer), TP via RR multiple
Quality modes
Off: widest coverage
Soft: pass K-of-4 (wick rejection, edge-band close, fresh touch, approach impulse)
Strict: auto-tightens thresholds (deeper wick, tighter band, stronger approach, fresher touch) + “rescue” if nearby zone is very strong
Zone strength (0–10)
Based on retests, post-touch reaction, age, and integrity (not broken); separate minimums for Soft/Strict
HTF confluence (optional)
HTF EMA trend gate (longs with uptrend, shorts with downtrend)
HTF swing-band proximity (ATR band around HTF swings)
Defaults are off so you can evaluate the core edge first
Options to play with
Zones/visuals: pivot length, zone half-ATR, min departure, expiry, break tolerance, de-dupe, extend right, Show zones, Hide unconfirmed, nearest-K highlight
Confirmation: retest window (bars), wick-based retest depth (ATR), min bars between signals
Doji rules: strict/loose, body fraction, min range (ATR), near-zone distance (ATR)
Side resolver: use trend (EMAs), use penetration, prev-candle flip, next-bar confirm + confirm ATR
Quality: mode Off/Soft/Strict, K setting, wick penetration ATR, edge-band fraction, approach lookback/min ATR, fresh-touch spacing
Strength gate: min strength Soft/Strict
Risk: RR multiple, stop buffer (micropips/ticks), Fixed qty or Risk % of equity
HTF: timeframe, EMA lengths, swing len, HTF ATR band size
Defaults
Quality mode: Off
HTF trend gate: Off
Show zones: On
Flip on break: On
Tuning tips
Too few trades: Quality → Off/Soft, raise proxATR, lower minRetestsToShow, widen confirm window, enable wick-based retest
Too many losers: try Soft/Strict, raise minStrength*, enable next-bar confirm, raise approachMinATR, enable HTF trend
Confirmed-only is empty: lower minRetestsToShow (e.g., 1) and enable wick-based retest so strong rejections count
Visuals & debug
Toggle “Show zones” and “Hide unconfirmed”; nearest-K highlight brings focus
Debug mode prints veto reasons (quality/HTF/strength/prevFlip/confirm) to help tuning
Notes
Zones come from confirmed pivots; brand-new structure needs a few bars to appear
Research/education only; not financial advice
Changelog (v7.1.5)
Safer arrays, stable nearest-K highlight, strict tuned with rescue, zone-strength consistency loops, defaults set to Quality Off & HTF gate Off, debug veto labels
Keywords
supply demand, doji, wick rejection, ATR, EMA, HTF, RR, confluence, strict filter, zone strength, FX/crypto/indices
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.