PROTECTED SOURCE SCRIPT
3-Candle Reversal Pattern-vahid2star

3-Candle Reversal Zones + Hammer Confirmation (with Risk Management & Alerts)
This script combines 3-candle reversal detection, hammer confirmations, and smart demand/supply zone plotting into a single tool designed for both discretionary and automated traders.
🔍 Core Logic
3-Candle Reversal Pattern
Candle-1: Strong move in one direction (big body).
Candle-2: Doji-like candle (high shadow/body ratio).
Candle-3: Reversal candle in the opposite direction (large body relative to Candle-2).
A gap after Candle-3 is required for extra confirmation.
Hammer Confirmation (Hammer-1 & Hammer-2)
After a valid 3-candle setup, the script searches for a hammer pattern near the zone.
Hammer-1: Draws a box directly on the hammer range if followed by a strong confirming candle.
Hammer-2: If another hammer forms after the confirmation candle and holds for N bars (configurable), a second hammer box is drawn.
Demand & Supply Zones
For bullish setups, a demand zone is created from the Candle-2 low to the Candle-1 low.
For bearish setups, a supply zone is created from the Candle-2 high to the Candle-1 high.
Zones extend to the right until price interacts with them.
🛠 Filters & Quality Controls
Trend filter (optional):
Only draw zones if price respects higher-timeframe EMA200 slope and LTF EMA alignment.
Market structure filter:
Require higher-high / higher-low (for bullish) or lower-high / lower-low (for bearish).
ATR filter:
Zones must have a minimum height relative to ATR.
Overlap control:
Avoid drawing zones that overlap too heavily with existing ones.
Cooldown:
Restrict consecutive zones of the same type within a user-defined bar distance.
🎯 Risk Management & Strategy
Dynamic position sizing:
Trade size is automatically calculated from account equity, risk %, and leverage.
Stop-loss & Take-profit:
SL placed just beyond the zone ± buffer ticks.
TP automatically set at user-defined Reward:Risk ratio (e.g., 3:1).
Capital protection:
Trades respect max leverage and risk per position settings.
⚡ Alerts
The script provides one-time alerts for each zone:
🔔 First Touch Alert → Triggered when price first touches a demand, supply, or hammer box.
Each zone only fires one alert, avoiding duplicates on re-touch or trade exit.
📊 Visuals
Demand zones: Green boxes.
Supply zones: Red boxes.
Hammer boxes: Blue (bullish) / Orange (bearish).
Used zones: Greyed out after price fills them.
Outcomes: Zones change to green if TP is hit, red if SL is hit.
Optional labels mark “Bullish zone ✓”, “Bearish zone ✓”, “Hammer-1 ✓”, or “Hammer-2 ✓” when confirmed.
🔧 Settings Overview
Core pattern ratios (C1/C2, C3/C2 size multipliers).
Doji definition (shadow/body ratio).
Hammer search depth, confirmation delay, and strictness.
Risk % per trade, leverage cap, stop buffer, RR ratio.
Visual styling (colors, max box count, labels).
Trend, structure, ATR, overlap, and cooldown filters.
Option to disable orders (use as indicator + alerts only).
⚠️ Disclaimer
This script is a technical analysis tool intended for educational purposes.
It does not guarantee profits. Use proper risk management and test thoroughly before applying in live trading.
✨ With its combination of 3-candle reversals, hammer confirmations, and smart filtering, this script is designed to reduce noise, highlight high-probability zones, and give traders both visual structure and actionable alerts.
This script combines 3-candle reversal detection, hammer confirmations, and smart demand/supply zone plotting into a single tool designed for both discretionary and automated traders.
🔍 Core Logic
3-Candle Reversal Pattern
Candle-1: Strong move in one direction (big body).
Candle-2: Doji-like candle (high shadow/body ratio).
Candle-3: Reversal candle in the opposite direction (large body relative to Candle-2).
A gap after Candle-3 is required for extra confirmation.
Hammer Confirmation (Hammer-1 & Hammer-2)
After a valid 3-candle setup, the script searches for a hammer pattern near the zone.
Hammer-1: Draws a box directly on the hammer range if followed by a strong confirming candle.
Hammer-2: If another hammer forms after the confirmation candle and holds for N bars (configurable), a second hammer box is drawn.
Demand & Supply Zones
For bullish setups, a demand zone is created from the Candle-2 low to the Candle-1 low.
For bearish setups, a supply zone is created from the Candle-2 high to the Candle-1 high.
Zones extend to the right until price interacts with them.
🛠 Filters & Quality Controls
Trend filter (optional):
Only draw zones if price respects higher-timeframe EMA200 slope and LTF EMA alignment.
Market structure filter:
Require higher-high / higher-low (for bullish) or lower-high / lower-low (for bearish).
ATR filter:
Zones must have a minimum height relative to ATR.
Overlap control:
Avoid drawing zones that overlap too heavily with existing ones.
Cooldown:
Restrict consecutive zones of the same type within a user-defined bar distance.
🎯 Risk Management & Strategy
Dynamic position sizing:
Trade size is automatically calculated from account equity, risk %, and leverage.
Stop-loss & Take-profit:
SL placed just beyond the zone ± buffer ticks.
TP automatically set at user-defined Reward:Risk ratio (e.g., 3:1).
Capital protection:
Trades respect max leverage and risk per position settings.
⚡ Alerts
The script provides one-time alerts for each zone:
🔔 First Touch Alert → Triggered when price first touches a demand, supply, or hammer box.
Each zone only fires one alert, avoiding duplicates on re-touch or trade exit.
📊 Visuals
Demand zones: Green boxes.
Supply zones: Red boxes.
Hammer boxes: Blue (bullish) / Orange (bearish).
Used zones: Greyed out after price fills them.
Outcomes: Zones change to green if TP is hit, red if SL is hit.
Optional labels mark “Bullish zone ✓”, “Bearish zone ✓”, “Hammer-1 ✓”, or “Hammer-2 ✓” when confirmed.
🔧 Settings Overview
Core pattern ratios (C1/C2, C3/C2 size multipliers).
Doji definition (shadow/body ratio).
Hammer search depth, confirmation delay, and strictness.
Risk % per trade, leverage cap, stop buffer, RR ratio.
Visual styling (colors, max box count, labels).
Trend, structure, ATR, overlap, and cooldown filters.
Option to disable orders (use as indicator + alerts only).
⚠️ Disclaimer
This script is a technical analysis tool intended for educational purposes.
It does not guarantee profits. Use proper risk management and test thoroughly before applying in live trading.
✨ With its combination of 3-candle reversals, hammer confirmations, and smart filtering, this script is designed to reduce noise, highlight high-probability zones, and give traders both visual structure and actionable alerts.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.