OPEN-SOURCE SCRIPT

Price Action Brooks Pro

505
Price Action Brooks Pro (PABP) - Professional Trading Indicator

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📊 OVERVIEW

Price Action Brooks Pro (PABP) is a professional-grade TradingView indicator developed based on Al Brooks' Price Action trading methodology. It integrates decades of Al Brooks' trading experience and price action analysis techniques into a comprehensive technical analysis tool, helping traders accurately interpret market structure and identify trading opportunities.

• Applicable Markets: Stocks, Futures, Forex, Cryptocurrencies
• Timeframes: 1-minute to Daily (5-minute chart recommended)
• Theoretical Foundation: Al Brooks Price Action Trading Method

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🎯 CORE FEATURES

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1️⃣ INTELLIGENT GAP DETECTION SYSTEM

Automatically identifies and marks three critical types of gaps in the market.

TRADITIONAL GAP
• Detects complete price gaps between bars
• Upward gap: Current bar's low > Previous bar's high
• Downward gap: Current bar's high < Previous bar's low
• Hollow border design - doesn't obscure price action
• Color coding: Upward gaps (light green), Downward gaps (light pink)
• Adjustable border: 1-5 pixel width options

TAIL GAP
• Detects price gaps between bar wicks/shadows
• Analyzes across 3 bars for precision
• Identifies hidden market structure

BODY GAP
• Focuses only on gaps between bar bodies (open/close)
• Filters out wick noise
• Disabled by default, enable as needed

Trading Significance:
• Gaps signal strong momentum
• Gap fills provide trading opportunities
• Consecutive gaps indicate trend continuation

✓ Independent alert system for all gap types

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

2️⃣ RTH BAR COUNT (Trading Session Counter)

Intelligent counting system designed for US stock intraday trading.

FEATURES
• RTH Only Display: Regular Trading Hours (09:30-15:00 EST)
• 5-Minute Chart Optimized: Displays every 3 bars (15-minute intervals)
• Daily Auto-Reset: Counting starts from 1 each trading day

SMART COLOR CODING
• 🔴 Red (Bars 18 & 48): Critical turning moments (1.5h & 4h)
• 🔵 Sky Blue (Multiples of 12): Hourly markers (12, 24, 36...)
• 🟢 Light Green (Bar 6): Half-hour marker (30 minutes)
• ⚫ Gray (Others): Regular 15-minute interval markers

Al Brooks Time Theory:
• Bar 18 (90 min): First 90 minutes determine daily trend
• Bar 48 (4 hours): Important afternoon turning point
• Hourly markers: Track institutional trading rhythm

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

3️⃣ FOUR-LINE EMA SYSTEM

Professional-grade configurable moving average system.

