Rank Correlation Index (RCI) Strategy newmy firsht scripy by test only test 
my firsht scripy by test only test 
my firsht scripy by test only test 
onli test 
Indicators and strategies
TimezoneDiffLibLibrary   "TimezoneDiffLib" 
 get_tz_diff(tz1, tz2) 
  Parameters:
     tz1 (string) 
     tz2 (string)
Buy/Sell Zones – TV Style//@version=5
indicator("Buy/Sell Zones – TV Style", overlay=true, timeframe="", timeframe_gaps=true)
//=====================
// الإعدادات
//=====================
len     = input.int(100,  "Length", minval=10)
useATR  = input.bool(true, "Use ATR (بدل الانحراف المعياري)")
mult    = input.float(2.0, "Band Multiplier", step=0.1)
useRSI  = input.bool(true, "تفعيل فلتر RSI")
rsiOB   = input.int(70, "RSI Overbought", minval=50, maxval=90)
rsiOS   = input.int(30, "RSI Oversold",  minval=10, maxval=50)
//=====================
// القناة: أساس + انحراف
//=====================
basis = ta.linreg(close, len, 0)
off   = useATR ? ta.atr(len) * mult : ta.stdev(close, len) * mult
upper = basis + off
lower = basis - off
// نطاق علوي/سفلي بعيد لعمل تعبئة المناطق
lookback      = math.min(bar_index, 500)
topBand       = ta.highest(high, lookback)  + 50 * syminfo.mintick
bottomBand    = ta.lowest(low, lookback)    - 50 * syminfo.mintick
//=====================
// الرسم
//=====================
pUpper   = plot(upper, "Upper", color=color.new(color.blue, 0), linewidth=1)
pLower   = plot(lower, "Lower", color=color.new(color.red,  0), linewidth=1)
pBasis   = plot(basis, "Basis", color=color.new(color.gray, 60), linewidth=2)
// تعبئة المناطق: فوق القناة (أزرق)، تحت القناة (أحمر)
pTop     = plot(topBand,    display=display.none)
pBottom  = plot(bottomBand, display=display.none)
fill(pUpper, pTop,    color=color.new(color.blue, 80))   // منطقة مقاومة/بيع
fill(pBottom, pLower, color=color.new(color.red,  80))   // منطقة دعم/شراء
//=====================
// خط أفقي من قمّة قريبة (يمثل مقاومة) – قريب من الخط المنقّط في الصورة
//=====================
resLen   = math.round(len * 0.6)
dynRes   = ta.highest(high, resLen)
plot(dynRes, "Recent Resistance", color=color.new(color.white, 0), linewidth=1)
//=====================
// إشارات BUY / SELL + فلتر RSI (اختياري)
//=====================
rsi = ta.rsi(close, 14)
touchLower = ta.crossover(close, lower) or close <= lower
touchUpper = ta.crossunder(close, upper) or close >= upper
buyOK  = useRSI ? (touchLower and rsi <= rsiOS) : touchLower
sellOK = useRSI ? (touchUpper and rsi >= rsiOB) : touchUpper
plotshape(buyOK,  title="BUY",  location=location.belowbar, style=shape.labelup,
     text="BUY",  color=color.new(color.green, 0), textcolor=color.white, size=size.tiny, offset=0)
plotshape(sellOK, title="SELL", location=location.abovebar, style=shape.labeldown,
     text="SELL", color=color.new(color.red,   0), textcolor=color.white, size=size.tiny, offset=0)
