Indicator

Valar PA ToolkitValar PA Toolkit (VPATK) 是一套为 Al Brooks 价格行为交易者打造的多合一工具箱,七个模块各司其职,均可独立开关和配色,轻量不遮挡裸K。
1. Gap Series 缺口系列 自动标记三种缺口并用色块填充:开盘缺口(相邻K线影线间)、影线缺口(隔一根K线)、实体缺口。每种缺口支持多空方向独立配色、互斥过滤(如实体缺口可排除影线缺口)和独立警报。缺口开着 = 强势,缺口关闭 = 转弱。
2. Bar Counter K线计数 自动检测 session 边界(K线间隔超30分钟视为新时段)并重新编号,仅显示当前时段。支持每隔 N 根显示、重点编号高亮(默认 18/40/60),完美适配 RTH 81-bar 结构定位(B1-18 开盘段 / B19-40 / B41-60 / B61-81 盘尾段)。
3. Moving Average 双EMA 两条独立 EMA,默认 5min 20EMA(蓝)+ 1h 20EMA(红),周期/时间级别/数据源/颜色全可调,时间级别留空则跟随图表。高时间级别数据缺失时自动续算不断线。
4. I & O Bar 内外包K线 标注 Inside Bar(i)、Outside Bar(o)及连续形态:ii/iii、oo/ooo、ioi。五种标注独立配色。IOI 确认后自动替换中间的 o。ii/oo/ioi 都是 Breakout Mode,预警即将突破。
5. BOFT 突破跟随 三根K线结构检测:二号K线收盘突破一号高/低点后,三号K线的跟随分强弱两档(收于二号实体极值内=弱,突破二号极值=强)。多空强弱四色箭头标记,可选背景染色和参考线。强跟随 = 突破大概率走出第二段。
6. CMP K线中点 在最近 N 根K线上画 50% 中点线。Al Brooks 认为 50% 回调是最重要的回调级别,前一根K线中点常是突破单/限价单的入场参考。
7. ATR 面板 右上角表格显示:当前周期 ATR、日线 ATR、前日 ATR、当日波幅。当当日波幅同时超过日线 ATR 和前日 ATR 时数值变红——当日该走的量已走完,警惕追在趋势末端(可挂警报)。
Description
Valar PA Toolkit (VPATK) is an all-in-one toolkit built for Al Brooks price action traders. Seven independent modules, each with its own toggles and colors, designed to stay lightweight and never clutter your naked chart.
1. Gap Series Automatically marks and fills three gap types: Opening Gaps (between adjacent bars), Wick Gaps (one bar apart), and Body Gaps. Each type supports separate bull/bear colors, mutual exclusion filters, and independent alerts. Open gap = strength; closed gap = weakening.
2. Bar Counter Detects session breaks (any gap over 30 minutes starts a new session) and renumbers bars from 1, showing the current session only. Configurable step display and highlighted key bars (default 18/40/60) — perfect for navigating the 81-bar RTH structure (B1-18 open / B19-40 / B41-60 / B61-81 close).
3. Moving Average Two independent EMAs, defaulting to 5min 20EMA (blue) + 1h 20EMA (red). Length, timeframe, source, and color are all adjustable; leave timeframe blank to follow the chart. Auto-continues calculation when higher-timeframe data is missing — no broken lines.
4. I & O Bar Marks Inside Bars (i), Outside Bars (o), and consecutive patterns: ii/iii, oo/ooo, ioi — each with its own color. When an ioi confirms, it automatically replaces the o on the middle bar. ii/oo/ioi are all Breakout Mode patterns signaling an imminent breakout.
5. BOFT (Breakout Follow Through) Three-bar structure detection: after Bar 2 closes beyond Bar 1's high/low, Bar 3's follow-through is graded weak (closes within Bar 2's range) or strong (closes beyond Bar 2's extreme). Four-color arrow markers for bull/bear × weak/strong, with optional background tint and reference lines. Strong follow-through = high odds of a second leg.
6. CMP (Candle Mid Point) Draws the 50% midpoint line on the last N bars. Al Brooks considers the 50% pullback the most important retracement level — the prior bar's midpoint is often the reference for stop/limit entries.
7. ATR Panel Top-right table showing: current TF ATR, daily ATR, previous daily ATR, and today's range. When today's range exceeds BOTH daily ATR and previous daily ATR, the value turns red — the day's expected move is done, don't chase the trend's end (alert included). Indicator

Indicator

