OPEN-SOURCE SCRIPT
VCP Base Detector

📊 VCP BASE DETECTOR - AUTO-DETECT CONSOLIDATION ZONES
🎯 WHAT IS THIS INDICATOR?
This indicator automatically detects and marks ALL consolidation bases (VCP bases) on your chart. It:
✅ Auto-detects when price enters consolidation
✅ Measures base tightness (volatility contraction)
✅ Tracks base duration (how long consolidating)
✅ Rates base quality (1-5 stars)
✅ Shows volume drying confirmation
✅ Detects base breakouts
✅ Shows progression of multiple bases (VCP pattern)
Use this WITH the "Mark Minervini SEPA Balanced" indicator for complete trading setups!
✅ Mark Minervini SEPA Balanced = Trend + RS + Stage
✅ VCP Base Detector = Base Quality + Progression
Combined = Complete professional trading system!
🎨 WHAT YOU SEE ON YOUR CHART
1️⃣ COLORED BOXES (Base Zones):
🟦 Aqua Box = ⭐⭐⭐⭐⭐ Excellent base (tightest)
🔵 Blue Box = ⭐⭐⭐⭐ Very good base
🟣 Purple Box = ⭐⭐⭐ Good base
🟠 Orange Box = ⭐⭐ Fair base
⬜ Gray Box = ⭐ Weak base
2️⃣ BASE LABELS (With Metrics):
Shows above each base:
• Duration: 20 days
• Tightness: 0.9%
• Quality: ⭐⭐⭐⭐⭐
3️⃣ BREAKOUT LABELS (When price exits base):
Green "BREAKOUT ✓" label shows:
• Price: ₹800
• Volume: 1.6x
4️⃣ DASHBOARD (Top-Left Panel):
Real-time base metrics showing:
• In Base: YES/NO
• Tightness: 0.8%
• Duration: 22 days
• Range: 3.5%
• Volume: Drying/Normal
• Quality: ⭐⭐⭐⭐
📊 UNDERSTANDING BASE QUALITY (⭐ Rating System)
⭐⭐⭐⭐⭐ (EXCELLENT)
├─ Tightness: < 0.8% ATR
├─ Duration: 15-40 days
├─ Volume: Significantly drying
├─ Price Range: < 5%
└─ Result: Most explosive breakouts (best quality)
⭐⭐⭐⭐ (VERY GOOD)
├─ Tightness: 0.8-1.0% ATR
├─ Duration: 15-35 days
├─ Volume: Very dry
├─ Price Range: < 7%
└─ Result: High probability breakouts
⭐⭐⭐ (GOOD)
├─ Tightness: 1.0-1.3% ATR
├─ Duration: 15-30 days
├─ Volume: Drying
├─ Price Range: < 8%
└─ Result: Decent breakout probability
⭐⭐ (FAIR)
├─ Tightness: 1.3-1.5% ATR
├─ Duration: 15-25 days
├─ Volume: Moderate drying
├─ Price Range: < 10%
└─ Result: Lower quality, riskier
⭐ (WEAK)
├─ Tightness: > 1.5% ATR
├─ Duration: Varies
├─ Volume: Not drying enough
├─ Price Range: > 10%
└─ Result: Low quality, skip these
📈 HOW TO USE - STEP BY STEP
STEP 1: ADD INDICATOR TO CHART
────────────────────────────────
1. Open any stock chart (use 1D timeframe for swing trading)
2. Click "Indicators"
3. Search "VCP Base Detector"
4. Click to add to chart
5. Wait a moment for boxes to appear
STEP 2: SCAN FOR BASES
───────────────────────
Look for:
✓ Colored boxes appearing on chart (bases forming)
✓ Dashboard showing "In Base: YES"
✓ Tightness below 1.5%
✓ Volume Dry: YES
STEP 3: MONITOR BASE QUALITY
──────────────────────────────
Dashboard shows stars:
⭐⭐⭐⭐⭐ = Wait for breakout (best setup)
⭐⭐⭐⭐ = Good quality, watch for breakout
⭐⭐⭐ = Decent, but not ideal
⭐⭐ or ⭐ = Skip (lower probability)
STEP 4: WAIT FOR BREAKOUT
──────────────────────────
When price breaks above the box:
✓ Green "BREAKOUT ✓" label appears
✓ Shows breakout price and volume
✓ If volume shows 1.3x+, breakout is confirmed
✓ This is your entry signal!
STEP 5: CHECK MINERVINI CRITERIA (Use Both Indicators)
───────────────────────────────────────────────────────
Before entering:
✓ VCP Base Detector shows ⭐⭐⭐⭐+ quality base
✓ Mark Minervini indicator shows BUY SIGNAL
✓ Dashboard shows 10+ criteria GREEN
✓ Stage shows S2
Result: HIGH-PROBABILITY SETUP! 🎯
📋 DASHBOARD INDICATORS - WHAT EACH MEANS
BASE METRICS SECTION:
─────────────────────
In Base = ✓ YES or ✗ NO
Show if price is currently consolidating
Tightness = 0-3% (lower = tighter = better)
< 0.8% = ⭐⭐⭐⭐⭐ (excellent)
0.8-1.0% = ⭐⭐⭐⭐ (very good)
1.0-1.3% = ⭐⭐⭐ (good)
1.3-1.5% = ⭐⭐ (fair)
> 1.5% = ⭐ (weak)
Duration = Number of days in consolidation
15 days = ⭐ (too short, weak)
20 days = ⭐⭐⭐ (ideal)
30 days = ⭐⭐⭐⭐ (very long, strong)
> 40 days = ⚠️ (too long, may break down)
Range = % movement within the base
< 5% = ⭐⭐⭐⭐⭐ (excellent, very tight)
5-8% = ⭐⭐⭐ (good)
> 10% = ⭐ (loose, not ideal)
Vol Dry = Volume status during consolidation
✓ YES = Volume contracting (good)
✗ NO = Normal/high volume (weak setup)
QUALITY SECTION:
────────────────
Stars = Overall base quality rating
⭐⭐⭐⭐⭐ = Best quality bases (most explosive)
⭐⭐⭐⭐ = Excellent quality
⭐⭐⭐ = Good quality
⭐⭐ = Fair quality
⭐ = Weak quality (skip)
52W INFO SECTION:
─────────────────
From 52W Hi = How far below 52-week high is price?
< 25% = In sweet zone ✓
> 25% = Too far from highs ✗
From 52W Lo = How far above 52-week low is price?
> 30% = In sweet zone ✓
< 30% = Too close to lows ✗
⚙️ CUSTOMIZATION GUIDE
Click ⚙️ gear icon next to indicator to adjust:
MINIMUM BASE DAYS (Default: 15)
──────────────────────────────
Current: 15 = Include shorter bases
Change to 20 = Longer bases only (higher quality)
Change to 10 = Include very short bases (more frequent)
Why: Longer bases = better breakouts, but fewer opportunities
ATR% TIGHTNESS THRESHOLD (Default: 1.5)
────────────────────────────────────────
Current: 1.5 = BALANCED for Indian stocks
Change to 1.0 = ONLY very tight bases (⭐⭐⭐⭐⭐)
Change to 2.0 = Looser bases included (more frequent)
Why: Lower = tighter bases = better quality, fewer signals
VOLUME DRYING THRESHOLD (Default: 0.7)
──────────────────────────────────────
Current: 0.7 = Volume at 70% of average (good drying)
Change to 0.6 = Stricter (more volume drying required)
Change to 0.8 = Looser (less volume drying required)
Why: Volume drying = consolidation confirmation
52W PERIOD (Default: 252)
─────────────────────────
Current: 252 = Full year lookback
Don't change unless you know what you're doing
📈 REAL TRADING EXAMPLE
SCENARIO: Trading MARUTI over 6 weeks
WEEK 1: Nothing happening
─────────────────────────
- No boxes on chart
- Dashboard: "In Base: NO"
- Action: SKIP (not consolidating)
WEEK 2: Base Starting to Form
─────────────────────────────
- Purple box appears (⭐⭐⭐ quality)
- Dashboard: "In Base: YES"
- Tightness: 1.2%
- Duration: 3 days (too new)
- Action: MONITOR (let it develop)
WEEK 3-4: Base Tightening
──────────────────────────
- Box color changes from Purple → Blue (⭐⭐⭐⭐ quality)
- Dashboard: Duration: 12 days
- Tightness: 0.9%
- Vol Dry: YES
- Action: GET READY (high-quality base forming)
WEEK 4-5: Perfect Base Formed
──────────────────────────────
- Box changes to Aqua (⭐⭐⭐⭐⭐ EXCELLENT!)
- Dashboard: Duration: 22 days ✓
- Tightness: 0.8% ✓
- Vol Dry: YES ✓
- Range: 4.2% ✓
- Action: WATCH FOR BREAKOUT
WEEK 5: BREAKOUT HAPPENS!
──────────────────────────
- Price closes above box
- Green "BREAKOUT ✓" label appears
- Shows: Price ₹850, Volume 1.6x
- Mark Minervini indicator: BUY SIGNAL ✓
- Dashboard all GREEN ✓
- Action: ENTER TRADE
Entry: ₹850
Stop: Box low (₹820)
Target: ₹980 (20% move)
RESULT: +15.3% profit in 2 weeks! ✅
💡 PRO TIPS FOR BEST RESULTS
1. COMBINE WITH MINERVINI INDICATOR
Use BOTH indicators together:
✓ VCP Detector = Base quality
✓ Minervini = Trend + RS + Volume
Result = Best high-probability setups
2. PREFER ⭐⭐⭐⭐+ QUALITY BASES
Don't trade ⭐⭐ or ⭐ quality bases
Only trade ⭐⭐⭐+ (ideally ⭐⭐⭐⭐+)
Higher quality = Higher win rate
3. WAIT FOR VOLUME CONFIRMATION
Base must show "Vol Dry: YES"
Breakout must have 1.3x+ volume
Low volume breakouts fail often
4. USE 1D TIMEFRAME ONLY
This indicator optimized for daily charts
Intraday = Too many false signals
Weekly = Misses good setups
5. MONITOR MULTIPLE BASES (VCP PATTERN)
Multiple bases getting tighter = VCP pattern
Each base should be better quality than last
Tightest base = Biggest breakout
6. COMBINE WITH 52W CONTEXT
Dashboard shows "From 52W Hi" and "From 52W Lo"
Price should be in sweet zone:
< 25% from 52W high (uptrend territory)
> 30% above 52W low (not oversold)
7. BACKTEST FIRST
Use TradingView Replay
Go back 6-12 months
See how many bases appeared
See which were profitable
❌ BASES TO SKIP (Lower Probability)
Skip if:
❌ Quality rating < ⭐⭐⭐ (only 1-2 stars)
❌ Tightness > 1.5% (too loose)
❌ Duration < 10 days (too short, weak)
❌ Duration > 50 days (too long, may break down)
❌ Vol Dry: NO (volume not contracting)
❌ Range > 10% (not tight consolidation)
❌ Price < 30% from 52W low (too weak)
❌ Price > 30% from 52W high (too far up, late entry)
⚠️ IMPORTANT DISCLAIMERS
✓ This indicator is for educational purposes only
✓ Past performance does not guarantee future results
✓ Always use proper risk management (position sizing, stop loss)
✓ Never risk more than 2% of your account on one trade
✓ Base detection is technical analysis, not investment advice
✓ Losses can occur - trade at your own risk
✓ Combine with other indicators for best results
🎓 LEARNING RESOURCES
To understand VCP bases better:
→ Study "Trade Like a Stock Market Wizard" by Mark Minervini
→ Watch: "VCP Pattern" videos on YouTube
→ Practice: Backtest on 1-2 years of historical data
→ Learn: How consolidation precedes breakouts
🚀 YOU'RE READY!
Happy trading! 📈🎯
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。