DEFAULT CONFIGURATION
• EMA 20: Short-term trend (Al Brooks' most important MA)
• EMA 50: Medium-short term reference
• EMA 100: Medium-long term confirmation
• EMA 200: Long-term trend and bull/bear dividing line

FLEXIBLE CUSTOMIZATION
Each EMA can be independently configured:
• On/Off toggle
• Data source selection (close/high/low/open, etc.)
• Custom period length
• Offset adjustment
• Color and transparency

COLOR SCHEME
• EMA 20: Dark brown, opaque (most important)
• EMA 50/100/200: Blue-purple gradient, 70% transparent

TRADING APPLICATIONS
• Bullish Alignment: Price > 20 > 50 > 100 > 200
• Bearish Alignment: 200 > 100 > 50 > 20 > Price
• EMA Confluence: All within <1% = major move precursor

Al Brooks Quote:
"The EMA 20 is the most important moving average. Almost all trading decisions should reference it."

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

4️⃣ PREVIOUS VALUES (Key Prior Price Levels)

Automatically marks important price levels that often act as support/resistance.

THREE INDEPENDENT CONFIGURATIONS
Each group configurable for:
• Timeframe (1D/60min/15min, etc.)
• Price source (close/high/low/open/CurrentOpen, etc.)
• Line style and color
• Display duration (Today/TimeFrame/All)

SMART OPEN PRICE LABELS ⭐
• Auto-displays "Open" label when CurrentOpen selected
• Label color matches line color
• Customizable label size

TYPICAL SETUP
• 1st Line: Previous close (Support/Resistance)
• 2nd Line: Previous high (Breakout target)
• 3rd Line: Previous low (Support level)

Al Brooks Magnet Price Theory:
• Previous open: Price frequently tests opening price
• Previous high/low: Strongest support/resistance
• Breakout confirmation: Breaking prior levels = trend continuation

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

5️⃣ INSIDE & OUTSIDE BAR PATTERN RECOGNITION

Automatically detects core candlestick patterns from Al Brooks' theory.

ii PATTERN (Consecutive Inside Bars)
• Current bar contained within previous bar
• Two or more consecutive
• Labels: ii, iii, iiii (auto-accumulates)
• High-probability breakout setup
• Stop loss: Outside both bars

Trading Significance:
"Inside bars are one of the most reliable breakout setups, especially three or more consecutive inside bars." - Al Brooks

OO PATTERN (Consecutive Outside Bars)
• Current bar engulfs previous bar
• Two or more consecutive
• Labels: oo, ooo (auto-accumulates)
• Indicates indecision or volatility increase

ioi PATTERN (Inside-Outside-Inside)
• Three-bar combination: Inside → Outside → Inside
• Auto-detected and labeled
• Tug-of-war pattern
• Breakout direction often very strong

SMART LABEL SYSTEM
• Auto-accumulation counting
• Dynamic label updates
• Customizable size and color
• Positioned above bars

✓ Independent alerts for all patterns

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

💡 USE CASES

INTRADAY TRADING
✓ Bar Count (timing rhythm)
✓ Traditional Gap (strong signals)
✓ EMA 20 + 50 (quick trend)
✓ ii/ioi Patterns (breakout points)

SWING TRADING
✓ Previous Values (key levels)
✓ EMA 20 + 50 + 100 (trend analysis)
✓ Gaps (trend confirmation)
✓ iii Patterns (entry timing)

TREND FOLLOWING
✓ All four EMAs (alignment analysis)
✓ Gaps (continuation signals)
✓ Previous Values (targets)

BREAKOUT TRADING
✓ iii Pattern (high-reliability setup)
✓ Previous Values (targets)
✓ EMA 20 (trend direction)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🎨 DESIGN FEATURES

PROFESSIONAL COLOR SCHEME
• Gaps: Hollow borders + light colors
• Bar Count: Smart multi-color coding
• EMAs: Gradient colors + transparency hierarchy
• Previous Values: Customizable + smart labels

CLEAR VISUAL HIERARCHY
• Important elements: Opaque (EMA 20, bar count)
• Reference elements: Semi-transparent (other EMAs, gaps)
• Hollow design: Doesn't obscure price action

USER-FRIENDLY INTERFACE
• Clear functional grouping
• Inline layout saves space
• All colors and sizes customizable

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📚 AL BROOKS THEORY CORE

READING PRICE ACTION
"Don't try to predict the market, read what the market is telling you."

PABP converts core concepts into visual tools:
• Trend Assessment: EMA system
• Time Rhythm: Bar Count
• Market Structure: Gap analysis
• Trade Setups: Inside/Outside Bars
• Support/Resistance: Previous Values

PROBABILITY THINKING
• ii pattern: Medium probability
• iii pattern: High probability
• iii + EMA 20 support: Very high probability

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚙️ TECHNICAL SPECIFICATIONS

• Pine Script Version: v6
• Maximum Objects: 500 lines, 500 labels, 500 boxes
• Alert Functions: 8 independent alerts
• Supported Timeframes: All (5-min recommended for Bar Count)
• Compatibility: All TradingView plans, Mobile & Desktop

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🚀 RECOMMENDED INITIAL SETTINGS

GAPS
• Traditional Gap: ✓
• Tail Gap: ✓
• Border Width: 2

BAR COUNT
• Use Bar Count: ✓
• Label Size: Normal

EMA
• EMA 20: ✓
• EMA 50: ✓
• EMA 100: ✓
• EMA 200: ✓

PREVIOUS VALUES
• 1st: close (Previous close)
• 2nd: high (Previous high)
• 3rd: low (Previous low)

INSIDE & OUTSIDE BAR
• All patterns: ✓
• Label Size: Large

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🌟 WHY CHOOSE PABP?

✅ Solid Theoretical Foundation
Based on Al Brooks' decades of trading experience

✅ Complete Professional Features
Systematizes complex price action analysis

✅ Highly Customizable
Every feature adjustable to personal style

✅ Excellent Performance
Optimized code ensures smooth experience

✅ Continuous Updates
Constantly improving based on feedback

✅ Suitable for All Levels
Benefits beginners to professionals

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📖 RECOMMENDED LEARNING

Al Brooks Books:
• "Trading Price Action Trends"
• "Trading Price Action Trading Ranges"
• "Trading Price Action Reversals"

Learning Path:
1. Understand basic candlestick patterns
2. Learn EMA applications
3. Master market structure analysis
4. Develop trading system
5. Continuous practice and optimization

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠️ RISK DISCLOSURE

IMPORTANT NOTICE:
• For educational and informational purposes only
• Does not constitute investment advice
• Past performance doesn't guarantee future results
• Trading involves risk and may result in capital loss
• Trade according to your risk tolerance
• Test thoroughly in demo account first

RESPONSIBLE TRADING:
• Always use stop losses
• Control position sizes reasonably
• Don't overtrade
• Continuous learning and improvement
• Keep trading journal

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📜 COPYRIGHT

Price Action Brooks Pro (PABP)
Author: © JimmC98
License: Mozilla Public License 2.0
Pine Script Version: v6

Acknowledgments:
Thanks to Dr. Al Brooks for his contributions to price action trading. This indicator is developed based on his theories.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Experience professional-grade price action analysis now!

"The best traders read price action, not indicators. But when indicators help you read price action better, use them." - Al Brooks

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.