// تنبيهات
alertcondition(buyOK,  title="BUY",  message="BUY signal: price touched/closed below lower band (RSI filter may apply).")
alertcondition(sellOK, title="SELL", message="SELL signal: price touched/closed above upper band (RSI filter may apply).")
10 EMA + 20 EMA + Previous Day High/Low (Day-Bounded)it gives the reand and also plot the day's lowest volume.it is very helpful in reversals
Mirpapa_Lib_DivergenceLibrary   "Mirpapa_Lib_Divergence" 
다이버전스 감지 및 시각화 라이브러리 (범용 설계)
 newPivot(bar, priceVal, indVal) 
  피벗 포인트 생성
  Parameters:
     bar (int) : 바 인덱스
     priceVal (float) : 가격
     indVal (float) : 지표값
  Returns: PivotPoint
 newDivSettings(pivotLen, maxStore, maxShow) 
  다이버전스 설정 생성
  Parameters:
     pivotLen (int) : 피벗 좌우 캔들
     maxStore (int) : 저장 개수
     maxShow (int) : 표시 라인 개수
  Returns: DivergenceSettings
 emptyDivResult() 
  빈 다이버전스 결과
  Returns: 감지 안 된 DivergenceResult
 checkPivotHigh(length, source) 
  고점 피벗 감지
  Parameters:
     length (int) : 좌우 비교 캔들 수
     source (float) : 비교할 데이터 (지표값)
  Returns: 피벗 값 또는 na
 checkPivotLow(length, source) 
  저점 피벗 감지
  Parameters:
     length (int) : 좌우 비교 캔들 수
     source (float) : 비교할 데이터 (지표값)
  Returns: 피벗 값 또는 na
 addPivotToArray(pivotArray, pivot, maxSize) 
  피벗을 배열에 추가 (FIFO 방식)
  Parameters:
     pivotArray (array) : 피벗 배열
     pivot (PivotPoint) : 추가할 피벗
     maxSize (int) : 최대 크기
 checkBullishDivergence(pivotArray) 
  상승 다이버전스 체크 (Bullish)
  Parameters:
     pivotArray (array) : 저점 피벗 배열
  Returns: DivergenceResult
 checkBearishDivergence(pivotArray) 
  하락 다이버전스 체크 (Bearish)
  Parameters:
     pivotArray (array) : 고점 피벗 배열
  Returns: DivergenceResult
 createDivLine(result, lineColor, isOverlay) 
  다이버전스 라인 생성
  Parameters:
     result (DivergenceResult) : DivergenceResult
     lineColor (color) : 라인 색상
     isOverlay (bool) : true면 가격 기준, false면 지표 기준
  Returns:  
 cleanupLines(lineArray, labelArray, maxLines) 
  오래된 라인/라벨 정리
  Parameters:
     lineArray (array) : 라인 배열
     labelArray (array) : 라벨 배열
     maxLines (int) : 최대 유지 개수
 addLineAndCleanup(lineArray, labelArray, newLine, newLabel, maxLines) 
  라인/라벨 추가 및 자동 정리
  Parameters:
     lineArray (array) : 라인 배열
     labelArray (array) : 라벨 배열
     newLine (line) : 새 라인
     newLabel (label) : 새 라벨
     maxLines (int) : 최대 개수
 PivotPoint 
  피벗 데이터 저장
  Fields:
     barIndex (series int) : 바 인덱스
     price (series float) : 종가
     indicatorValue (series float) : 지표값
 DivergenceSettings 
  다이버전스 설정
  Fields:
     pivotLength (series int) : 피벗 좌우 캔들 수
     maxPivotsStore (series int) : 저장할 최대 피벗 개수
     maxLinesShow (series int) : 표시할 최대 라인 개수
 DivergenceResult 
  다이버전스 감지 결과
  Fields:
     detected (series bool) : 다이버전스 감지 여부
     isBullish (series bool) : true면 상승, false면 하락
     bar1 (series int) : 첫 번째 피벗 바 인덱스
     value1_price (series float) : 첫 번째 가격
     value1_ind (series float) : 첫 번째 지표값
     bar2 (series int) : 두 번째 피벗 바 인덱스
     value2_price (series float) : 두 번째 가격
     value2_ind (series float) : 두 번째 지표값
No-Trade Zones UTC+7This indicator helps you visualize and backtest your preferred trading hours. For example, if you have a 9-to-5 job, you obviously can’t trade during that time — and when backtesting, you should avoid those hours too. It also marks weekends if you prefer not to trade on those days.
By highlighting no-trade periods directly on the chart, you can easily see when you shouldn’t be taking trades, without constantly checking the time or date by hovering over the chart. It makes backtesting smoother and more realistic for your personal schedule.
Mirpapa_Lib_MACDLibrary   "Mirpapa_Lib_MACD" 
MACD 계산 및 크로스 체크를 위한 라이브러리
 calc_smma(src, len) 
  SMMA (Smoothed Moving Average) 계산
  Parameters:
     src (float) : 소스 데이터
     len (simple int) : 길이
  Returns: SMMA 값
 calc_zlema(src, length) 
  ZLEMA (Zero Lag EMA) 계산
  Parameters:
     src (float) : 소스 데이터
     length (simple int) : 길이
  Returns: ZLEMA 값
 checkMacdCross(lengthMA, lengthSignal, src, enabled) 
  MACD 크로스오버 체크
  Parameters:
     lengthMA (simple int) : MACD 길이
     lengthSignal (int) : 시그널 길이
     src (float) : 소스 (기본값: hlc3)
     enabled (bool) : 계산 활성화 여부 (기본값: true)
  Returns: 
