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")
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.