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! ๐๐ฏ
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.