Cumulative Volume Library (plyst)Library   "CumulativeVolumeLib" 
 GetVolumeMetrics(lookback, calcType, useUSD, includeBybit, includeOKX, includeCoinbase, includeBitget, includeKucoin, includeKraken, includeMexc, includeGateio, includeHTX) 
  Parameters:
     lookback (simple int) 
     calcType (simple string) 
     useUSD (simple bool) 
     includeBybit (bool) 
     includeOKX (bool) 
     includeCoinbase (bool) 
     includeBitget (bool) 
     includeKucoin (bool) 
     includeKraken (bool) 
     includeMexc (bool) 
     includeGateio (bool) 
     includeHTX (bool)
Change% by Amit Multi-Period Returns Table 
This indicator displays percentage returns across multiple timeframes — 
1 Week, 
1 Month, 
3 Months, 
6 Months, 
12 Months.
This helps traders quickly assess short-term and long-term performance trends.
Positive returns are highlighted in blue, while negative returns are shown in red, allowing instant visual recognition of strength or weakness.
Ideal for spotting momentum shifts, relative performance, and trend consistency across different horizons.
Mirpapa_Lib_RenkoLibrary   "Mirpapa_Lib_Renko" 
Mirpapa Renko Library - HL2 기반 ATR 렌코 차트 생성 라이브러리
 get_renko(atr_period, atr_multiplier) 
  ATR 기반 렌코 차트 생성
  Parameters:
     atr_period (simple int) : ATR 계산 기간
     atr_multiplier (float) : ATR 승수 (박스 크기 조절)
  Returns:   렌코 캔들 OHLC 값
SuperBulls - Heiken Ashi StrategyA streamlined, trade-ready strategy from the SuperBulls universe that turns noisy charts into clear decisions. It combines a smoothed price view, adaptive momentum gating, and a dynamic support/resistance overlay so you can spot high-probability turns without overthinking every candle. Entries and exits are signalled visually and designed to work with simple position sizing — perfect for discretionary traders and systematic setups alike.
Why traders like it
Clean visual signals reduce analysis paralysis and speed up decision-making.
Built-in momentum filter helps avoid chop and chase only the stronger moves.
Dynamic S/R zones provide objective areas for targets and stop placement.
Works with simple risk rules — position sizing and pyramiding kept conservative by default.
Who it’s for
Traders who want a reliable, low-friction strategy to trade intraday or swing setups without rebuilding indicators from scratch. Minimal tuning required; plug in your size and let the SuperBulls logic do the heavy lifting.
Use it, don’t overfit it, and try not to blame the indicator when you ignore risk management.
MTF 20 SMA Table - DXY**MTF 20 SMA Table - Multi-Timeframe Trend Analysis Dashboard**
**Overview:**
This indicator provides a comprehensive multi-timeframe analysis dashboard that displays the relationship between price and the 20-period Simple Moving Average (SMA) across four key timeframes: 15-minute, 1-hour, 4-hour, and Daily. It's designed to help traders quickly identify trend alignment and potential trading opportunities across multiple timeframes at a glance.  It's definitely not perfect but has helped me speed up my backtesting efforts as it's worked well for me eliminating flipping back and forth between timeframes excpet when I have confluence on the table, then I check the HTF.
**How It Works:**
The indicator creates a table overlay on your chart showing three critical metrics for each timeframe:
1. **Price vs SMA (Row 1):** Shows whether price is currently above (bullish) or below (bearish) the 20 SMA
   - Green = Price Above SMA
   - Red = Price Below SMA
2. **SMA Direction (Row 2):** Indicates the trend direction of the SMA itself over a lookback period
   - Green (↗ Rising) = Uptrend
   - Red (↘ Falling) = Downtrend
   - Gray (→ Flat) = Ranging/Consolidation
3. **Strength (Row 3):** Displays the distance between current price and the SMA in pips
   - Purple background = Strong move (>50 pips away)
   - Orange background = Moderate move (20-50 pips)
   - Gray background = Weak/consolidating (<20 pips)
   - Text color: Green for positive distance, Red for negative
