OPEN-SOURCE SCRIPT
My script

// version=6
indicator("ORB-FVG-Sweep Alert", overlay=true)
start = input.session("2300-2330", title="ORB session UTC")
level = input.float(2.0, "Min FVG size ($)")
// ---- ORB box ----
t = time(timeframe.period, start)
inRange = not na(t)
h = ta.valuewhen(inRange, high, 0)
l = ta.valuewhen(inRange, low, 0)
plot(inRange ? h : na, color=color.gray, style=plot.style_linebr)
plot(inRange ? l : na, color=color.gray, style=plot.style_linebr)
// ---- FVG detection (simplified) ----
fvg = (high[1] < low[3] and close[1] < open[1]) or (low[1] > high[3] and close[1] > open[1])
plotshape(fvg and math.abs(high[1]-low[3]) >= level, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.tiny, title="Bull FVG")
plotshape(fvg and math.abs(low[1]-high[3]) >= level, style=shape.triangledown,location=location.abovebar, color=color.red, size=size.tiny, title="Bear FVG")
// ---- Sweep of ORB high/low ----
sweepHigh = high > h and close < h and high[1] <= h
sweepLow = low < l and close > l and low[1] >= l
plotshape(sweepHigh, style=shape.arrowdown, location=location.abovebar, color=color.maroon, size=size.small, title="Sweep High")
plotshape(sweepLow, style=shape.arrowup, location=location.belowbar, color=color.green, size=size.small, title="Sweep Low")
// ---- Combined alert condition ----
alertcondition(sweepHigh and fvg, title="Short setup", message="ORB sweep+FVG short")
alertcondition(sweepLow and fvg, title="Long setup", message="ORB sweep+FVG long")
indicator("ORB-FVG-Sweep Alert", overlay=true)
start = input.session("2300-2330", title="ORB session UTC")
level = input.float(2.0, "Min FVG size ($)")
// ---- ORB box ----
t = time(timeframe.period, start)
inRange = not na(t)
h = ta.valuewhen(inRange, high, 0)
l = ta.valuewhen(inRange, low, 0)
plot(inRange ? h : na, color=color.gray, style=plot.style_linebr)
plot(inRange ? l : na, color=color.gray, style=plot.style_linebr)
// ---- FVG detection (simplified) ----
fvg = (high[1] < low[3] and close[1] < open[1]) or (low[1] > high[3] and close[1] > open[1])
plotshape(fvg and math.abs(high[1]-low[3]) >= level, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.tiny, title="Bull FVG")
plotshape(fvg and math.abs(low[1]-high[3]) >= level, style=shape.triangledown,location=location.abovebar, color=color.red, size=size.tiny, title="Bear FVG")
// ---- Sweep of ORB high/low ----
sweepHigh = high > h and close < h and high[1] <= h
sweepLow = low < l and close > l and low[1] >= l
plotshape(sweepHigh, style=shape.arrowdown, location=location.abovebar, color=color.maroon, size=size.small, title="Sweep High")
plotshape(sweepLow, style=shape.arrowup, location=location.belowbar, color=color.green, size=size.small, title="Sweep Low")
// ---- Combined alert condition ----
alertcondition(sweepHigh and fvg, title="Short setup", message="ORB sweep+FVG short")
alertcondition(sweepLow and fvg, title="Long setup", message="ORB sweep+FVG long")
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.