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
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.