**Key Features:**
- **Customizable Table Position:** Place the table anywhere on your chart (9 position options)
- **Adjustable SMA Lengths:** Modify the SMA period for each timeframe independently (default: 20)
- **Direction Lookback Settings:** Fine-tune how far back the indicator looks to determine SMA direction for each timeframe
- **Flat Threshold:** Set the pip threshold for determining when an SMA is "flat" vs trending (default: 5 pips)
- **DXY Optimized:** Calculations are calibrated for the US Dollar Index (1 pip = 0.01)
**Best Use Cases:**
1. **Trend Alignment:** Identify when multiple timeframes align in the same direction for higher probability trades
2. **Divergence Spotting:** Detect when lower timeframes diverge from higher timeframes (potential reversals)
3. **Entry Timing:** Use lower timeframe signals while higher timeframes confirm overall trend
4. **Strength Assessment:** Gauge how extended price is from the mean (SMA) to avoid overextended entries
**Settings Guide:**
- **SMA Settings Group:** Adjust the SMA period for each timeframe (15M, 1H, 4H, Daily)
- **SMA Direction Group:** Control lookback periods to determine trend direction
  - 15M: Default 5 candles
  - 1H: Default 10 candles
  - 4H: Default 15 candles
  - Daily: Default 20 candles
- **Flat Threshold:** Set sensitivity for "flat" detection (lower = more sensitive to ranging markets)
**Trading Strategy Examples:**
1. **Trend Following:** Look for all timeframes showing the same direction (all green or all red)
2. **Pullback Trading:** When Daily/4H are green but 15M/1H show red, wait for lower timeframes to flip green for entry
3. **Ranging Markets:** When multiple SMAs show "flat", consider range-bound strategies
**Important Notes:**
- This is a reference tool only, not a standalone trading system
- Always use proper risk management and combine with other analysis methods
- Best suited for trending instruments like indices and major forex pairs
- Calculations are optimized for DXY but can be used on other instruments (pip calculations may need adjustment)
**Credits:**
Feel free to modify and improve this code! Suggestions for enhancements are welcome in the comments.
---
**Installation Instructions:**
1. Add the indicator to your TradingView chart
2. Adjust the table position via settings to avoid overlap with price action
3. Customize SMA lengths and lookback periods to match your trading style
4. Monitor the table for timeframe alignment and trend confirmation
---
This indicator is published as open source for the community to learn from and improve upon. Happy trading! 📈
Z-Score Bands + SignalsZ-Score Statistical Market Analyzer 
 A multi-dimensional market structure indicator based on standardized deviation & regime logic 
 English Description 
Concept
This indicator builds a statistical model of price behaviour by converting every candle’s movement into a Z-score — how many standard deviations each close is away from its moving average.
It visualizes the normal distribution structure of returns and provides adaptive entry signals for both Mean Reversion and Breakout regimes.
Rather than predicting price direction, it measures statistical displacement from equilibrium and dynamically adjusts the decision logic according to the market’s volatility regime.
⚙️ Main Components
Z-Score Bands (±1σ, ±2σ, ±3σ)
– The core structure visualizes volatility boundaries based on rolling mean and standard deviation.
– Price outside ±2σ often indicates statistical extremes.
Dual Signal Systems
Mean Reversion (MRL / MRS): when price (or return z-score) crosses back inside ±2σ bands.
Breakout (BOL / BOS): when price continues to expand beyond ±2σ.
Volatility Regime Classification
The indicator detects whether the market is currently in a low-vol or high-vol regime using percentile statistics of σ.
Low vol → Mean Reversion preferred
High vol → Breakout preferred
🧠  Adaptive Switches 
 
 A. Freeze MA/σ - Use previous-bar stats to avoid repainting and lag.	
 B. Confirm on Close - Only generate signals once the base-timeframe bar closes (eliminates look-ahead bias).	
 C. Return-based Signal - Use log-return Z-score instead of price deviation — normalizes volatility across assets.	
 D. Outlier Filter - Exclude bars with abnormal single-bar returns (e.g., >20%). Reduces false spikes.	
 E. Regime Gating - Automatically switch between Mean Reversion and Breakout logic depending on volatility percentile.
 	
Each module can be toggled individually to test different statistical behaviours or tailor to a specific market condition.
📊 Interpretation
When the histogram of returns approximates a normal distribution, mean-reversion logic is often more effective.
When price persistently drifts beyond ±2σ or ±3σ, the distribution becomes leptokurtic (fat-tailed) — a breakout structure dominates.
Hence, this tool can help you:
Identify whether an asset behaves more “Gaussian” or “fat-tailed”;
Select the correct trading regime (MR or BO);
Quantitatively measure market tension and volatility clusters.
🧩 Recommended Use
Works on any timeframe and any asset.
Best used on liquid instruments (e.g., XAU/USD, indices, major FX pairs).
Combine with volume, sentiment or structural filters to confirm signals.
For strategy automation, pair with the companion script:
🧠 “Z-Score Strategy • Multi-Source Confirm (MRL/MRS/BOL/BOS)”.
⚠️ Disclaimer
This script is designed for educational and research purposes.
Statistical deviation ≠ directional prediction — use with sound risk management.
Past distribution patterns may shift under new volatility regimes.
==================================================================================
 中文说明(简体) 
