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

//version=5
indicator("Momentum Permission + Pivot Entry + Exit (v1.4)", overlay=true)
// ──────────────────────────────────────────────
// Inputs
// ──────────────────────────────────────────────
smaLength = input.int(50, "SMA Length")
relVolThresh = input.float(1.3, "Relative Volume Threshold")
pivotLookback = input.int(3, "Pivot Break Lookback")
// ──────────────────────────────────────────────
// Core Calculations
// ──────────────────────────────────────────────
sma50 = ta.sma(close, smaLength)
vwap = ta.vwap(close)
relVol = volume / ta.sma(volume, 10)
crossUp = ta.crossover(close, sma50)
aboveSMA = close > sma50
aboveVWAP = close > vwap
relStrong = relVol > relVolThresh
greenCandle = close > open
// ──────────────────────────────────────────────
// One-Time Daily Trend Permission
// ──────────────────────────────────────────────
var bool permission = false
if ta.change(time("D"))
permission := false
trendStart = crossUp and aboveVWAP and relStrong and not permission
if trendStart
permission := true
// ──────────────────────────────────────────────
// Pullback Pivot Breakout Entry (Continuation Long)
// ──────────────────────────────────────────────
pivotHighBreak = close > ta.highest(high[1], pivotLookback)
entryTrigger = (
permission and
aboveSMA and
aboveVWAP and
relStrong and
greenCandle and
pivotHighBreak
)
// ──────────────────────────────────────────────
// EXIT Signal (Trend Exhaustion)
// ──────────────────────────────────────────────
smaChange = sma50 - sma50[1]
exitSignal = (
permission and // only after trend started
close < vwap and // VWAP breakdown
close < open and // red candle body
relVol > relVolThresh and // volume spike on selling
smaChange < 0 // SMA turning down / flattening
)
// ──────────────────────────────────────────────
// Plots
// ──────────────────────────────────────────────
plot(sma50, title="SMA50", color=color.orange, linewidth=2)
plot(vwap, title="VWAP", color=color.new(color.blue, 0), linewidth=2)
// Permission marker (1 per day)
plotshape(
trendStart,
title="Trend Permission",
style=shape.triangleup,
location=location.belowbar,
color=color.new(color.green, 0),
size=size.large,
text="PERMIT"
)
// Entry trigger markers
plotshape(
entryTrigger,
title="Entry Trigger",
style=shape.triangleup,
location=location.abovebar,
color=color.new(color.aqua, 0),
size=size.normal,
text="ENTRY"
)
// EXIT marker (trend exhaustion)
plotshape(
exitSignal,
title="Exit Signal",
style=shape.triangledown,
location=location.abovebar,
color=color.new(color.red, 0),
size=size.large,
text="EXIT"
)
indicator("Momentum Permission + Pivot Entry + Exit (v1.4)", overlay=true)
// ──────────────────────────────────────────────
// Inputs
// ──────────────────────────────────────────────
smaLength = input.int(50, "SMA Length")
relVolThresh = input.float(1.3, "Relative Volume Threshold")
pivotLookback = input.int(3, "Pivot Break Lookback")
// ──────────────────────────────────────────────
// Core Calculations
// ──────────────────────────────────────────────
sma50 = ta.sma(close, smaLength)
vwap = ta.vwap(close)
relVol = volume / ta.sma(volume, 10)
crossUp = ta.crossover(close, sma50)
aboveSMA = close > sma50
aboveVWAP = close > vwap
relStrong = relVol > relVolThresh
greenCandle = close > open
// ──────────────────────────────────────────────
// One-Time Daily Trend Permission
// ──────────────────────────────────────────────
var bool permission = false
if ta.change(time("D"))
permission := false
trendStart = crossUp and aboveVWAP and relStrong and not permission
if trendStart
permission := true
// ──────────────────────────────────────────────
// Pullback Pivot Breakout Entry (Continuation Long)
// ──────────────────────────────────────────────
pivotHighBreak = close > ta.highest(high[1], pivotLookback)
entryTrigger = (
permission and
aboveSMA and
aboveVWAP and
relStrong and
greenCandle and
pivotHighBreak
)
// ──────────────────────────────────────────────
// EXIT Signal (Trend Exhaustion)
// ──────────────────────────────────────────────
smaChange = sma50 - sma50[1]
exitSignal = (
permission and // only after trend started
close < vwap and // VWAP breakdown
close < open and // red candle body
relVol > relVolThresh and // volume spike on selling
smaChange < 0 // SMA turning down / flattening
)
// ──────────────────────────────────────────────
// Plots
// ──────────────────────────────────────────────
plot(sma50, title="SMA50", color=color.orange, linewidth=2)
plot(vwap, title="VWAP", color=color.new(color.blue, 0), linewidth=2)
// Permission marker (1 per day)
plotshape(
trendStart,
title="Trend Permission",
style=shape.triangleup,
location=location.belowbar,
color=color.new(color.green, 0),
size=size.large,
text="PERMIT"
)
// Entry trigger markers
plotshape(
entryTrigger,
title="Entry Trigger",
style=shape.triangleup,
location=location.abovebar,
color=color.new(color.aqua, 0),
size=size.normal,
text="ENTRY"
)
// EXIT marker (trend exhaustion)
plotshape(
exitSignal,
title="Exit Signal",
style=shape.triangledown,
location=location.abovebar,
color=color.new(color.red, 0),
size=size.large,
text="EXIT"
)
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.