PROTECTED SOURCE SCRIPT
Atualizado TA Darvas Box Test

🎯 Core Logic
1-Darvas Box Breakouts/Breakdowns → Entry when price crosses above the Top Box (long) or below the Bottom Box (short).
2-Trend Filter (MavilimW) → Longs only when price is above MAVW, shorts only when below.
3-Momentum Confirmations → ATR spike and Volume spike must confirm breakout strength.
🛠 Position Sizing (MaTriangle – Martingale by Qty)
1-Starts with Base Qty.
2-On losing trades → step-up size using Qty Multiplier, capped by Max Steps & Max Qty Cap.
3-On winning trades → optional reset back to Base Qty.
⚠️ Martingale sizing can increase drawdowns — use carefully.
⏱ Trade Gating
1-Backtest Window: Only trades between selected From – To dates.
2-Trade Cap: Limit trades Per Day / Per Week / Per Month (auto reset).
3-One Position at a Time (pyramiding = 0).
📉 Exit Rules
1-Protective Stops:
2-Long → Stop at Bottom Box.
3-Short → Stop at Top Box.
Profit Safeguard: If in profit, exit when RVI crosses against trade.
1-No fixed TP → trades ride until Box stop or RVI exit.
🔔 Alerts (Options Workflow)
1-Static Alerts: Fire on confirmed long/short signals (compile-safe).
2-Dynamic Alerts: Send ATM strike info, Qty, and Martingale step.
3-Auto ATM Mapping: BANKNIFTY, NIFTY, FINNIFTY, MIDCPNIFTY detected automatically; fallback to manual step.
⚙️ Suggested Defaults
Darvas Box Length = 5
ATR Len = 14, ATR SMA = 14, Mult = 1.0–1.5
Volume SMA = 20, Mult = 1.5–2.0
Base Qty = 1, Mult = 2.0, Max Steps = 3
Trade Cap = Per Day, 10–30 trades
✅ Works on any symbol/timeframe.
⚠️ High-risk position sizing (Martingale). Backtest thoroughly and use with caution.
1-Darvas Box Breakouts/Breakdowns → Entry when price crosses above the Top Box (long) or below the Bottom Box (short).
2-Trend Filter (MavilimW) → Longs only when price is above MAVW, shorts only when below.
3-Momentum Confirmations → ATR spike and Volume spike must confirm breakout strength.
🛠 Position Sizing (MaTriangle – Martingale by Qty)
1-Starts with Base Qty.
2-On losing trades → step-up size using Qty Multiplier, capped by Max Steps & Max Qty Cap.
3-On winning trades → optional reset back to Base Qty.
⚠️ Martingale sizing can increase drawdowns — use carefully.
⏱ Trade Gating
1-Backtest Window: Only trades between selected From – To dates.
2-Trade Cap: Limit trades Per Day / Per Week / Per Month (auto reset).
3-One Position at a Time (pyramiding = 0).
📉 Exit Rules
1-Protective Stops:
2-Long → Stop at Bottom Box.
3-Short → Stop at Top Box.
Profit Safeguard: If in profit, exit when RVI crosses against trade.
1-No fixed TP → trades ride until Box stop or RVI exit.
🔔 Alerts (Options Workflow)
1-Static Alerts: Fire on confirmed long/short signals (compile-safe).
2-Dynamic Alerts: Send ATM strike info, Qty, and Martingale step.
3-Auto ATM Mapping: BANKNIFTY, NIFTY, FINNIFTY, MIDCPNIFTY detected automatically; fallback to manual step.
⚙️ Suggested Defaults
Darvas Box Length = 5
ATR Len = 14, ATR SMA = 14, Mult = 1.0–1.5
Volume SMA = 20, Mult = 1.5–2.0
Base Qty = 1, Mult = 2.0, Max Steps = 3
Trade Cap = Per Day, 10–30 trades
✅ Works on any symbol/timeframe.
⚠️ High-risk position sizing (Martingale). Backtest thoroughly and use with caution.
Notas de Lançamento
SOME IMPROVEMENT Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
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 protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
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.