OPEN-SOURCE SCRIPT

VCP Base Detector

341

๐Ÿ“Š 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! ๐Ÿ“ˆ๐ŸŽฏ

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.