概念简介
该指标基于价格的统计分布原理,将每根 K 线的波动转化为标准化的 Z-Score(标准差偏离值),用于刻画市场处于均衡或偏离状态。
它同时支持 均值回归(Mean Reversion) 与 突破延展(Breakout) 两种逻辑,并可根据市场波动结构自动切换策略模式。
⚙️ 主要功能模块
Z-Score 通道(±1σ / ±2σ / ±3σ)
用滚动均值与标准差动态绘制的统计波动带,价格超出 ±2σ 区域通常意味着极端偏离。
双信号系统
MRL / MRS(均值回归多空):价格重新回到 ±2σ 以内时触发。
BOL / BOS(突破延展多空):价格持续运行在 ±2σ 之外时触发。
波动率分层
自动识别市场处于高波动还是低波动区间:
低波动期 → 适合均值回归逻辑;
高波动期 → 适合突破趋势逻辑。
🧠 A–E 模块说明
A. 固定统计参数:使用上一根 K 线的均值和标准差,防止重绘。	
B. 收盘确认信号:仅在当前时间框架收盘后生成信号,避免前视偏差。	
C. 收益率信号模式:采用对数收益率的 Z-Score,更具普适性。	
D. 异常波过滤:忽略单根极端波动(如 >20%)的噪声信号。	
E. 波动率调节逻辑:根据市场处于高/低波动区间,自动切换 MRL/MRS 或 BOL/BOS。
	
📊 应用解读
如果收益率分布接近正态分布 → 市场倾向震荡,MRL/MRS 效果较佳;
若价格频繁偏离 ±2σ 或 ±3σ → 市场呈现“肥尾”分布,趋势延展占主导。
因此,该指标的核心目标是:
识别当前市场的统计结构类型;
根据波动特征自动切换交易逻辑;
提供结构化、可量化的市场状态刻画。
💡 使用建议
适用于所有时间框架与金融品种。
建议结合成交量或结构性指标过滤。
若用于策略回测,可搭配同名 “Z-Score Strategy • Multi-Source Confirm” 策略脚本。
⚠️ 免责声明
本指标仅用于研究与教学,不构成任何投资建议。
统计偏离 ≠ 趋势预测,实际市场行为可能在不同波动结构下改变。
Auto Downtrend Lines (Close-Based + Large Labels) v6DTL by DonaldDuck
DTL by DonaldDuck
DTL by DonaldDuck
RSI Divergence 1-20 Candlesthis is a rsi divergence setup used to see where all divergenece is rsi is formed. so this will help to trade.
Technical Checklist_DTBasic Checklist table for bullish condition checks for ADX, RSI, VWAP , CPR, Supertrend
True Average PriceTrue Average Price 
 Overview 
The indicator plots a single line representing the cumulative average closing price of any symbol you choose. It lets you project a long-term mean onto your active chart, which is useful when your favourite symbol offers limited history but you still want context from an index or data-rich feed.
 How It Works 
The script retrieves all available historical bars from the selected symbol, sums their closes, counts the bars, and divides the totals to compute the lifetime average. That value is projected onto the chart you are viewing so you can compare current price action to the broader historical mean.
 Inputs 
 
 Use Symbol : Toggle on to select an alternate symbol; leave off to default to the current chart.
 Symbol : Pick the data source used for the average when the toggle is enabled.
 Line Color : Choose the display color of the average line.
 Line Width : Adjust the thickness of the plotted line. 
 
 Usage Tips 
 
 Apply the indicator to exchanges with shallow history while sourcing the average from a complete index (e.g.,  INDEX:BTCUSD  for crypto pairs).
 Experiment with different symbols to understand how alternative data feeds influence the baseline level. 
 
 Disclaimer 
This indicator is designed as a technical analysis tool and should be used in conjunction with other forms of analysis and proper risk management. 
Past performance does not guarantee future results, and traders should thoroughly test any strategy before implementing it with real capital.
Price Action Brooks ProPrice 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
RSI Divergence 1-20 Candlesthis is a good divergence candle indicator to show divergences in the candles.






















