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")
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。