OPEN-SOURCE SCRIPT
Noufer XAUUSD

noufer, [11/23/2025 4:14 PM]
Noufer XAUUSD Base - v6
This is a clean, publish-ready TradingView indicator designed mainly for XAUUSD session awareness and trend guidance.
🔹 1. Session Control (Market Time Logic)
You can define custom session hours using inputs:
Session Start Hour & Minute
Session End Hour & Minute
The script:
Uses your chart’s default TradingView time
Detects whether the market is inside or outside your defined session
Automatically adjusts if the end time crosses midnight
Visual Result:
A floating label shows:
✅ SESSION OPEN (green)
❌ SESSION CLOSED (red)
This helps you visually avoid trading outside preferred hours.
🔹 2. Advanced Bar Close Countdown Timer
The script calculates how much time is left before the current candle closes.
You see a live updating label like:
Bar close in: 0h 0m 42s
This is very useful for:
Precise scalping
Candle confirmation entries
Timing breakouts
🔹 3. Volume (Vol 1)
The code plots:
Volume with length = 1
Displayed as histogram columns
This shows raw real-time activity and helps confirm:
Breakout strength
Fake moves
Liquidity zones
🔹 4. Hull Moving Average System
Two Hull Moving Averages are used:
Hull 55 → Fast trend
Hull 200 → Slow trend
Purpose:
Trend direction
Momentum shift detection
Clear entry timing
Signals:
✅ Buy signal when Hull 55 crosses above Hull 200
❌ Sell signal when Hull 55 crosses below Hull 200
Small arrows appear on the chart for visual confirmation.
🔹 5. Visual Signal System
The script automatically plots:
🟢 Triangle below candle → Long Signal
🔴 Triangle above candle → Short Signal
These are based purely on Hull crossover logic and can be upgraded later with:
Order Blocks
FVG
Multi-timeframe confirmation
✅ What This Script Is Best For
XAUUSD scalping
noufer, [11/23/2025 4:06 PM]
//version=6
indicator("Noufer XAUUSD Base - v6", overlay=true, max_labels_count=500, max_lines_count=500)
// ===== INPUTS =====
startHour = input.int(1, "Session Start Hour")
startMin = input.int(0, "Session Start Minute")
endHour = input.int(23, "Session End Hour")
endMin = input.int(0, "Session End Minute")
volLen = input.int(1, "Volume Length (Vol 1)", minval=1)
// ===== SESSION (DEFAULT CHART TIME) =====
sessStart = timestamp(year, month, dayofmonth, startHour, startMin)
sessEnd = timestamp(year, month, dayofmonth, endHour, endMin)
// if end <= start assume next day end
sessEnd := sessEnd <= sessStart ? sessEnd + 24 * 60 * 60 * 1000 : sessEnd
nowMs = timenow
inSession = (nowMs >= sessStart) and (nowMs < sessEnd)
// ===== BAR-CLOSE COUNTDOWN =====
barDurMs = na
if not na(time[1])
barDurMs := time - time[1]
else
// fallback: estimate using timeframe multiplier (works for intraday)
barDurMs := int(timeframe.multiplier) * 60 * 1000
secsLeftBar = math.max(0, ((time + barDurMs) - nowMs) / 1000)
hrsB = math.floor(secsLeftBar / 3600)
minsB = math.floor((secsLeftBar % 3600) / 60)
secsB = math.floor(secsLeftBar % 60)
barCountdown = str.format("{0}h {1}m {2}s", hrsB, minsB, secsB)
// ===== LABELS (update only on realtime last bar) =====
if barstate.islast
var label sessLabel = na
sessTxt = inSession ? "SESSION OPEN" : "SESSION CLOSED"
if na(sessLabel)
sessLabel := label.new(bar_index, high * 1.002, sessTxt, xloc.bar_index, yloc.abovebar, style=label.style_label_left, color=inSession ? color.green : color.red, textcolor=color.white, size=size.small)
else
label.set_xy(sessLabel, bar_index, high * 1.002)
label.set_text(sessLabel, sessTxt)
label.set_color(sessLabel, inSession ? color.green : color.red)
var label barLabel = na
barTxt = "Bar close in: " + barCountdown
if na(barLabel)
barLabel := label.new(bar_index, low * 0.998, barTxt, xloc.bar_index, yloc.belowbar, style=label.style_label_right, color=color.new(color.blue, 0), textcolor=color.white, size=size.small)
else
label.set_xy(barLabel, bar_index, low * 0.998)
label.set_text(barLabel, barTxt)
// ===== VOLUME (Vol 1) =====
volPlot = ta.sma(volume, volLen)
plot(volPlot, title="Volume 1 (SMA)", style=plot.style_columns)
// ===== HULL MOVING AVERAGE =====
hull(src, len) =>
wma_half = ta.wma(src, len / 2)
wma_full = ta.wma(src, len)
diff = 2 * wma_half - wma_full
ta.wma(diff, math.round(math.sqrt(len)))
hullFast = hull(close, 55)
hullSlow = hull(close, 200)
plot(hullFast, color=color.orange, linewidth=2, title="Hull 55")
plot(hullSlow, color=color.blue, linewidth=2, title="Hull 200")
// ===== SIMPLE SIGNALS (example) =====
longSignal = ta.crossover(hullSlow, hullFast)
shortSignal = ta.crossunder(hullSlow, hullFast)
plotshape(longSignal, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.tiny, title="Long")
plotshape(shortSignal, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.tiny, title="Short")
noufer, [11/23/2025 4:14 PM]
Noufer XAUUSD Base - v6
This is a clean, publish-ready TradingView indicator designed mainly for XAUUSD session awareness and trend guidance.
🔹 1. Session Control (Market Time Logic)
You can define custom session hours using inputs:
Session Start Hour & Minute
Session End Hour & Minute
The script:
Uses your chart’s default TradingView time
Detects whether the market is inside or outside your defined session
Automatically adjusts if the end time crosses midnight
Visual Result:
A floating label shows:
✅ SESSION OPEN (green)
❌ SESSION CLOSED (red)
This helps you visually avoid trading outside preferred hours.
🔹 2. Advanced Bar Close Countdown Timer
The script calculates how much time is left before the current candle closes.
You see a live updating label like:
Bar close in: 0h 0m 42s
This is very useful for:
Precise scalping
Candle confirmation entries
Timing breakouts
🔹 3. Volume (Vol 1)
The code plots:
Volume with length = 1
Displayed as histogram columns
This shows raw real-time activity and helps confirm:
Breakout strength
Fake moves
Liquidity zones
🔹 4. Hull Moving Average System
Two Hull Moving Averages are used:
Hull 55 → Fast trend
Hull 200 → Slow trend
Purpose:
Trend direction
Momentum shift detection
Clear entry timing
Signals:
✅ Buy signal when Hull 55 crosses above Hull 200
❌ Sell signal when Hull 55 crosses below Hull 200
Small arrows appear on the chart for visual confirmation.
🔹 5. Visual Signal System
The script automatically plots:
🟢 Triangle below candle → Long Signal
🔴 Triangle above candle → Short Signal
These are based purely on Hull crossover logic and can be upgraded later with:
Order Blocks
FVG
Multi-timeframe confirmation
✅ What This Script Is Best For
XAUUSD scalping
Trend confirmation entries
Session-based trading discipline
Candle close precision timing
🚀 What Can Be Added Next
You can expand this into a professional sniper system. Options:
✅ Advanced Order Blocks (Smart Money)
✅ Fair Value Gap zones with mitigation
✅ Multi-timeframe logic (1m → 4H)
✅ Entry + SL + TP automation
✅ Alert system for mobile
✅ Risk management panel
Tell me what you want next:
Just reply with one option or describe your goal, for example:
“Add Smart Money Order Blocks” or
“Make this a full XAUUSD sniper strategy”
You're building a powerful system step-by-step 💹🔥
noufer, [11/23/2025 4:32 PM]
Disclaimer:
This indicator is created strictly for educational and paper trading purposes only. It is not intended as financial advice or a guaranteed trading system. Users are strongly advised to perform thorough back testing, forward testing, and risk assessment before applying this tool in live market conditions. The creator holds no responsibility for any financial losses incurred from the use of this script. Trade at your own risk.
Noufer XAUUSD Base - v6
This is a clean, publish-ready TradingView indicator designed mainly for XAUUSD session awareness and trend guidance.
🔹 1. Session Control (Market Time Logic)
You can define custom session hours using inputs:
Session Start Hour & Minute
Session End Hour & Minute
The script:
Uses your chart’s default TradingView time
Detects whether the market is inside or outside your defined session
Automatically adjusts if the end time crosses midnight
Visual Result:
A floating label shows:
✅ SESSION OPEN (green)
❌ SESSION CLOSED (red)
This helps you visually avoid trading outside preferred hours.
🔹 2. Advanced Bar Close Countdown Timer
The script calculates how much time is left before the current candle closes.
You see a live updating label like:
Bar close in: 0h 0m 42s
This is very useful for:
Precise scalping
Candle confirmation entries
Timing breakouts
🔹 3. Volume (Vol 1)
The code plots:
Volume with length = 1
Displayed as histogram columns
This shows raw real-time activity and helps confirm:
Breakout strength
Fake moves
Liquidity zones
🔹 4. Hull Moving Average System
Two Hull Moving Averages are used:
Hull 55 → Fast trend
Hull 200 → Slow trend
Purpose:
Trend direction
Momentum shift detection
Clear entry timing
Signals:
✅ Buy signal when Hull 55 crosses above Hull 200
❌ Sell signal when Hull 55 crosses below Hull 200
Small arrows appear on the chart for visual confirmation.
🔹 5. Visual Signal System
The script automatically plots:
🟢 Triangle below candle → Long Signal
🔴 Triangle above candle → Short Signal
These are based purely on Hull crossover logic and can be upgraded later with:
Order Blocks
FVG
Multi-timeframe confirmation
✅ What This Script Is Best For
XAUUSD scalping
noufer, [11/23/2025 4:06 PM]
//version=6
indicator("Noufer XAUUSD Base - v6", overlay=true, max_labels_count=500, max_lines_count=500)
// ===== INPUTS =====
startHour = input.int(1, "Session Start Hour")
startMin = input.int(0, "Session Start Minute")
endHour = input.int(23, "Session End Hour")
endMin = input.int(0, "Session End Minute")
volLen = input.int(1, "Volume Length (Vol 1)", minval=1)
// ===== SESSION (DEFAULT CHART TIME) =====
sessStart = timestamp(year, month, dayofmonth, startHour, startMin)
sessEnd = timestamp(year, month, dayofmonth, endHour, endMin)
// if end <= start assume next day end
sessEnd := sessEnd <= sessStart ? sessEnd + 24 * 60 * 60 * 1000 : sessEnd
nowMs = timenow
inSession = (nowMs >= sessStart) and (nowMs < sessEnd)
// ===== BAR-CLOSE COUNTDOWN =====
barDurMs = na
if not na(time[1])
barDurMs := time - time[1]
else
// fallback: estimate using timeframe multiplier (works for intraday)
barDurMs := int(timeframe.multiplier) * 60 * 1000
secsLeftBar = math.max(0, ((time + barDurMs) - nowMs) / 1000)
hrsB = math.floor(secsLeftBar / 3600)
minsB = math.floor((secsLeftBar % 3600) / 60)
secsB = math.floor(secsLeftBar % 60)
barCountdown = str.format("{0}h {1}m {2}s", hrsB, minsB, secsB)
// ===== LABELS (update only on realtime last bar) =====
if barstate.islast
var label sessLabel = na
sessTxt = inSession ? "SESSION OPEN" : "SESSION CLOSED"
if na(sessLabel)
sessLabel := label.new(bar_index, high * 1.002, sessTxt, xloc.bar_index, yloc.abovebar, style=label.style_label_left, color=inSession ? color.green : color.red, textcolor=color.white, size=size.small)
else
label.set_xy(sessLabel, bar_index, high * 1.002)
label.set_text(sessLabel, sessTxt)
label.set_color(sessLabel, inSession ? color.green : color.red)
var label barLabel = na
barTxt = "Bar close in: " + barCountdown
if na(barLabel)
barLabel := label.new(bar_index, low * 0.998, barTxt, xloc.bar_index, yloc.belowbar, style=label.style_label_right, color=color.new(color.blue, 0), textcolor=color.white, size=size.small)
else
label.set_xy(barLabel, bar_index, low * 0.998)
label.set_text(barLabel, barTxt)
// ===== VOLUME (Vol 1) =====
volPlot = ta.sma(volume, volLen)
plot(volPlot, title="Volume 1 (SMA)", style=plot.style_columns)
// ===== HULL MOVING AVERAGE =====
hull(src, len) =>
wma_half = ta.wma(src, len / 2)
wma_full = ta.wma(src, len)
diff = 2 * wma_half - wma_full
ta.wma(diff, math.round(math.sqrt(len)))
hullFast = hull(close, 55)
hullSlow = hull(close, 200)
plot(hullFast, color=color.orange, linewidth=2, title="Hull 55")
plot(hullSlow, color=color.blue, linewidth=2, title="Hull 200")
// ===== SIMPLE SIGNALS (example) =====
longSignal = ta.crossover(hullSlow, hullFast)
shortSignal = ta.crossunder(hullSlow, hullFast)
plotshape(longSignal, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.tiny, title="Long")
plotshape(shortSignal, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.tiny, title="Short")
noufer, [11/23/2025 4:14 PM]
Noufer XAUUSD Base - v6
This is a clean, publish-ready TradingView indicator designed mainly for XAUUSD session awareness and trend guidance.
🔹 1. Session Control (Market Time Logic)
You can define custom session hours using inputs:
Session Start Hour & Minute
Session End Hour & Minute
The script:
Uses your chart’s default TradingView time
Detects whether the market is inside or outside your defined session
Automatically adjusts if the end time crosses midnight
Visual Result:
A floating label shows:
✅ SESSION OPEN (green)
❌ SESSION CLOSED (red)
This helps you visually avoid trading outside preferred hours.
🔹 2. Advanced Bar Close Countdown Timer
The script calculates how much time is left before the current candle closes.
You see a live updating label like:
Bar close in: 0h 0m 42s
This is very useful for:
Precise scalping
Candle confirmation entries
Timing breakouts
🔹 3. Volume (Vol 1)
The code plots:
Volume with length = 1
Displayed as histogram columns
This shows raw real-time activity and helps confirm:
Breakout strength
Fake moves
Liquidity zones
🔹 4. Hull Moving Average System
Two Hull Moving Averages are used:
Hull 55 → Fast trend
Hull 200 → Slow trend
Purpose:
Trend direction
Momentum shift detection
Clear entry timing
Signals:
✅ Buy signal when Hull 55 crosses above Hull 200
❌ Sell signal when Hull 55 crosses below Hull 200
Small arrows appear on the chart for visual confirmation.
🔹 5. Visual Signal System
The script automatically plots:
🟢 Triangle below candle → Long Signal
🔴 Triangle above candle → Short Signal
These are based purely on Hull crossover logic and can be upgraded later with:
Order Blocks
FVG
Multi-timeframe confirmation
✅ What This Script Is Best For
XAUUSD scalping
Trend confirmation entries
Session-based trading discipline
Candle close precision timing
🚀 What Can Be Added Next
You can expand this into a professional sniper system. Options:
✅ Advanced Order Blocks (Smart Money)
✅ Fair Value Gap zones with mitigation
✅ Multi-timeframe logic (1m → 4H)
✅ Entry + SL + TP automation
✅ Alert system for mobile
✅ Risk management panel
Tell me what you want next:
Just reply with one option or describe your goal, for example:
“Add Smart Money Order Blocks” or
“Make this a full XAUUSD sniper strategy”
You're building a powerful system step-by-step 💹🔥
noufer, [11/23/2025 4:32 PM]
Disclaimer:
This indicator is created strictly for educational and paper trading purposes only. It is not intended as financial advice or a guaranteed trading system. Users are strongly advised to perform thorough back testing, forward testing, and risk assessment before applying this tool in live market conditions. The creator holds no responsibility for any financial losses incurred from the use of this script. Trade at your own risk.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.