OPEN-SOURCE SCRIPT
Momentum Permission + VWAP + RelVol (Clean)

//version=5
indicator("Momentum Permission + VWAP + RelVol (Clean)", overlay=true)
// ──────────────────────────────────────────────
// Inputs
// ──────────────────────────────────────────────
smaLength = input.int(50, "SMA Length")
relVolThresh = input.float(1.3, "Relative Volume Threshold")
// ──────────────────────────────────────────────
// Core Calculations
// ──────────────────────────────────────────────
sma50 = ta.sma(close, smaLength)
vwap = ta.vwap(close)
relVol = volume / ta.sma(volume, 10)
crossUp = ta.crossover(close, sma50)
// Trend conditions
aboveSMA = close > sma50
aboveVWAP = close > vwap
relStrong = relVol > relVolThresh
// ──────────────────────────────────────────────
// One-Time Daily Trend Permission Logic
// ──────────────────────────────────────────────
var bool permission = false
// Reset permission at start of each session
if ta.change(time("D"))
permission := false
trendStart = crossUp and aboveVWAP and relStrong and not permission
if trendStart
permission := true
// ──────────────────────────────────────────────
// Entry Trigger Logic (Breakout Continuation)
// ──────────────────────────────────────────────
entryTrigger = (
permission and
aboveSMA and
aboveVWAP and
relStrong and
close > high[1] // breakout of prior candle high
)
// ──────────────────────────────────────────────
// Plots
// ──────────────────────────────────────────────
// Trend filters
plot(sma50, title="SMA50", color=color.orange, linewidth=2)
plot(vwap, title="VWAP", color=color.new(color.blue, 0), linewidth=2)
// Permission (one-time trend start)
plotshape(
trendStart,
title="Trend Permission",
style=shape.triangleup,
location=location.belowbar,
color=color.new(color.green, 0),
size=size.large,
text="PERMIT"
)
// Entry trigger (continuation entry)
plotshape(
entryTrigger,
title="Entry Trigger",
style=shape.triangleup,
location=location.abovebar,
color=color.new(color.aqua, 0),
size=size.normal,
text="ENTRY"
)
indicator("Momentum Permission + VWAP + RelVol (Clean)", overlay=true)
// ──────────────────────────────────────────────
// Inputs
// ──────────────────────────────────────────────
smaLength = input.int(50, "SMA Length")
relVolThresh = input.float(1.3, "Relative Volume Threshold")
// ──────────────────────────────────────────────
// Core Calculations
// ──────────────────────────────────────────────
sma50 = ta.sma(close, smaLength)
vwap = ta.vwap(close)
relVol = volume / ta.sma(volume, 10)
crossUp = ta.crossover(close, sma50)
// Trend conditions
aboveSMA = close > sma50
aboveVWAP = close > vwap
relStrong = relVol > relVolThresh
// ──────────────────────────────────────────────
// One-Time Daily Trend Permission Logic
// ──────────────────────────────────────────────
var bool permission = false
// Reset permission at start of each session
if ta.change(time("D"))
permission := false
trendStart = crossUp and aboveVWAP and relStrong and not permission
if trendStart
permission := true
// ──────────────────────────────────────────────
// Entry Trigger Logic (Breakout Continuation)
// ──────────────────────────────────────────────
entryTrigger = (
permission and
aboveSMA and
aboveVWAP and
relStrong and
close > high[1] // breakout of prior candle high
)
// ──────────────────────────────────────────────
// Plots
// ──────────────────────────────────────────────
// Trend filters
plot(sma50, title="SMA50", color=color.orange, linewidth=2)
plot(vwap, title="VWAP", color=color.new(color.blue, 0), linewidth=2)
// Permission (one-time trend start)
plotshape(
trendStart,
title="Trend Permission",
style=shape.triangleup,
location=location.belowbar,
color=color.new(color.green, 0),
size=size.large,
text="PERMIT"
)
// Entry trigger (continuation entry)
plotshape(
entryTrigger,
title="Entry Trigger",
style=shape.triangleup,
location=location.abovebar,
color=color.new(color.aqua, 0),
size=size.normal,
text="ENTRY"
)
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.