OPEN-SOURCE SCRIPT
Momentum Permission + Pivot Entry + Exit (v1.4 FULL)

//version=5
indicator("Momentum Permission + Pivot Entry + Exit (v1.4 FULL)", overlay=true)
// ──────────────────────────────────────────────
// Inputs
// ──────────────────────────────────────────────
smaLength = input.int(50, "SMA Length")
relVolThresh = input.float(1.3, "Relative Volume Threshold")
pivotLookback = input.int(3, "Pivot Lookback Bars")
// ──────────────────────────────────────────────
// Core Calculations
// ──────────────────────────────────────────────
sma50 = ta.sma(close, smaLength)
vwap = ta.vwap(close)
relVol = volume / ta.sma(volume, 10)
aboveSMA = close > sma50
aboveVWAP = close > vwap
relStrong = relVol > relVolThresh
greenCandle = close > open
crossUp = ta.crossover(close, sma50)
// ──────────────────────────────────────────────
// One-Time Daily Permission
// ──────────────────────────────────────────────
var bool permission = false
if ta.change(time("D"))
permission := false
permitSignal = crossUp and aboveVWAP and relStrong and not permission
if permitSignal
permission := true
// ──────────────────────────────────────────────
// Entry: Pivot Break Continuation
// ──────────────────────────────────────────────
pivotHighBreak = close > ta.highest(high[1], pivotLookback)
entrySignal = (
permission and
aboveSMA and
aboveVWAP and
relStrong and
greenCandle and
pivotHighBreak
)
// ──────────────────────────────────────────────
// Exit: Trend Exhaustion / VWAP Breakdown
// ──────────────────────────────────────────────
smaChange = sma50 - sma50[1]
exitSignal = (
permission and
close < vwap and
close < open and
relStrong and
smaChange < 0
)
// ──────────────────────────────────────────────
// VISUAL PLOTS (same as before)
// ──────────────────────────────────────────────
plot(sma50, title="SMA50", color=color.orange, linewidth=2)
plot(vwap, title="VWAP", color=color.new(color.blue, 0), linewidth=2)
plotshape(
permitSignal,
title="Trend Permission",
style=shape.triangleup,
location=location.belowbar,
color=color.new(color.green, 0),
size=size.large,
text="PERMIT"
)
plotshape(
entrySignal,
title="Entry Trigger",
style=shape.triangleup,
location=location.abovebar,
color=color.new(color.aqua, 0),
size=size.normal,
text="ENTRY"
)
plotshape(
exitSignal,
title="Exit Signal",
style=shape.triangledown,
location=location.abovebar,
color=color.new(color.red, 0),
size=size.large,
text="EXIT"
)
// ──────────────────────────────────────────────
// SCREENER OUTPUT (persistent 0/1 for the day)
// ──────────────────────────────────────────────
var bool permitToday = false
var bool entryToday = false
var bool exitToday = false
if ta.change(time("D"))
permitToday := false
entryToday := false
exitToday := false
if permitSignal
permitToday := true
if entrySignal
entryToday := true
if exitSignal
exitToday := true
// Hidden plots for screener columns
plot(permitToday ? 1 : 0, title="PERMIT", display=display.none)
plot(entryToday ? 1 : 0, title="ENTRY", display=display.none)
plot(exitToday ? 1 : 0, title="EXIT", display=display.none)
// Alerts
alertcondition(permitSignal, title="PERMIT", message="Momentum PERMISSION fired")
alertcondition(entrySignal, title="ENTRY", message="Momentum ENTRY fired")
alertcondition(exitSignal, title="EXIT", message="Momentum EXIT fired")
indicator("Momentum Permission + Pivot Entry + Exit (v1.4 FULL)", overlay=true)
// ──────────────────────────────────────────────
// Inputs
// ──────────────────────────────────────────────
smaLength = input.int(50, "SMA Length")
relVolThresh = input.float(1.3, "Relative Volume Threshold")
pivotLookback = input.int(3, "Pivot Lookback Bars")
// ──────────────────────────────────────────────
// Core Calculations
// ──────────────────────────────────────────────
sma50 = ta.sma(close, smaLength)
vwap = ta.vwap(close)
relVol = volume / ta.sma(volume, 10)
aboveSMA = close > sma50
aboveVWAP = close > vwap
relStrong = relVol > relVolThresh
greenCandle = close > open
crossUp = ta.crossover(close, sma50)
// ──────────────────────────────────────────────
// One-Time Daily Permission
// ──────────────────────────────────────────────
var bool permission = false
if ta.change(time("D"))
permission := false
permitSignal = crossUp and aboveVWAP and relStrong and not permission
if permitSignal
permission := true
// ──────────────────────────────────────────────
// Entry: Pivot Break Continuation
// ──────────────────────────────────────────────
pivotHighBreak = close > ta.highest(high[1], pivotLookback)
entrySignal = (
permission and
aboveSMA and
aboveVWAP and
relStrong and
greenCandle and
pivotHighBreak
)
// ──────────────────────────────────────────────
// Exit: Trend Exhaustion / VWAP Breakdown
// ──────────────────────────────────────────────
smaChange = sma50 - sma50[1]
exitSignal = (
permission and
close < vwap and
close < open and
relStrong and
smaChange < 0
)
// ──────────────────────────────────────────────
// VISUAL PLOTS (same as before)
// ──────────────────────────────────────────────
plot(sma50, title="SMA50", color=color.orange, linewidth=2)
plot(vwap, title="VWAP", color=color.new(color.blue, 0), linewidth=2)
plotshape(
permitSignal,
title="Trend Permission",
style=shape.triangleup,
location=location.belowbar,
color=color.new(color.green, 0),
size=size.large,
text="PERMIT"
)
plotshape(
entrySignal,
title="Entry Trigger",
style=shape.triangleup,
location=location.abovebar,
color=color.new(color.aqua, 0),
size=size.normal,
text="ENTRY"
)
plotshape(
exitSignal,
title="Exit Signal",
style=shape.triangledown,
location=location.abovebar,
color=color.new(color.red, 0),
size=size.large,
text="EXIT"
)
// ──────────────────────────────────────────────
// SCREENER OUTPUT (persistent 0/1 for the day)
// ──────────────────────────────────────────────
var bool permitToday = false
var bool entryToday = false
var bool exitToday = false
if ta.change(time("D"))
permitToday := false
entryToday := false
exitToday := false
if permitSignal
permitToday := true
if entrySignal
entryToday := true
if exitSignal
exitToday := true
// Hidden plots for screener columns
plot(permitToday ? 1 : 0, title="PERMIT", display=display.none)
plot(entryToday ? 1 : 0, title="ENTRY", display=display.none)
plot(exitToday ? 1 : 0, title="EXIT", display=display.none)
// Alerts
alertcondition(permitSignal, title="PERMIT", message="Momentum PERMISSION fired")
alertcondition(entrySignal, title="ENTRY", message="Momentum ENTRY fired")
alertcondition(exitSignal, title="EXIT", message="Momentum EXIT fired")
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.