OPEN-SOURCE SCRIPT
SPX AbuBasel Scalping PRO – Stable

//version=5
indicator("SPX AbuBasel Scalping PRO – Stable", overlay=true, precision=2)
// ==== Inputs ====
lenRSI = input.int(7, "RSI Length")
tp1ATR = input.float(0.35, "TP1 ATR Factor", step=0.05)
tp2ATR = input.float(0.70, "TP2 ATR Factor", step=0.05)
tp3ATR = input.float(1.00, "TP3 ATR Factor", step=0.05)
slATR = input.float(0.45, "SL ATR Factor", step=0.05)
useVol = input.bool(true, "Use Volume Filter")
// ==== Indicators ====
rsi = ta.rsi(close, lenRSI)
vwap = ta.vwap
atr = ta.atr(14)
// Bollinger Bands
basis = ta.sma(close, 20)
dev = 2.0 * ta.stdev(close, 20)
upper = basis + dev
lower = basis - dev
// Volume filter
volOK = volume > ta.sma(volume, 20)
// Divergence
bullDiv = low < low[1] and rsi > rsi[1]
bearDiv = high > high[1] and rsi < rsi[1]
// Reversal candles
bullCandle = close > open and close > high[1]
bearCandle = close < open and close < low[1]
// VWAP slope
trendUp = vwap > vwap[2]
trendDown = vwap < vwap[2]
// ==== Entry Conditions ====
buySig = bullDiv and bullCandle and close > vwap and trendUp and (not useVol or volOK) and close < lower
sellSig = bearDiv and bearCandle and close < vwap and trendDown and (not useVol or volOK) and close > upper
// ==== Targets ====
tp1 = buySig ? close + atr * tp1ATR : sellSig ? close - atr * tp1ATR : na
tp2 = buySig ? close + atr * tp2ATR : sellSig ? close - atr * tp2ATR : na
tp3 = buySig ? close + atr * tp3ATR : sellSig ? close - atr * tp3ATR : na
sl = buySig ? close - atr * slATR : sellSig ? close + atr * slATR : na
// ==== Plot Signals ====
plotshape(buySig, title="BUY", style=shape.labelup, color=color.green, text="BUY", size=size.small)
plotshape(sellSig, title="SELL", style=shape.labeldown, color=color.red, text="SELL", size=size.small)
// ==== Draw Levels ====
if buySig or sellSig
line.new(bar_index, tp1, bar_index + 1, tp1, extend=extend.right, color=color.new(color.green, 0))
line.new(bar_index, tp2, bar_index + 1, tp2, extend=extend.right, color=color.new(color.lime, 0))
line.new(bar_index, tp3, bar_index + 1, tp3, extend=extend.right, color=color.new(color.green, 40))
line.new(bar_index, sl, bar_index + 1, sl, extend=extend.right, color=color.new(color.red, 0))
// ==== Alerts ====
alertcondition(buySig, "SPX BUY", "AbuBasel PRO: BUY Signal")
alertcondition(sellSig, "SPX SELL", "AbuBasel PRO: SELL Signal")
indicator("SPX AbuBasel Scalping PRO – Stable", overlay=true, precision=2)
// ==== Inputs ====
lenRSI = input.int(7, "RSI Length")
tp1ATR = input.float(0.35, "TP1 ATR Factor", step=0.05)
tp2ATR = input.float(0.70, "TP2 ATR Factor", step=0.05)
tp3ATR = input.float(1.00, "TP3 ATR Factor", step=0.05)
slATR = input.float(0.45, "SL ATR Factor", step=0.05)
useVol = input.bool(true, "Use Volume Filter")
// ==== Indicators ====
rsi = ta.rsi(close, lenRSI)
vwap = ta.vwap
atr = ta.atr(14)
// Bollinger Bands
basis = ta.sma(close, 20)
dev = 2.0 * ta.stdev(close, 20)
upper = basis + dev
lower = basis - dev
// Volume filter
volOK = volume > ta.sma(volume, 20)
// Divergence
bullDiv = low < low[1] and rsi > rsi[1]
bearDiv = high > high[1] and rsi < rsi[1]
// Reversal candles
bullCandle = close > open and close > high[1]
bearCandle = close < open and close < low[1]
// VWAP slope
trendUp = vwap > vwap[2]
trendDown = vwap < vwap[2]
// ==== Entry Conditions ====
buySig = bullDiv and bullCandle and close > vwap and trendUp and (not useVol or volOK) and close < lower
sellSig = bearDiv and bearCandle and close < vwap and trendDown and (not useVol or volOK) and close > upper
// ==== Targets ====
tp1 = buySig ? close + atr * tp1ATR : sellSig ? close - atr * tp1ATR : na
tp2 = buySig ? close + atr * tp2ATR : sellSig ? close - atr * tp2ATR : na
tp3 = buySig ? close + atr * tp3ATR : sellSig ? close - atr * tp3ATR : na
sl = buySig ? close - atr * slATR : sellSig ? close + atr * slATR : na
// ==== Plot Signals ====
plotshape(buySig, title="BUY", style=shape.labelup, color=color.green, text="BUY", size=size.small)
plotshape(sellSig, title="SELL", style=shape.labeldown, color=color.red, text="SELL", size=size.small)
// ==== Draw Levels ====
if buySig or sellSig
line.new(bar_index, tp1, bar_index + 1, tp1, extend=extend.right, color=color.new(color.green, 0))
line.new(bar_index, tp2, bar_index + 1, tp2, extend=extend.right, color=color.new(color.lime, 0))
line.new(bar_index, tp3, bar_index + 1, tp3, extend=extend.right, color=color.new(color.green, 40))
line.new(bar_index, sl, bar_index + 1, sl, extend=extend.right, color=color.new(color.red, 0))
// ==== Alerts ====
alertcondition(buySig, "SPX BUY", "AbuBasel PRO: BUY Signal")
alertcondition(sellSig, "SPX SELL", "AbuBasel PRO: SELL Signal")
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.