aaaaaaaaaaa// ╔══════════════════════════════════════════════════════════════════════════════╗
// ║ SMC PRO — Smart Money Concepts (Supply & Demand + Volume Profile) ║
// ║ Pine Script v6 | Professional Indicator ║
// ║ ║
// ║ Phase 1: Automatic Supply & Demand Zones ║
// ║ Phase 2: Market Structure + Breakout Detection ║
// ║ Phase 3: Retest Confirmation + Long/Short Signals ║
// ║ Phase 4: Risk/Reward, SL, TP, and Alerts ║
// ║ Phase 5: Fixed Range Volume Profile (POC, VAH, VAL, HVN, LVN) ║
// ╚══════════════════════════════════════════════════════════════════════════════╝
//@version=6
indicator("SMC Pro — Supply & Demand + Volume Profile",
overlay = true,
max_boxes_count = 500,
max_lines_count = 500,
max_labels_count = 500,
max_bars_back = 5000)
// ─────────────────────────────────────────────────────────────────────────────
// INPUTS
// ─────────────────────────────────────────────────────────────────────────────
// Zone Detection
string GRP_ZONE = "Zone Detection"
i_pivotLen = input.int(5, "Pivot Length", minval=2, maxval=50, group=GRP_ZONE)
i_zoneAtrMult = input.float(0.5,"Zone Width (ATR ×)", minval=0.1, maxval=3.0, step=0.1, group=GRP_ZONE)
i_minTouches = input.int(2, "Min Touches for Signal", minval=1, maxval=10, group=GRP_ZONE)
i_maxZones = input.int(20, "Max Active Zones", minval=5, maxval=50, group=GRP_ZONE)
i_maxZoneAge = input.int(500, "Max Zone Age (bars)", minval=50, maxval=2000, group=GRP_ZONE)
// Breakout & Volume
string GRP_BO = "Breakout Detection"
i_volMult = input.float(1.5,"Volume Multiplier", minval=1.0, maxval=5.0, step=0.1, group=GRP_BO)
i_atrPeriod = input.int(14, "ATR Period", minval=5, maxval=50, group=GRP_BO)
i_volSmooth = input.int(20, "Volume SMA Length", minval=5, maxval=100, group=GRP_BO)
// Signals
string GRP_SIG = "Signal Filters"
i_minRR = input.float(2.0,"Minimum Risk:Reward", minval=1.0, maxval=10.0, step=0.5, group=GRP_SIG)
i_slBuffer = input.float(0.5,"SL Buffer (ATR ×)", minval=0.1, maxval=2.0, step=0.1, group=GRP_SIG)
i_maxRetestDist = input.int(100,"Max Retest Distance (bars)", minval=10, maxval=500, group=GRP_SIG)
i_noOppZoneDist = input.float(2.0,"No Opposite Zone Within (ATR ×)", minval=0.5, maxval=5.0, step=0.5, group=GRP_SIG)
// Volume Profile
string GRP_VP = "Volume Profile"
i_showVP = input.bool(true,"Show Volume Profile", group=GRP_VP)
i_vpLookback = input.int(200, "VP Lookback Bars", minval=50, maxval=500, group=GRP_VP)
i_vpRows = input.int(50, "VP Row Count", minval=20, maxval=100, group=GRP_VP)
i_vpWidth = input.int(20, "VP Width (bars)", minval=5, maxval=80, group=GRP_VP)
i_vaPercent = input.float(70.0,"Value Area %", minval=50.0,maxval=90.0, group=GRP_VP)
// Display
string GRP_DISP = "Display"
i_showZones = input.bool(true, "Show Zones", group=GRP_DISP)
i_showLabels = input.bool(true, "Show Labels", group=GRP_DISP)
i_showSLTP = input.bool(true, "Show SL/TP Lines", group=GRP_DISP)
i_showStructure = input.bool(true,"Show Market Structure", group=GRP_DISP)
// Colors
string GRP_CLR = "Colors"
i_demandColor = input.color(color.new(#26a69a, 75), "Demand Zone", group=GRP_CLR)
i_supplyColor = input.color(color.new(#ef5350, 75), "Supply Zone", group=GRP_CLR)
i_brokenColor = input.color(color.new(#787b86, 90), "Broken Zone", group=GRP_CLR)
i_pocColor = input.color(color.new(#ff9800, 0), "POC Line", group=GRP_CLR)
i_vahColor = input.color(color.new(#2196f3, 0), "VAH Line", group=GRP_CLR)
i_valColor = input.color(color.new(#2196f3, 0), "VAL Line", group=GRP_CLR)
i_buyVolColor = input.color(color.new(#26a69a, 40), "Buy Volume", group=GRP_CLR)
i_sellVolColor = input.color(color.new(#ef5350, 40), "Sell Volume", group=GRP_CLR)
i_longColor = input.color(color.new(#00c853, 0), "Long Signal", group=GRP_CLR)
i_shortColor = input.color(color.new(#ff1744, 0), "Short Signal", group=GRP_CLR)
// ─────────────────────────────────────────────────────────────────────────────
// TYPE DEFINITIONS
// ─────────────────────────────────────────────────────────────────────────────
type Zone
float top = na
float bottom = na
bool isSupply = false
int birthBar = 0
int touches = 0
float totalVol = 0.0
bool broken = false
int brokenBar = 0
int breakDir = 0 // +1 = broken upward, -1 = broken downward
bool retested = false
float strength = 0.0
box bx = na
type Signal
bool isLong = false
float entry = na
float sl = na
float tp = na
float rr = na
int sigBar = 0
// ─────────────────────────────────────────────────────────────────────────────
// GLOBAL VARIABLES
// ─────────────────────────────────────────────────────────────────────────────
var array zones = array.new()
// Market Structure
var float msSwingHi1 = na // most recent swing high
var float msSwingHi2 = na // previous swing high
var float msSwingLo1 = na // most recent swing low
var float msSwingLo2 = na // previous swing low
var int msBias = 0 // +1 bullish, -1 bearish, 0 neutral
// Signal flags (for alerts — must be global scope)
var bool sigLong = false
var bool sigShort = false
var bool sigBullBO = false
var bool sigBearBO = false
var bool sigRetest = false
var bool sigNewDemand = false
var bool sigNewSupply = false
// Volume Profile drawing storage
var array vpBoxes = array.new()
var array vpLines = array.new()
var array vpLabels = array.new()
// Computed values
float atrVal = ta.atr(i_atrPeriod)
float avgVol = ta.sma(volume, i_volSmooth)
float bodySize = math.abs(close - open)
// Reset per-bar signal flags
sigLong := false
sigShort := false
sigBullBO := false
sigBearBO := false
sigRetest := false
sigNewDemand := false
sigNewSupply := false
// ─────────────────────────────────────────────────────────────────────────────
// HELPER FUNCTIONS
// ─────────────────────────────────────────────────────────────────────────────
// Check if two zones overlap
zonesOverlap(float top1, float bot1, float top2, float bot2) =>
top1 >= bot2 and top2 >= bot1
// Calculate zone strength score (normalized 0–100)
calcStrength(int touches, float vol, float avgV, int age) =>
float touchScore = math.min(touches / 5.0, 1.0) * 40.0
float volScore = math.min(vol / (avgV * 10.0), 1.0) * 35.0
float ageScore = math.min(age / 200.0, 1.0) * 25.0
touchScore + volScore + ageScore
// Check if a nearby opposite zone exists
hasOppositeZoneNearby(bool checkAbove, float refPrice, float maxDist) =>
bool found = false
if zones.size() > 0
for i = 0 to zones.size() - 1
Zone z = zones.get(i)
if z.broken
continue
if checkAbove and z.isSupply and z.bottom - refPrice < maxDist and z.bottom > refPrice
found := true
break
if not checkAbove and not z.isSupply and refPrice - z.top < maxDist and z.top < refPrice
found := true
break
found
// Format price to string
fmtPrice(float price) =>
str.tostring(price, format.mintick)
// ─────────────────────────────────────────────────────────────────────────────
// PHASE 1: AUTOMATIC SUPPLY & DEMAND ZONES
// ─────────────────────────────────────────────────────────────────────────────
// ── 1a. Pivot Detection ──
float pivotHi = ta.pivothigh(high, i_pivotLen, i_pivotLen)
float pivotLo = ta.pivotlow(low, i_pivotLen, i_pivotLen)
// ── 1b. Create Supply Zone from Pivot High ──
if not na(pivotHi) and i_showZones
int pBar = bar_index - i_pivotLen
float zTop = high
float zBot = zTop - nz(atrVal) * i_zoneAtrMult
bool merged = false
// Merge with existing supply zone if overlapping
if zones.size() > 0
for i = 0 to zones.size() - 1
Zone z = zones.get(i)
if z.isSupply and not z.broken and zonesOverlap(zTop, zBot, z.top, z.bottom)
z.top := math.max(z.top, zTop)
z.bottom := math.min(z.bottom, zBot)
z.touches += 1
z.totalVol += nz(volume )
z.strength := calcStrength(z.touches, z.totalVol, nz(avgVol, 1), bar_index - z.birthBar)
if not na(z.bx)
z.bx.set_top(z.top)
z.bx.set_bottom(z.bottom)
merged := true
break
if not merged
Zone newZ = Zone.new()
newZ.top := zTop
newZ.bottom := zBot
newZ.isSupply := true
newZ.birthBar := pBar
newZ.touches := 1
newZ.totalVol := nz(volume )
newZ.strength := calcStrength(1, newZ.totalVol, nz(avgVol, 1), 1)
newZ.bx := box.new(left=pBar, top=zTop, right=bar_index + 20, bottom=zBot,
border_color=color.new(i_supplyColor, 50), border_width=1,
bgcolor=i_supplyColor, border_style=line.style_solid)
zones.push(newZ)
sigNewSupply := true
// ── 1c. Create Demand Zone from Pivot Low ──
if not na(pivotLo) and i_showZones
int pBar = bar_index - i_pivotLen
float zBot = low
float zTop = zBot + nz(atrVal) * i_zoneAtrMult
bool merged = false
if zones.size() > 0
for i = 0 to zones.size() - 1
Zone z = zones.get(i)
if not z.isSupply and not z.broken and zonesOverlap(zTop, zBot, z.top, z.bottom)
z.top := math.max(z.top, zTop)
z.bottom := math.min(z.bottom, zBot)
z.touches += 1
z.totalVol += nz(volume )
z.strength := calcStrength(z.touches, z.totalVol, nz(avgVol, 1), bar_index - z.birthBar)
if not na(z.bx)
z.bx.set_top(z.top)
z.bx.set_bottom(z.bottom)
merged := true
break
if not merged
Zone newZ = Zone.new()
newZ.top := zTop
newZ.bottom := zBot
newZ.isSupply := false
newZ.birthBar := pBar
newZ.touches := 1
newZ.totalVol := nz(volume )
newZ.strength := calcStrength(1, newZ.totalVol, nz(avgVol, 1), 1)
newZ.bx := box.new(left=pBar, top=zTop, right=bar_index + 20, bottom=zBot,
border_color=color.new(i_demandColor, 50), border_width=1,
bgcolor=i_demandColor, border_style=line.style_solid)
zones.push(newZ)
sigNewDemand := true
// ── 1d. Zone Maintenance: Extend, Touch Count, Age-out, Capacity ──
if zones.size() > 0
for i = zones.size() - 1 to 0
Zone z = zones.get(i)
// Remove zones that are too old
if bar_index - z.birthBar > i_maxZoneAge
if not na(z.bx)
z.bx.delete()
zones.remove(i)
continue
// Extend active zone boxes to the right
if not z.broken and not na(z.bx)
z.bx.set_right(bar_index + 20)
// Count touches on active zones (price approaches & rejects)
if not z.broken
if z.isSupply and high >= z.bottom and high <= z.top and close < z.bottom
z.touches += 1
z.totalVol += volume
if not z.isSupply and low <= z.top and low >= z.bottom and close > z.top
z.touches += 1
z.totalVol += volume
// Update strength
z.strength := calcStrength(z.touches, z.totalVol, nz(avgVol, 1), bar_index - z.birthBar)
// Enforce max zone count — remove weakest active zones
if zones.size() > i_maxZones
// Find and remove weakest non-broken zone
float weakest = 999999.0
int weakIdx = -1
for i = 0 to zones.size() - 1
Zone z = zones.get(i)
if not z.broken and z.strength < weakest
weakest := z.strength
weakIdx := i
if weakIdx >= 0
Zone wz = zones.get(weakIdx)
if not na(wz.bx)
wz.bx.delete()
zones.remove(weakIdx)
// ─────────────────────────────────────────────────────────────────────────────
// PHASE 2: MARKET STRUCTURE + BREAKOUT DETECTION
// ─────────────────────────────────────────────────────────────────────────────
// ── 2a. Market Structure ──
if not na(pivotHi)
msSwingHi2 := msSwingHi1
msSwingHi1 := pivotHi
if not na(pivotLo)
msSwingLo2 := msSwingLo1
msSwingLo1 := pivotLo
// Determine bias
bool isHH = not na(msSwingHi1) and not na(msSwingHi2) and msSwingHi1 > msSwingHi2
bool isHL = not na(msSwingLo1) and not na(msSwingLo2) and msSwingLo1 > msSwingLo2
bool isLH = not na(msSwingHi1) and not na(msSwingHi2) and msSwingHi1 < msSwingHi2
bool isLL = not na(msSwingLo1) and not na(msSwingLo2) and msSwingLo1 < msSwingLo2
if isHH and isHL
msBias := 1
else if isLH and isLL
msBias := -1
else
msBias := 0
// Structure label on pivots
if i_showStructure and not na(pivotHi)
string sLabel = isHH ? "HH" : isLH ? "LH" : "SH"
color sColor = isHH ? i_longColor : isLH ? i_shortColor : color.gray
label.new(bar_index - i_pivotLen, high , sLabel,
style=label.style_label_down, color=color.new(sColor, 80),
textcolor=sColor, size=size.tiny)
if i_showStructure and not na(pivotLo)
string sLabel = isHL ? "HL" : isLL ? "LL" : "SL"
color sColor = isHL ? i_longColor : isLL ? i_shortColor : color.gray
label.new(bar_index - i_pivotLen, low , sLabel,
style=label.style_label_up, color=color.new(sColor, 80),
textcolor=sColor, size=size.tiny)
// ── 2b. Breakout Detection ──
bool volFilter = volume > avgVol * i_volMult
bool bodyFilter = bodySize > nz(atrVal)
if zones.size() > 0
for i = 0 to zones.size() - 1
Zone z = zones.get(i)
if z.broken
continue
// Bullish breakout: close above supply zone with confirmation
if z.isSupply and close > z.top and volFilter and bodyFilter
z.broken := true
z.brokenBar := bar_index
z.breakDir := 1
if not na(z.bx)
z.bx.set_bgcolor(i_brokenColor)
z.bx.set_border_color(color.new(i_brokenColor, 50))
z.bx.set_right(bar_index)
sigBullBO := true
if i_showLabels
label.new(bar_index, low, "BO▲",
style=label.style_label_up, color=color.new(i_longColor, 60),
textcolor=i_longColor, size=size.small)
// Bearish breakout: close below demand zone with confirmation
if not z.isSupply and close < z.bottom and volFilter and bodyFilter
z.broken := true
z.brokenBar := bar_index
z.breakDir := -1
if not na(z.bx)
z.bx.set_bgcolor(i_brokenColor)
z.bx.set_border_color(color.new(i_brokenColor, 50))
z.bx.set_right(bar_index)
sigBearBO := true
if i_showLabels
label.new(bar_index, high, "BO▼",
style=label.style_label_down, color=color.new(i_shortColor, 60),
textcolor=i_shortColor, size=size.small)
// ─────────────────────────────────────────────────────────────────────────────
// PHASE 3: RETEST CONFIRMATION + LONG/SHORT SIGNALS
// ─────────────────────────────────────────────────────────────────────────────
if zones.size() > 0
for i = 0 to zones.size() - 1
Zone z = zones.get(i)
if not z.broken or z.retested
continue
// Skip if breakout too old
if bar_index - z.brokenBar > i_maxRetestDist
continue
// Must be at least 2 bars after breakout for retest to form
if bar_index - z.brokenBar < 2
continue
// ── Bullish Retest (supply broken upward → now demand) ──
if z.breakDir == 1
// Previous bar: wick dipped into zone, closed above zone
bool prevRetest = low <= z.top and low >= z.bottom and close > z.top
// Current bar: bullish confirmation
bool confirm = close > open and close > close
bool volOK = volume > avgVol
bool structOK = msBias >= 0
if prevRetest and confirm and volOK and structOK
float entry = close
float sl = z.bottom - nz(atrVal) * i_slBuffer
float risk = entry - sl
float tp = entry + risk * i_minRR
float rr = risk > 0 ? (tp - entry) / risk : 0.0
// Check no supply zone nearby above
bool noOppZone = not hasOppositeZoneNearby(true, entry, nz(atrVal) * i_noOppZoneDist)
if risk > 0 and rr >= i_minRR and noOppZone and z.touches >= i_minTouches
z.retested := true
sigRetest := true
sigLong := true
// Draw entry arrow
label.new(bar_index, low, "▲ LONG " + fmtPrice(entry),
style=label.style_label_up, color=i_longColor,
textcolor=color.white, size=size.normal)
if i_showSLTP
// SL line
line.new(bar_index, sl, bar_index + 20, sl,
color=i_shortColor, width=1, style=line.style_dashed)
label.new(bar_index + 20, sl, "SL " + fmtPrice(sl),
style=label.style_label_left, color=color.new(i_shortColor, 70),
textcolor=i_shortColor, size=size.tiny)
// TP line
line.new(bar_index, tp, bar_index + 20, tp,
color=i_longColor, width=1, style=line.style_dashed)
label.new(bar_index + 20, tp, "TP " + fmtPrice(tp) + " (" + str.tostring(rr, "#.#") + "R)",
style=label.style_label_left, color=color.new(i_longColor, 70),
textcolor=i_longColor, size=size.tiny)
// Entry line
line.new(bar_index, entry, bar_index + 20, entry,
color=i_longColor, width=2, style=line.style_solid)
// ── Bearish Retest (demand broken downward → now supply) ──
if z.breakDir == -1
// Previous bar: wick pushed into zone, closed below zone
bool prevRetest = high >= z.bottom and high <= z.top and close < z.bottom
// Current bar: bearish confirmation
bool confirm = close < open and close < close
bool volOK = volume > avgVol
bool structOK = msBias <= 0
if prevRetest and confirm and volOK and structOK
float entry = close
float sl = z.top + nz(atrVal) * i_slBuffer
float risk = sl - entry
float tp = entry - risk * i_minRR
float rr = risk > 0 ? (sl - entry) / risk * i_minRR : 0.0
bool noOppZone = not hasOppositeZoneNearby(false, entry, nz(atrVal) * i_noOppZoneDist)
if risk > 0 and rr >= i_minRR and noOppZone and z.touches >= i_minTouches
z.retested := true
sigRetest := true
sigShort := true
label.new(bar_index, high, "▼ SHORT " + fmtPrice(entry),
style=label.style_label_down, color=i_shortColor,
textcolor=color.white, size=size.normal)
if i_showSLTP
line.new(bar_index, sl, bar_index + 20, sl,
color=i_shortColor, width=1, style=line.style_dashed)
label.new(bar_index + 20, sl, "SL " + fmtPrice(sl),
style=label.style_label_left, color=color.new(i_shortColor, 70),
textcolor=i_shortColor, size=size.tiny)
line.new(bar_index, tp, bar_index + 20, tp,
color=i_longColor, width=1, style=line.style_dashed)
label.new(bar_index + 20, tp, "TP " + fmtPrice(tp) + " (" + str.tostring(i_minRR, "#.#") + "R)",
style=label.style_label_left, color=color.new(i_longColor, 70),
textcolor=i_longColor, size=size.tiny)
line.new(bar_index, entry, bar_index + 20, entry,
color=i_shortColor, width=2, style=line.style_solid)
// ─────────────────────────────────────────────────────────────────────────────
// PHASE 4: SIGNAL INFO TABLE
// ─────────────────────────────────────────────────────────────────────────────
// Structure bias bar color (subtle background)
barcolor(i_showStructure ? (msBias == 1 ? color.new(i_longColor, 90) : msBias == -1 ? color.new(i_shortColor, 90) : na) : na)
// Info table on last bar
if barstate.islast
var table infoTbl = table.new(position.top_right, 2, 5,
bgcolor=color.new(#1e222d, 10), border_width=1, border_color=color.new(color.gray, 70))
string biasText = msBias == 1 ? "BULLISH" : msBias == -1 ? "BEARISH" : "NEUTRAL"
color biasClr = msBias == 1 ? i_longColor : msBias == -1 ? i_shortColor : color.gray
int activeCount = 0
int brokenCount = 0
if zones.size() > 0
for i = 0 to zones.size() - 1
if zones.get(i).broken
brokenCount += 1
else
activeCount += 1
infoTbl.cell(0, 0, "SMC PRO", text_color=color.white, text_size=size.small, bgcolor=color.new(#363a45, 0))
infoTbl.cell(1, 0, "", bgcolor=color.new(#363a45, 0))
infoTbl.cell(0, 1, "Structure", text_color=color.gray, text_size=size.tiny)
infoTbl.cell(1, 1, biasText, text_color=biasClr, text_size=size.tiny)
infoTbl.cell(0, 2, "Active Zones", text_color=color.gray, text_size=size.tiny)
infoTbl.cell(1, 2, str.tostring(activeCount), text_color=color.white, text_size=size.tiny)
infoTbl.cell(0, 3, "Broken Zones", text_color=color.gray, text_size=size.tiny)
infoTbl.cell(1, 3, str.tostring(brokenCount), text_color=color.white, text_size=size.tiny)
infoTbl.cell(0, 4, "ATR", text_color=color.gray, text_size=size.tiny)
infoTbl.cell(1, 4, fmtPrice(nz(atrVal)), text_color=color.white, text_size=size.tiny)
// ─────────────────────────────────────────────────────────────────────────────
// PHASE 5: FIXED RANGE VOLUME PROFILE
// ─────────────────────────────────────────────────────────────────────────────
if barstate.islast and i_showVP
// ── 5a. Cleanup previous VP drawings ──
if vpBoxes.size() > 0
for i = vpBoxes.size() - 1 to 0
box b = vpBoxes.get(i)
if not na(b)
b.delete()
vpBoxes.clear()
if vpLines.size() > 0
for i = vpLines.size() - 1 to 0
line l = vpLines.get(i)
if not na(l)
l.delete()
vpLines.clear()
if vpLabels.size() > 0
for i = vpLabels.size() - 1 to 0
label lb = vpLabels.get(i)
if not na(lb)
lb.delete()
vpLabels.clear()
// ── 5b. Calculate price range ──
int lookback = math.min(i_vpLookback, bar_index)
float rangeHi = ta.highest(high, lookback)
float rangeLo = ta.lowest(low, lookback)
float rowH = (rangeHi - rangeLo) / i_vpRows
if rowH > 0
// ── 5c. Accumulate volume per row ──
array buyVol = array.new(i_vpRows, 0.0)
array sellVol = array.new(i_vpRows, 0.0)
for b = 0 to lookback - 1
float bHi = high
float bLo = low
float bVol = nz(volume )
bool isBuy = close >= open
int startRow = math.max(0, math.floor((bLo - rangeLo) / rowH))
int endRow = math.min(i_vpRows - 1, math.floor((bHi - rangeLo) / rowH))
if endRow >= startRow
int numRows = endRow - startRow + 1
float volPerRow = bVol / numRows
for r = startRow to endRow
if isBuy
buyVol.set(r, buyVol.get(r) + volPerRow)
else
sellVol.set(r, sellVol.get(r) + volPerRow)
// ── 5d. Find POC, max volume, VAH, VAL ──
float maxVol = 0.0
int pocRow = 0
float totalVol = 0.0
array totalPerRow = array.new(i_vpRows, 0.0)
for r = 0 to i_vpRows - 1
float rv = buyVol.get(r) + sellVol.get(r)
totalPerRow.set(r, rv)
totalVol += rv
if rv > maxVol
maxVol := rv
pocRow := r
// Value Area calculation — expand outward from POC until vaPercent reached
float vaTarget = totalVol * i_vaPercent / 100.0
float vaSum = totalPerRow.get(pocRow)
int vaHiRow = pocRow
int vaLoRow = pocRow
for _step = 0 to i_vpRows - 1
if vaSum >= vaTarget
break
float aboveVol = vaHiRow < i_vpRows - 1 ? totalPerRow.get(vaHiRow + 1) : 0.0
float belowVol = vaLoRow > 0 ? totalPerRow.get(vaLoRow - 1) : 0.0
if aboveVol >= belowVol and vaHiRow < i_vpRows - 1
vaHiRow += 1
vaSum += aboveVol
else if vaLoRow > 0
vaLoRow -= 1
vaSum += belowVol
else if vaHiRow < i_vpRows - 1
vaHiRow += 1
vaSum += aboveVol
else
break
float pocPrice = rangeLo + (pocRow + 0.5) * rowH
float vahPrice = rangeLo + (vaHiRow + 1) * rowH
float valPrice = rangeLo + vaLoRow * rowH
// ── 5e. Draw histogram ──
int vpLeftBar = bar_index + 5
float volScale = maxVol > 0 ? i_vpWidth / maxVol : 0.0
for r = 0 to i_vpRows - 1
float rowBot = rangeLo + r * rowH
float rowTop = rowBot + rowH
float bv = buyVol.get(r)
float sv = sellVol.get(r)
float tv = bv + sv
if tv > 0
int totalWidth = math.max(1, math.round(tv * volScale))
int buyWidth = math.max(0, math.round(bv * volScale))
int sellWidth = totalWidth - buyWidth
// Buy volume box
if buyWidth > 0
box bxBuy = box.new(vpLeftBar, rowTop, vpLeftBar + buyWidth, rowBot,
border_color=color.new(i_buyVolColor, 70), border_width=0,
bgcolor=i_buyVolColor)
vpBoxes.push(bxBuy)
// Sell volume box (stacked after buy)
if sellWidth > 0
box bxSell = box.new(vpLeftBar + buyWidth, rowTop, vpLeftBar + buyWidth + sellWidth, rowBot,
border_color=color.new(i_sellVolColor, 70), border_width=0,
bgcolor=i_sellVolColor)
vpBoxes.push(bxSell)
// Highlight HVN / LVN
bool isHVN = tv > totalVol / i_vpRows * 1.5
bool isLVN = tv < totalVol / i_vpRows * 0.5
// HVN: subtle bright border
if isHVN and totalWidth > 2
box bxHVN = box.new(vpLeftBar, rowTop, vpLeftBar + totalWidth, rowBot,
border_color=color.new(color.white, 70), border_width=1,
bgcolor=color.new(color.white, 97))
vpBoxes.push(bxHVN)
// ── 5f. Draw POC, VAH, VAL lines ──
int lineRight = vpLeftBar + i_vpWidth + 5
line pocLine = line.new(bar_index - lookback, pocPrice, lineRight, pocPrice,
color=i_pocColor, width=2, style=line.style_solid)
vpLines.push(pocLine)
line vahLine = line.new(bar_index - lookback, vahPrice, lineRight, vahPrice,
color=i_vahColor, width=1, style=line.style_dashed)
vpLines.push(vahLine)
line valLine = line.new(bar_index - lookback, valPrice, lineRight, valPrice,
color=i_valColor, width=1, style=line.style_dashed)
vpLines.push(valLine)
// Labels
label pocLbl = label.new(lineRight, pocPrice, "POC " + fmtPrice(pocPrice),
style=label.style_label_left, color=color.new(i_pocColor, 70),
textcolor=i_pocColor, size=size.tiny)
vpLabels.push(pocLbl)
label vahLbl = label.new(lineRight, vahPrice, "VAH " + fmtPrice(vahPrice),
style=label.style_label_left, color=color.new(i_vahColor, 70),
textcolor=i_vahColor, size=size.tiny)
vpLabels.push(vahLbl)
label valLbl = label.new(lineRight, valPrice, "VAL " + fmtPrice(valPrice),
style=label.style_label_left, color=color.new(i_valColor, 70),
textcolor=i_valColor, size=size.tiny)
vpLabels.push(valLbl)
// ─────────────────────────────────────────────────────────────────────────────
// ALERTS
// ─────────────────────────────────────────────────────────────────────────────
alertcondition(sigNewDemand, title="New Demand Zone", message="SMC PRO: New Demand (Support) Zone detected")
alertcondition(sigNewSupply, title="New Supply Zone", message="SMC PRO: New Supply (Resistance) Zone detected")
alertcondition(sigBullBO, title="Bullish Breakout", message="SMC PRO: Bullish Breakout — price closed above supply zone with volume confirmation")
alertcondition(sigBearBO, title="Bearish Breakout", message="SMC PRO: Bearish Breakout — price closed below demand zone with volume confirmation")
alertcondition(sigRetest, title="Successful Retest", message="SMC PRO: Successful Retest confirmed at broken zone")
alertcondition(sigLong, title="Long Entry", message="SMC PRO: LONG Entry — breakout + retest + confirmation + volume + structure aligned")
alertcondition(sigShort, title="Short Entry", message="SMC PRO: SHORT Entry — breakout + retest + confirmation + volume + structure aligned")
// ─────────────────────────────────────────────────────────────────────────────
// END
// ─────────────────────────────────────────────────────────────────────────────
Indicator

FIROZ RSI MACD SIGNAL//@version=6
indicator("FIROZ RSI MACD SIGNAL", overlay=true)
//====================
// INPUTS
//====================
rsiLength = input.int(14, title="RSI Length")
rsiOB = input.int(70, title="RSI Overbought")
rsiOS = input.int(30, title="RSI Oversold")
fastLen = input.int(12, title="MACD Fast")
slowLen = input.int(26, title="MACD Slow")
signalLen = input.int(9, title="MACD Signal")
//====================
// RSI
//====================
rsi = ta.rsi(close, rsiLength)
//====================
// MACD
//====================
= ta.macd(close, fastLen, slowLen, signalLen)
//====================
// BUY / SELL
//====================
buySignal = ta.crossover(hist, 0) and ta.crossover(rsi, rsiOS)
sellSignal = ta.crossunder(hist, 0) and ta.crossunder(rsi, rsiOB)
//====================
// TREND
//====================
trend = hist >= 0 ? "Bullish" : "Bearish"
//====================
// CONFIDENCE
//====================
int confidence = 60
if buySignal
confidence := 95
else if sellSignal
confidence := 95
else if hist > 0 and rsi > 50
confidence := 80
else if hist < 0 and rsi < 50
confidence := 80
else
confidence := 60
//====================
// BUY LABEL
//====================
plotshape(
buySignal,
title="BUY",
style=shape.labelup,
location=location.belowbar,
color=color.green,
text="BUY",
textcolor=color.white)
//====================
// SELL LABEL
//====================
plotshape(
sellSignal,
title="SELL",
style=shape.labeldown,
location=location.abovebar,
color=color.red,
text="SELL",
textcolor=color.white)
//====================
// CONFIDENCE LABEL
//====================
if barstate.islast
label.new(
bar_index,
high,
"Trend : " + trend +
" Confidence : " + str.tostring(confidence) + "%" +
" RSI : " + str.tostring(math.round(rsi)) +
" MACD Hist : " + str.tostring(hist, "#.##"),
style=label.style_label_left,
color=trend == "Bullish" ? color.green : color.red,
textcolor=color.white)
//====================
// ALERTS
//====================
alertcondition(buySignal, title="BUY Alert", message="FIROZ BUY Signal")
alertcondition(sellSignal, title="SELL Alert", message="FIROZ SELL Signal") Indicator

Days of the Week Days of the Week Separators
This indicator provides a clean and customisable way to distinguish each trading day on an intraday chart. It places a vertical separator at the beginning of every enabled day and displays the corresponding weekday label in the centre of that day’s trading period.The day label is positioned above the developing daily high and automatically moves higher if a new high is established. This keeps the label clear of price action while maintaining a consistent and uncluttered chart layout.
The indicator can help traders:
• Distinguish individual trading days quickly
• Review how price developed throughout the trading week
• Identify daily market structure and directional progression
• Analyse day-to-day changes in volatility and momentum
• Locate the beginning of each new trading day
• Maintain a clearer chart when studying intraday price action
Default configuration
• Days displayed: Monday to Friday
• Day boundary: 00:00
• Time zone: Europe/London
• Separator style: Dashed
• Separator width: 1
• Label position: Halfway through each day
• Label style: Centred rectangle
• Display timeframes: Intraday charts only
The Europe/London time-zone setting automatically follows changes between Greenwich Mean Time and British Summer Time. The day-start hour and minute can also be changed to accommodate alternative trading-day definitions or different market methodologies.
Customisable settings
Users can:
• Enable or disable individual weekdays
• Change the day-start hour and minute
• Select a preferred time zone
• Show or hide the vertical separators
• Change the separator colour, width and style
• Choose between dashed, dotted and solid lines
• Show or hide the weekday labels
• Adjust the horizontal position of the labels
• Change the label colour, text colour, opacity and size
• Adjust the distance between each label and its daily high
• Enable or disable the restriction for daily and higher timeframes
Label behaviour
Each weekday label is positioned according to the selected number of hours after the beginning of the trading day. The default value of 12 places it halfway between the two daily separators. The label’s vertical position is calculated using the developing daily high and an ATR-based offset. If price establishes a new high during the day, the label moves upward automatically to remain above the price action. The offset can be increased or reduced from the settings.
Timeframe behaviour
The indicator is designed specifically for intraday analysis. By default, it automatically hides on the 1D timeframe and above, as daily separators provide limited value on daily, weekly and monthly charts. This restriction can be disabled from the settings if required.
Important information
On instruments with continuous or highly liquid intraday trading, the separator should appear at the selected day-start time. If no candle is available at that exact time because of a market closure, trading break or missing data, the separator will appear on the first available candle belonging to the new trading day.
This indicator is intended as a chart-organisation and market-context tool. It does not generate independent entry or exit signals. Indicator

Indicator

Indicator

Systematic Deviation HarvesterThe Systematic Deviation Harvester is a structural asset accumulation engine designed to exploit extreme peak-to-trough price dislocations. Instead of relying on mathematical oscillators or moving averages, this strategy isolates pure structural alpha by measuring real-time percentage contractions from a rolling annual high-water mark.
Operating strictly on a daily resolution, the system treats deep market corrections as mathematical discounts, mechanically scaling into assets during cascading sell-offs and liquidating the aggregate basket via a unified trailing profit target.
🏛️ Core Algorithmic Pillars
1. Trailing High-Water Mark Engine
The system maintains a rolling, state-retaining benchmark of the asset's structural peak.
- Annual Anchor: At the open of the first trading bar of each calendar year, the benchmark resets to prevent structural anchoring bias.
- Peak Registration: If the market prints a higher high during the year, the benchmark dynamically adjusts to the new ceiling, resetting the downside calculation logic.
2. Asymmetric Scale-In Matrix
When market panic drives price away from the annual ceiling, the engine deploys capital across two independent structural tiers. While the strategy permits position stacking over time, an internal state machine prevents over-exposure or execution spam:
- Alpha 1 Allocation (Minor Drop): Triggers an initial capital deployment (e.g., 5% of account equity) when price crosses the secondary correction threshold.
- Alpha 2 Allocation (Major Drop): Triggers a heavier, secondary capital deployment (e.g., 10% of account equity) only if a systemic liquidation cascades into deep discount territory.
3. State Interlocks & Re-Armament Handlers
To prevent the engine from repeatedly buying into a declining market on consecutive bars, the strategy utilizes strict execution flags (minor_triggered and major_triggered). Once a tier is filled, it is locked. The engine governs its multi-cycle stacking through two user-selectable reset rules:
- Clean Slate Mode (Standard): Entry flags remain completely locked until a trailing exit is achieved and total position exposure reads exactly zero. Once flat, the entry flags clear for a fresh cycle.
- Rally Reset Mode (Optional): Clears the entry locks mid-cycle if the market stages a significant recovery rally from its local bottom (e.g., drawdown shrinks back to 1%). This allows the engine to unlock the entry tiers and stack new positions if the market rolls over again before hitting a full profit take.
4. The Omega Master Exit
Position liquidation is never managed on an individual trade level. Instead, the strategy treats the compounded portfolio as a unified basket:
- Composite Average Price Tracker: The engine continuously tracks the volume-weighted average cost base across all active scale-in tiers.
- Tick-Precision Trailing Stop: Once the market rallies past a specified percentage above the composite average cost, the engine activates a trailing stop. It converts percentage parameters into discrete price ticks (syminfo.mintick) to trail the macro-recovery, capturing maximum extension while protecting capital against sudden re-tests of the lows.
⚙️ Interface Parameters & Customization
- Drawdown Thresholds: User-definable percentage boundaries for minor/major entry triggers and recovery reset thresholds.
- True Compounding Sizing: Dynamic capital sizing that computes exact share counts based on real-time equity fluctuations rather than static cash values.
- Unified Compounding Exit: Custom configurations for trailing activation thresholds and peak-to-exit retraction steps.
🚀 Setup & Deployment Guide
1. Timeframe Selection: Open a clean chart and explicitly set the resolution to Daily (1D).
2. Apply Engine: Add the script to your chart. The baseline metrics are pre-configured for broad market index equity tracking.
3. Calibrate Thresholds: Open the inputs settings panel. For high-volatility large-caps, expand the Minor Drop and Major Drop fields proportionally to accommodate wider structural swings.
4. Select Risk Profile: Choose your exposure rule. Toggle Enable Rally Reset Rule ON for aggressive, high-frequency compounding, or leave it OFF for conservative, single-cycle wave trading.
📊 Methodological Constraints (Read Before Backtesting)
- Timeframe Enforced: Designed and structurally locked to the Daily (1D) interval. Intraday testing will render calculation flags inactive.
- Backtest Fidelity: Built using process_orders_on_close = true. This prevents the "look-ahead" backtesting bias common in default script architectures by ensuring orders are strictly filled at the confirmed closing print of a daily candle.
🏁
The Systematic Deviation Harvester is engineered strictly for high-conviction, structural bull-market assets that exhibit long-term macro growth profiles. Because the architecture relies entirely on scaling into deep price contractions relative to annual benchmarks, its structural alpha depends heavily on the underlying asset eventually recovering and charting new highs. It should be deployed exclusively on resilient, secularly expanding markets, such as major index ETFs or high-conviction large-cap equities, where deep corrections represent clear mathematical discounts rather than terminal structural decay. Strategy

Directional Volume Shapes (Zeiierman)█ Overview
Directional Volume Shapes (Zeiierman) is a regime-classification oscillator that reframes volume analysis around a different question: not simply “how much volume traded,” but “what statistical shape has directional pressure been forming, and which way is it leaning?”
Instead of plotting raw buy and sell volume bar by bar, the indicator scores each candle for directional pressure using a triangular intrabar distribution model. It collects those scores in a rolling window, classifies the pattern into one of seven distribution shapes, and displays a smooth synthetic template of the detected shape.
The result is less like a traditional volume indicator and more like a distribution-regime display, showing the type of pressure environment currently developing.
⚪ Why Is This One Unique?
Most volume tools show exactly what happened: green bar up, red bar down, and taller bar equals more volume. This indicator uses a two-stage process: classify, then synthesize.
It combines:
• A triangular CDF candle scorer that estimates directional pressure from OHLC data
• A rolling shape classifier using skewness, Gaussian-smoothed peak detection, and time correlation
• Seven possible classifications: Bell, Right-skewed, Left-skewed, J-shaped, Reverse-J, Bimodal, and Multimodal
• A template generator that displays an idealized mathematical version of the active shape
• A separate EMA-based polarity engine that controls bullish or bearish direction
█ How It Works
⚪ 1. Scores Each Candle’s Directional Pressure
Instead of using a simple “close above open equals bullish” rule, the indicator models the candle’s high-low range as a triangular probability distribution centered at the close.
The scr() function evaluates the candle’s full OHLC structure and returns a value between 0 and 1. That result is then converted into a signed pressure score between -1 and +1.
dm = scr(open, high, low, close)
ps = 2.0 * dm - 1.0
Values near +1 represent stronger bullish pressure, while values near -1 represent stronger bearish pressure. Values near zero indicate a more balanced candle.
⚪ 2. Optionally Weights Pressure by Volume
When Volume Weighting is enabled, the pressure score is multiplied by raw volume.
src = vw ? volume * ps : ps
This gives high-volume bars more influence over the rolling shape-classification window. When disabled, the classifier uses directional pressure alone.
Volume still controls the height of the plotted columns regardless of this setting.
⚪ 3. Classifies Pressure Shape, Not Direction
The indicator stores recent pressure values in a rolling window. Before classification, it converts each value into its absolute magnitude.
for i = 0 to buf.size() - 1
mag.set(i, math.abs(buf.get(i)))
Using math.abs() removes bullish and bearish direction from the classification stage. The classifier analyzes how pressure strength has been distributed, not which direction it points.
It measures:
• Skewness in the raw pressure magnitudes
• Local peaks in a Gaussian-smoothed version of the data
• Whether pressure strength is generally increasing or decreasing through time
The final shape is selected using a fixed priority order:
if peaks >= 2
out := peaks == 2 ? "Bimodal" : "Multimodal"
else if corr > 0.5
out := "J-shaped"
else if corr < -0.5
out := "Reverse-J"
else if skew > 0.1
out := "Right-skewed"
else if skew < -0.1
out := "Left-skewed"
else
out := "Bell"
Multiple peaks are checked first, followed by rising or falling behavior, then skewness. Bell is used when no other condition is detected.
⚪ 4. Requires Persistence Before Changing Shapes
The active shape changes only after five consecutive bars produce a classification different from the shape currently displayed.
if ns != sh
sc += 1
else
sc := 0
if sc >= 5
sh := ns
ph := 0.0
sc := 0
The five classifications do not need to match each other. They only need to differ from the current active shape.
When the fifth differing classification arrives, the indicator switches to that bar’s shape and restarts the template cycle.
⚪ 5. Tracks Polarity Separately
Bullish or bearish polarity is calculated independently from the shape classification.
A short EMA is applied to the original signed pressure score:
pr = ta.ema(ps, pl)
string np = pr >= 0 ? "Bull" : "Bear"
When the EMA is above or equal to zero, polarity is Bull. When it is below zero, polarity is Bear.
Because polarity can change as soon as the EMA crosses zero, it usually reacts faster than the shape classifier.
⚪ 6. Displays a Synthetic Shape Template
Once a shape is selected, the indicator does not plot the original pressure values.
Instead, it generates an idealized mathematical template for the active shape. For example, Bell uses a Gaussian curve, J-shaped uses a squared rising curve, and Bimodal combines two separate Gaussian peaks.
The generated template is then scaled by recent average volume and signed according to polarity.
p = pol == "Bull" ? ph : 1.0 - ph
tv = tpl(sh, p)
sgn = pol == "Bull" ? 1.0 : -1.0
amp = ta.sma(volume, 3) * 1.8
y = amp * tv * sgn
The template advances by a fixed amount on each bar. Template Cycle Length controls how many bars are used to complete one full cycle.
█ Assumptions We Are Explicitly Making
The indicator’s usefulness depends on whether its modeling assumptions are suitable for the instrument and timeframe being analyzed.
These are not facts about market behavior. They are simplifying assumptions used because Pine Script does not provide true intrabar tick or order-flow data.
⚪ Intrabar Activity Is Approximated With a Triangular Distribution
The model approximates intrabar activity using a triangular distribution centered at the close. It does not know where price actually spent the most time within the candle.
Using another reference point, such as VWAP, the midpoint, or the open, could produce a different pressure score.
⚪ Shape and Direction Are Treated Separately
The shape classifier analyzes the magnitude of pressure but removes its bullish or bearish direction. Two windows with similar pressure-strength patterns but opposite directional bias can therefore receive the same shape classification.
The shape describes how pressure has been distributed, while the separate polarity calculation determines whether it is leaning Bull or Bear.
⚪ Seven Shapes Are Used to Describe Pressure Behavior
Every window is placed into one of seven fixed categories using predefined thresholds:
• Skewness thresholds of ±0.1
• Correlation thresholds of ±0.5
• Peak prominence above 10% of the smoothed envelope’s maximum
The classifier follows a fixed priority order rather than selecting the mathematically closest-fitting shape.
There is also no statistical significance test behind these thresholds, so borderline classifications may change because of noise.
⚪ The Displayed Curve Represents the Classification, Not the Raw Data
After classification, the indicator displays an idealized template rather than the original pressure values. Two different pressure windows classified as Bell will use the same normalized Bell template.
The final column height and direction can still differ because the template is scaled by recent volume and signed by polarity.
█ How to Use
⚪ Directional Volume Reading
Use the indicator as you would a traditional volume oscillator.
• Readings above zero indicate bullish volume strength.
• Readings below zero indicate bearish volume strength.
⚪ Divergences
Use the columns to identify divergences in volume strength.
• Bullish divergence: Price makes a lower low while the indicator forms a higher low.
• Bearish divergence: Price makes a higher high while the indicator forms a lower high.
⚪ Interpreting the Shape Labels
• Bell: Pressure intensity is relatively symmetric and contains one main area of activity.
• Right-skewed / Left-skewed: Pressure intensity is uneven and has a longer tail on one side of the distribution.
• J-shaped: Pressure intensity has generally increased toward the most recent bars.
• Reverse-J: Pressure intensity was stronger earlier in the window and has weakened toward the present.
• Bimodal / Multimodal: The smoothed pressure path contains two or more separate periods of stronger activity within the detection window.
⚪ Choosing the Shape Speed
Template Cycle Length controls how quickly the displayed shape moves through its synthetic cycle. It changes the visual speed of the columns, not the shape-detection window or Bull/Bear polarity.
• 3 bars, Fast: Creates tight, fast-moving shapes. This is the most responsive and active-looking setting.
• 4 bars, Balanced: Gives each shape slightly more time to develop while remaining responsive.
• 5 to 7 bars, Slow: Stretches the shape across more bars, creating smoother and slower visual cycles.
A value of 3 is useful when you prefer compact, fast-moving shapes. Increase the value when you want each shape to develop more gradually and remain visible for longer.
█ Settings
Use Volume Weighting: Controls whether volume multiplies directional pressure before shape classification. Volume still controls the plotted column height when this setting is disabled.
Detection Window: Sets the number of recent bars used to classify the current shape. Higher values produce slower and more stable classifications. Lower values react faster and may change shape more often.
Polarity Smoothing: Sets the EMA length used to determine Bull or Bear polarity. Higher values create steadier polarity. Lower values react faster.
Template Cycle Length: Sets the number of bars used to complete one synthetic shape template. Lower values create faster and tighter cycles. Higher values stretch the template over more bars.
Show Moving Average: Shows or hides a moving average of the final plotted output.
Type: Selects the moving-average method: SMA, EMA, RMA, or WMA.
Length: Sets the moving-average period.
Maximum Transparency: Sets the maximum transparency applied near the lower points of each template. A value of 0 disables the transparency fade.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Indicator

Indicator

Dynamic Rollover & Spread WindowDynamic Rollover & High Spread Zones
If you trade across different asset classes, you know that daily rollovers, CFD maintenance breaks, and weekly opens carry massive spread widening and low liquidity. Getting caught in a trade during these windows often leads to unnecessary slippage or getting stopped out by the spread alone.
This indicator automatically highlights these high-risk liquidity gaps directly on your chart. Instead of manually drawing time boxes or switching indicator settings every time you change tickers, the script reads what you are trading and adapts instantly.
The Hidden Cost of High Spreads
The spread is the difference between the Bid (sell) price and the Ask (buy) price. During rollover windows and market opens, institutional liquidity dries up. To protect themselves, brokers widen this spread dramatically—sometimes inflating a standard 1-pip spread to 15 or 20 pips.
This impacts your trading in two fatal ways:
Bad Entries: If you execute a market order during a high-spread window, you are forced to pay that inflated premium. You instantly start the trade in a much deeper drawdown, meaning the market has to move significantly further in your direction just for you to break even.
Phantom Stop-Outs: Stop-loss orders are triggered by the Bid or Ask price, not necessarily the mid-price you see on the chart. If the spread widens enough, it can tag your stop-loss even if the actual market price hasn't moved.
A Simple Example: Imagine you are in a short position on EUR/USD. The current price on the chart is 1.1000, and your stop-loss is placed 10 pips above at 1.1010. Normally, the spread is 1 pip.
At 17:00 NY time (rollover), the broker widens the spread to 15 pips. Even though the chart price remains exactly at 1.1000, the Ask price instantly jumps to 1.1015. Your stop-loss is triggered, closing you out for a loss. Five minutes later, the spread returns to normal, and EUR/USD drops 50 pips in your favor—but you are already out of the trade.
Key Features:
Dynamic Asset Detection: The script automatically detects if you are viewing a Forex pair, an Index (futures or CFD), or a Commodity. It then applies the correct low-liquidity window for that specific market.
Daily Rollovers vs. Weekly Opens: Daily maintenance windows (Monday–Friday) are highlighted in one color, while the notoriously thin Sunday Weekly Opens are isolated and highlighted in another.
Timezone Proof: All session times are anchored strictly to the "America/New_York" timezone (EST/EDT). This ensures the windows remain 100% accurate year-round, completely bypassing local Daylight Saving Time shifts.
Built for Edge Cases: The detection engine accurately categorizes generically labeled CFD tickers (like NAS100, US30, XAUUSD) and standard CME Futures (ES, NQ, CL).
Default Time Windows (NY Time):
Forex: 17:00–18:00 (Daily) | 17:00–19:00 (Sunday Open)
Indices: 16:00–18:00 (Daily) | 18:00–19:00 (Sunday Open)
Commodities: 17:00–18:00 (Daily) | 18:00–19:00 (Sunday Open)
Customization:
All session times and highlight colors are fully customizable in the indicator inputs to match your specific broker's server times if they differ from the standard exchange breaks.
Indicator

Indicator

Indicator

XAUUSD Clean Institutional Scalper v11//@version=6
indicator("XAUUSD Clean Institutional Scalper v11", overlay=true, max_boxes_count=40, max_labels_count=80, max_lines_count=60)
//====================
// Inputs
//====================
showBg = input.bool(true, "Session Background")
showBiasBox = input.bool(true, "Bias Box")
showSessionBox = input.bool(true, "Session Box")
showZone = input.bool(true, "Entry Zone")
showSweeps = input.bool(true, "Sweep Labels")
showLevels = input.bool(true, "Support / Resistance")
showTargets = input.bool(true, "SL + TP Levels")
showSMC = input.bool(true, "Smart Money Concepts")
showPD = input.bool(true, "Premium / Discount")
showLabels = input.bool(true, "In-Chart Labels")
biasTf = input.timeframe("240", "Bias TF")
liqLen = input.int(5, "Swing Length", minval=2, maxval=20)
smcLen = input.int(3, "SMC Swing Length", minval=2, maxval=10)
zoneExtend = input.int(12, "Zone Extend", minval=1, maxval=50)
asiaSess = input.session("0000-0600", "Asia")
londonSess = input.session("0700-1600", "London")
nySess = input.session("1300-2100", "New York")
overlapSess = input.session("1300-1600", "Overlap")
bullZoneFill = input.color(color.new(color.lime, 82), "Bull Zone Fill")
bearZoneFill = input.color(color.new(color.red, 82), "Bear Zone Fill")
neutralFill = input.color(color.new(color.gray, 90), "Neutral Fill")
bullBorder = input.color(color.new(color.lime, 0), "Bull Border")
bearBorder = input.color(color.new(color.red, 0), "Bear Border")
neutralBorder = input.color(color.new(color.gray, 30), "Neutral Border")
sessionFill = input.color(color.new(color.white, 88), "Session Fill")
sessionBorder = input.color(color.new(color.white, 35), "Session Border")
supColor = input.color(color.new(color.yellow, 0), "Support Color")
resColor = input.color(color.new(color.yellow, 0), "Resistance Color")
slColor = input.color(color.new(color.red, 0), "Stop Loss Color")
tp1Color = input.color(color.new(color.green, 0), "TP1 Color")
tp2Color = input.color(color.new(color.blue, 0), "TP2 Color")
tp3Color = input.color(color.new(color.purple, 0), "TP3 Color")
//====================
// Helper
//====================
f_callout(_x, _y, _txt, _bg, _tc, _style) =>
label.new(_x, _y, _txt, xloc=xloc.bar_index, yloc=yloc.price, style=_style, textcolor=_tc, color=_bg, size=size.tiny)
//====================
// Sessions
//====================
inAsia = not na(time(timeframe.period, asiaSess))
inLondon = not na(time(timeframe.period, londonSess))
inNY = not na(time(timeframe.period, nySess))
inOverlap = not na(time(timeframe.period, overlapSess))
sessionOk = inLondon or inNY or inOverlap
bgcolor(showBg ? (inOverlap ? color.new(color.orange, 88) : inLondon ? color.new(color.blue, 93) : inNY ? color.new(color.purple, 93) : inAsia ? color.new(color.teal, 95) : na) : na)
//====================
// Bias
//====================
fast = request.security(syminfo.tickerid, biasTf, ta.ema(close, 21), lookahead=barmerge.lookahead_on)
slow = request.security(syminfo.tickerid, biasTf, ta.ema(close, 55), lookahead=barmerge.lookahead_on)
rsiV = request.security(syminfo.tickerid, biasTf, ta.rsi(close, 14), lookahead=barmerge.lookahead_on)
bullBias = fast > slow and rsiV > 50
bearBias = fast < slow and rsiV < 50
var box biasBox = na
if showBiasBox and barstate.islast
biasTop = bullBias ? close + 50 : bearBias ? close + 100 : close + 25
biasBot = bullBias ? close - 10 : bearBias ? close + 10 : close - 10
if na(biasBox)
biasBox := box.new(bar_index - 5, biasTop, bar_index + 10, biasBot)
box.set_left(biasBox, bar_index - 5)
box.set_right(biasBox, bar_index + 10)
box.set_top(biasBox, biasTop)
box.set_bottom(biasBox, biasBot)
box.set_bgcolor(biasBox, bullBias ? color.new(color.lime, 88) : bearBias ? color.new(color.red, 88) : neutralFill)
box.set_border_color(biasBox, bullBias ? bullBorder : bearBias ? bearBorder : neutralBorder)
//====================
// Session box
//====================
var box sessBox = na
var float sessHigh = na
var float sessLow = na
newSession = sessionOk and not sessionOk
if newSession
sessHigh := high
sessLow := low
else if sessionOk
sessHigh := na(sessHigh) ? high : math.max(sessHigh, high)
sessLow := na(sessLow) ? low : math.min(sessLow, low)
if showSessionBox and barstate.islast and sessionOk and not na(sessHigh) and not na(sessLow)
if na(sessBox)
sessBox := box.new(bar_index - 15, sessHigh, bar_index + 15, sessLow)
box.set_left(sessBox, bar_index - 15)
box.set_right(sessBox, bar_index + 15)
box.set_top(sessBox, sessHigh)
box.set_bottom(sessBox, sessLow)
box.set_bgcolor(sessBox, sessionFill)
box.set_border_color(sessBox, sessionBorder)
//====================
// Support / Resistance
//====================
ph = ta.pivothigh(high, liqLen, liqLen)
pl = ta.pivotlow(low, liqLen, liqLen)
var float lastPH = na
var float lastPL = na
var line resLine = na
var line supLine = na
if not na(ph)
lastPH := ph
if not na(resLine)
line.delete(resLine)
resLine := line.new(bar_index - liqLen, ph, bar_index, ph, extend=extend.right, color=resColor, style=line.style_dashed, width=2)
if not na(pl)
lastPL := pl
if not na(supLine)
line.delete(supLine)
supLine := line.new(bar_index - liqLen, pl, bar_index, pl, extend=extend.right, color=supColor, style=line.style_dashed, width=2)
//====================
// Sweep
//====================
bullSweep = showSweeps and not na(lastPL) and low < lastPL and close > lastPL
bearSweep = showSweeps and not na(lastPH) and high > lastPH and close < lastPH
plotshape(bullSweep, style=shape.arrowup, location=location.belowbar, color=color.lime, size=size.small, text="SWEEP")
plotshape(bearSweep, style=shape.arrowdown, location=location.abovebar, color=color.red, size=size.small, text="SWEEP")
if showLabels and bullSweep
f_callout(bar_index + 1, low, "sweep", color.new(color.gray, 25), color.white, label.style_label_left)
if showLabels and bearSweep
f_callout(bar_index + 1, high, "sweep", color.new(color.gray, 25), color.white, label.style_label_left)
//====================
// SMC
//====================
smcPH = ta.pivothigh(high, smcLen, smcLen)
smcPL = ta.pivotlow(low, smcLen, smcLen)
var float smcHigh = na
var float smcLow = na
var line smcHighLine = na
var line smcLowLine = na
if showSMC and not na(smcPH)
smcHigh := smcPH
if not na(smcHighLine)
line.delete(smcHighLine)
smcHighLine := line.new(bar_index - smcLen, smcPH, bar_index, smcPH, extend=extend.right, color=color.new(color.aqua, 0), style=line.style_dashed, width=2)
if showSMC and not na(smcPL)
smcLow := smcPL
if not na(smcLowLine)
line.delete(smcLowLine)
smcLowLine := line.new(bar_index - smcLen, smcPL, bar_index, smcPL, extend=extend.right, color=color.new(color.orange, 0), style=line.style_dashed, width=2)
bullBOS = showSMC and not na(smcHigh) and close > smcHigh and close <= smcHigh
bearBOS = showSMC and not na(smcLow) and close < smcLow and close >= smcLow
bullCHoCH = showSMC and not na(smcLow) and close < smcLow and bullBias
bearCHoCH = showSMC and not na(smcHigh) and close > smcHigh and bearBias
if bullBOS and showLabels
f_callout(bar_index, high, "BOS", color.new(color.aqua, 0), color.white, label.style_label_up)
if bearBOS and showLabels
f_callout(bar_index, low, "BOS", color.new(color.orange, 0), color.white, label.style_label_down)
if bullCHoCH and showLabels
f_callout(bar_index, low, "CHOCH", color.new(color.green, 0), color.white, label.style_label_down)
if bearCHoCH and showLabels
f_callout(bar_index, high, "CHOCH", color.new(color.red, 0), color.white, label.style_label_up)
//====================
// Premium / Discount
//====================
midSMC = na(smcHigh) or na(smcLow) ? na : (smcHigh + smcLow) / 2.0
var box pdBox = na
if showPD and not na(midSMC) and barstate.islast and not na(smcHigh) and not na(smcLow)
if na(pdBox)
pdBox := box.new(bar_index - 25, smcHigh, bar_index + 20, smcLow)
box.set_left(pdBox, bar_index - 25)
box.set_right(pdBox, bar_index + 20)
box.set_top(pdBox, smcHigh)
box.set_bottom(pdBox, smcLow)
box.set_bgcolor(pdBox, color.new(color.gray, 92))
box.set_border_color(pdBox, color.new(color.gray, 70))
//====================
// Entry zone
//====================
bullFVG = low > high
bearFVG = high < low
freshBullFVG = bullFVG and not bullFVG
freshBearFVG = bearFVG and not bearFVG
var box zoneBox = na
if showZone and freshBullFVG
if not na(zoneBox)
box.delete(zoneBox)
zoneBox := box.new(bar_index - 2, low, bar_index + zoneExtend, high , border_color=bullBorder, bgcolor=color.new(color.lime, 78))
if showLabels
f_callout(bar_index + 1, low, "support zone", color.new(color.lime, 72), color.black, label.style_label_left)
if showZone and freshBearFVG
if not na(zoneBox)
box.delete(zoneBox)
zoneBox := box.new(bar_index - 2, low , bar_index + zoneExtend, high, border_color=bearBorder, bgcolor=color.new(color.red, 78))
if showLabels
f_callout(bar_index + 1, high, "supply zone", color.new(color.red, 72), color.white, label.style_label_left)
//====================
// Trade logic
//====================
localBull = ta.ema(close, 9) > ta.ema(close, 21)
localBear = ta.ema(close, 9) < ta.ema(close, 21)
buySignal = sessionOk and bullBias and localBull and (bullSweep or freshBullFVG)
sellSignal = sessionOk and bearBias and localBear and (bearSweep or freshBearFVG)
atrv = ta.atr(14)
entryPrice = close
slLong = math.min(nz(lastPL, low), low) - atrv * 0.25
slShort = math.max(nz(lastPH, high), high) + atrv * 0.25
tp1Long = entryPrice + atrv * 1.0
tp2Long = entryPrice + atrv * 1.8
tp3Long = entryPrice + atrv * 2.5
tp1Short = entryPrice - atrv * 1.0
tp2Short = entryPrice - atrv * 1.8
tp3Short = entryPrice - atrv * 2.5
var line slLine = na
var line tp1Line = na
var line tp2Line = na
var line tp3Line = na
if showTargets and buySignal
if not na(slLine)
line.delete(slLine)
if not na(tp1Line)
line.delete(tp1Line)
if not na(tp2Line)
line.delete(tp2Line)
if not na(tp3Line)
line.delete(tp3Line)
slLine := line.new(bar_index, slLong, bar_index + 15, slLong, extend=extend.right, color=slColor, style=line.style_dashed, width=2)
tp1Line := line.new(bar_index, tp1Long, bar_index + 15, tp1Long, extend=extend.right, color=tp1Color, style=line.style_dashed, width=2)
tp2Line := line.new(bar_index, tp2Long, bar_index + 15, tp2Long, extend=extend.right, color=tp2Color, style=line.style_dashed, width=2)
tp3Line := line.new(bar_index, tp3Long, bar_index + 15, tp3Long, extend=extend.right, color=tp3Color, style=line.style_dashed, width=2)
if showLabels
f_callout(bar_index + 2, slLong, "SL", color.new(color.red, 10), color.white, label.style_label_left)
f_callout(bar_index + 2, tp1Long, "TP1", color.new(color.green, 10), color.white, label.style_label_left)
f_callout(bar_index + 2, tp2Long, "TP2", color.new(color.blue, 10), color.white, label.style_label_left)
f_callout(bar_index + 2, tp3Long, "TP3", color.new(color.purple, 10), color.white, label.style_label_left)
if showTargets and sellSignal
if not na(slLine)
line.delete(slLine)
if not na(tp1Line)
line.delete(tp1Line)
if not na(tp2Line)
line.delete(tp2Line)
if not na(tp3Line)
line.delete(tp3Line)
slLine := line.new(bar_index, slShort, bar_index + 15, slShort, extend=extend.right, color=slColor, style=line.style_dashed, width=2)
tp1Line := line.new(bar_index, tp1Short, bar_index + 15, tp1Short, extend=extend.right, color=tp1Color, style=line.style_dashed, width=2)
tp2Line := line.new(bar_index, tp2Short, bar_index + 15, tp2Short, extend=extend.right, color=tp2Color, style=line.style_dashed, width=2)
tp3Line := line.new(bar_index, tp3Short, bar_index + 15, tp3Short, extend=extend.right, color=tp3Color, style=line.style_dashed, width=2)
if showLabels
f_callout(bar_index + 2, slShort, "SL", color.new(color.red, 10), color.white, label.style_label_left)
f_callout(bar_index + 2, tp1Short, "TP1", color.new(color.green, 10), color.white, label.style_label_left)
f_callout(bar_index + 2, tp2Short, "TP2", color.new(color.blue, 10), color.white, label.style_label_left)
f_callout(bar_index + 2, tp3Short, "TP3", color.new(color.purple, 10), color.white, label.style_label_left)
// Signals
plotshape(buySignal, style=shape.arrowup, location=location.belowbar, color=color.lime, size=size.small, text="BUY")
plotshape(sellSignal, style=shape.arrowdown, location=location.abovebar, color=color.red, size=size.small, text="SELL") Indicator

Indicator

ALGOSMART ASSIST v2ALGOSMART TECHNICAL ASSIST - Advanced Smart Money & Market Structure Indicator
The ALGOSMART ASSIST indicator is an intelligent and highly advanced tool designed for analysts and traders who utilize Smart Money Concepts (SMC) and Price Action. This powerful script automates your chart analysis by identifying and drawing all vital market structures in real-time.
Key Features:
Market Structure Mapping: Automatically detects and plots Break of Structure (BOS) and Change of Character (CHoCH). You can customize the structure type to map with or without Inducement (IDM).
Supply & Demand Zones: Accurately draws Points of Interest (POI) and Supply/Demand order blocks. Mitigated zones automatically change color.
Liquidity Sweeps: Highlights crucial daily highs and lows (PDH/PDL) and displays sweep lines.
Specific Candle Patterns: Toggle the detection of important candlestick patterns such as Inside Bars (ISB), Outside Bars (OSB), and Strong Change of Character Bars (SCOB).
Live Tracking: Projects dynamic, real-time lines for BOS, CHoCH, and IDM directly to the live price edge.
Additional Assistive Tools: Displays the 0.5 Equilibrium level, marks major swing points (HH, HL, LL, LH), and automatically calculates potential Target Profits.
Original base script by AlbaTherium & Ma Bang Chu. Modified, Updated and Enhanced by Crypto Smart. Indicator

Indicator

Strategy

Indicator

Pakistan Currency Devaluation Probability Engine (PCPE)The Pakistan Currency Devaluation Probability Engine (PCPE) is an advanced macroeconomic risk indicator built for PulseWire in Pine Script v6. Designed specifically to monitor the Pakistani Rupee (PKR) against the U.S. Dollar (USD), the model bypasses traditional spot-rate forecasting in favor of structural valuation analytics.
By measuring how far the current exchange rate has diverged from a long-term compounding baseline, the engine translates complex macroeconomic stress into an intuitive, real-time probability score ranging from 0% to 100%.
Core Methodology & Mechanics
Long-Term Structural Compounding: Operates on an internal baseline model that continuously compounds day-by-day from a historical anchor point, tracking the structural growth path of the currency.
Divergence Analysis: Evaluates the live percentage spread (divergence_pct) between current market spot rates and the internal baseline. When spot rates compress or drift below the structural path, devaluation pressure mounts.
High-Frequency Resolution: Fetches live USDPKR market data at daily resolution (1D), ensuring smooth, precise day-by-day accrual and immediate risk updates.
Risk Zones & Visual Architecture
The indicator uses a multi-tier color grading system and shaded background regions to categorize market stability and adjustment risk:
Stability Zone (0% – 20%):
Behavior: When divergence remains healthy (+5% or higher), the probability line flattens at the 0% green floor. As minor pressures build, it transitions through purple (5–10%) and yellow (10–20%).
Visual: Shaded soft green background with a "STABILITY ZONE" watermark.
Devaluation Danger Zone (20% – 50%):
Behavior: Signals moderate to elevated vulnerability as divergence narrows or turns negative. The line grades from light red (>20%) to dark red (>30%).
Visual: Highlighted soft orange background with a "DEVALUATION DANGER ZONE" watermark.
Devaluation Imminent (50% – 100%):
Behavior: Represents high probability of structural adjustment or emergency stabilization measures. Crossing above 70% transitions the primary plot line into an extreme black risk line.
Visual: Shaded soft red background with a "DEVALUATION IMMINENT" watermark, supported by explicit warning threshold lines at 50% and 70%.
Dashboard Audit Summary
The script includes a real-time summary table anchored to the top-right corner of the chart, displaying:
USDPKR Spot Price: Live market valuation.
Implied Real Value: The hidden baseline compounding target.
Divergence Spread: The exact percentage deviation.
Market Status: Dynamic toggle between STABILIZATION and DEVALUATION PENDING.
Devaluation Probability: The precise risk score governing the chart plot. Indicator

Pakistan Currency Stress EngineOverview
The Pakistan Currency Stress Engine (PCSI) is a macroeconomic framework designed to estimate the structural valuation of the Pakistani Rupee (PKR) against the US Dollar and quantify the probability of future currency stress.
Unlike conventional exchange rate indicators that rely on technical price action or a single macro variable, this model combines multiple independent macroeconomic drivers into a unified institutional-style framework.
The objective is not to predict short-term market movements, but to estimate:
Structural equilibrium exchange rate
Currency mispricing
Macroeconomic stress accumulation
Reserve adequacy
Six-month devaluation risk
Core Methodology
The model integrates several independent macroeconomic components.
1. Energy-Adjusted Real Exchange Rate (E-RER)
Instead of using a simple Purchasing Power Parity model, the engine estimates a rolling five-year real exchange rate equilibrium and adjusts it for Pakistan's dependence on imported energy.
Brent crude oil is incorporated through a calibrated energy transmission mechanism, allowing the equilibrium exchange rate to adapt to terms-of-trade shocks.
2. Reserve Adequacy Framework
The reserve model distinguishes between:
Gross foreign exchange reserves
Estimated SBP net usable reserves
Import cover is calculated using gross reserves, consistent with international reporting standards, while liquidity stress metrics use estimated usable reserves.
The model also supports different reserve units and automatically normalizes them.
3. Monetary and Liquidity Stress
Currency pressure is evaluated through:
M2 expansion
Reserve coverage
Current account deterioration
Credit growth
Fiscal monetization risk
Real interest rates
These variables interact rather than contribute independently, allowing reserve weakness to amplify monetary stress.
4. Hidden Stress Engine
Instead of reacting immediately to monthly data releases, macro shocks are passed through autoregressive memory filters.
This allows stress to accumulate gradually, reflecting the delayed transmission commonly observed in emerging market currency crises.
5. Historical Regime Benchmark
The model incorporates a long-term historical benchmark beginning in 2006.
Rather than forcing the exchange rate toward this benchmark, it acts as a soft governor that prevents equilibrium estimates from drifting unrealistically over long periods while preserving market-driven valuation.
Outputs
The engine produces several institutional-style metrics:
Estimated fair value of USDPKR
Historical benchmark valuation
Valuation gap
Hidden macro stress index
Expected 12-month depreciation
Six-month devaluation probability
These outputs are intended to provide a macroeconomic assessment of currency conditions rather than trading signals.
Intended Users
This framework is designed for:
Macro investors
Currency analysts
Economists
Risk managers
Pakistan equity investors
Fixed-income investors
Researchers studying emerging-market currencies
Important Notes
This indicator is an analytical model, not an oracle.
Macroeconomic models are inherently approximations and cannot anticipate policy interventions, geopolitical events, capital controls, IMF negotiations, or unexpected structural changes.
Its purpose is to organize macroeconomic information into a consistent and transparent framework that helps evaluate the underlying health of the Pakistani Rupee over medium- to long-term horizons. Indicator

NSE Emotion Zones: Fear & Greed Structural Identifier by GurujamAdaptive Volume for the NSE: The indicator uses a dynamic volume moving average (avgVol) rather than static volume limits. If an asset on the Nairobi Stock Exchange normally trades 10,000 shares a day, a sudden spike to 25,000 shares (while small compared to global markets) will register correctly as a high-volume climax indicative of institutional intervention.
Identifying Greed (Balloons): When an asset is in the Wyckoff Distribution phase, retail euphoria peaks. The indicator looks for high-volume "Shooting Stars" or "Bearish Engulfing" candles—the exact micro-structural footprints of the "Composite Man" selling into retail greed. It highlights these Upthrust (UTAD) traps with red downward-pointing balloons.
Identifying Fear (Balloons): During the Markdown and Accumulation phases, public panic leads to capitulation. The script actively scans for high-volume "Hammers" and "Bullish Engulfing" patterns, which signify that smart money is absorbing the frantic selling of retail traders (the Wyckoff Spring). It prints green upward-pointing balloons at these zones.
Continuation Flags: The Doji candle serves as the universal signature of market indecision and emotional equilibrium. The script looks for Dojis followed immediately by high-volume directional candles, printing small flags on the chart to indicate that the prevailing emotional trend (either markup or markdown) is continuing after a brief pause.Adaptive Volume for the NSE: The indicator uses a dynamic volume moving average (avgVol) rather than static volume limits. If an asset on the Nairobi Stock Exchange normally trades 10,000 shares a day, a sudden spike to 25,000 shares (while small compared to global markets) will register correctly as a high-volume climax indicative of institutional intervention.
Identifying Greed (Balloons): When an asset is in the Wyckoff Distribution phase, retail euphoria peaks. The indicator looks for high-volume "Shooting Stars" or "Bearish Engulfing" candles—the exact micro-structural footprints of the "Composite Man" selling into retail greed. It highlights these Upthrust (UTAD) traps with red downward-pointing balloons.
Identifying Fear (Balloons): During the Markdown and Accumulation phases, public panic leads to capitulation. The script actively scans for high-volume "Hammers" and "Bullish Engulfing" patterns, which signify that smart money is absorbing the frantic selling of retail traders (the Wyckoff Spring). It prints green upward-pointing balloons at these zones.
Continuation Flags: The Doji candle serves as the universal signature of market indecision and emotional equilibrium. The script looks for Dojis followed immediately by high-volume directional candles, printing small flags on the chart to indicate that the prevailing emotional trend (either markup or markdown) is continuing after a brief pause. Indicator
