Indicator · Pine Script v5 · On the chart

Trend + Scalp + Stop Signals

by Ershubhambhagat

A price-chart indicator that shows VWAP, a central pivot range, three EMAs, Supertrend and previous-day levels, then scores conditions to print trend signals, scalp signals and stop or exit signals.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code538
Settings19inputs
LicenceNone statedfile: MPL-2.0
Last update5 months ago31 May 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

538 lines of Pine Script v5 from Indicator/multi_indicator_v4.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

multi_indicator_v4.pine
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0
// https://mozilla.org/MPL/2.0/

//@version=5
indicator("Trend + Scalp + Stop Signals", 
     shorttitle="Confluence V4", 
     overlay=true,
     max_labels_count=300,
     max_lines_count=100)

// ════════════════════════════════════════════════════════════════════════════
// SECTION 1: INPUT SETTINGS
// ════════════════════════════════════════════════════════════════════════════

grp_display = "═══ DISPLAY SETTINGS ═══"
showVWAP = input.bool(true, "Show VWAP", group=grp_display)
showCPR = input.bool(true, "Show CPR", group=grp_display)
showEMA = input.bool(true, "Show EMA Lines", group=grp_display)
showSupertrend = input.bool(true, "Show Supertrend", group=grp_display)
showPrevDayHL = input.bool(false, "Show Prev Day High/Low", group=grp_display)
showSignalTable = input.bool(true, "Show Dashboard", group=grp_display)
showTrendSignals = input.bool(true, "Show TREND Signals", group=grp_display)
showScalpSignals = input.bool(true, "Show SCALP Signals", group=grp_display)
showStopSignals = input.bool(true, "Show STOP/EXIT Signals", group=grp_display)

grp_signal = "═══ SIGNAL THRESHOLDS ═══"
minTrendScore = input.int(15, "Min TREND Score", minval=10, maxval=25, group=grp_signal)
minScalpScore = input.int(12, "Min SCALP Score", minval=8, maxval=20, group=grp_signal)

grp_ema = "═══ EMA SETTINGS ═══"
emaFastLen = input.int(9, "Fast EMA", minval=3, maxval=50, group=grp_ema)
emaMedLen = input.int(21, "Medium EMA", minval=10, maxval=100, group=grp_ema)
emaSlowLen = input.int(50, "Slow EMA", minval=20, maxval=200, group=grp_ema)

grp_st = "═══ SUPERTREND SETTINGS ═══"
stATRPeriod = input.int(10, "ATR Period", minval=5, maxval=20, group=grp_st)
stMultiplier = input.float(3.0, "Multiplier", minval=1.0, maxval=5.0, step=0.5, group=grp_st)

grp_sl = "═══ TARGET & STOP LOSS ═══"
scalpTarget = input.int(30, "Scalp Target (Points)", minval=10, maxval=50, group=grp_sl)
trendTarget = input.int(50, "Trend Target (Points)", minval=30, maxval=200, group=grp_sl)
slPoints = input.int(25, "Stop Loss (Points)", minval=10, maxval=50, group=grp_sl)


// ════════════════════════════════════════════════════════════════════════════
// SECTION 2: INDICATOR CALCULATIONS
// ════════════════════════════════════════════════════════════════════════════

// VWAP
vwapValue = ta.vwap(hlc3)
priceAboveVWAP = close > vwapValue
priceBelowVWAP = close < vwapValue

// CPR (Previous Day)
prevDayHigh = request.security(syminfo.tickerid, "D", high[1], lookahead=barmerge.lookahead_on)
prevDayLow = request.security(syminfo.tickerid, "D", low[1], lookahead=barmerge.lookahead_on)
prevDayClose = request.security(syminfo.tickerid, "D", close[1], lookahead=barmerge.lookahead_on)

pivotPoint = (prevDayHigh + prevDayLow + prevDayClose) / 3
bc = (prevDayHigh + prevDayLow) / 2
tc = (pivotPoint - bc) + pivotPoint

priceAboveTC = close > tc
priceBelowBC = close < bc
priceAbovePP = close > pivotPoint

// EMA
emaFast = ta.ema(close, emaFastLen)
emaMed = ta.ema(close, emaMedLen)
emaSlow = ta.ema(close, emaSlowLen)

emaBullishStack = emaFast > emaMed and emaMed > emaSlow
emaBearishStack = emaFast < emaMed and emaMed < emaSlow
priceAboveFastEMA = close > emaFast
priceBelowFastEMA = close < emaFast
emaBullishCross = ta.crossover(emaFast, emaMed)
emaBearishCross = ta.crossunder(emaFast, emaMed)
fastEMARising = emaFast > emaFast[2]
fastEMAFalling = emaFast < emaFast[2]

// RSI
rsiValue = ta.rsi(close, 14)
rsiOverbought = rsiValue > 70
rsiOversold = rsiValue < 30
rsiBullish = rsiValue > 50
rsiBearish = rsiValue < 50
rsiRising = rsiValue > rsiValue[2]
rsiFalling = rsiValue < rsiValue[2]

// MACD
[macdLine, signalLine, histLine] = ta.macd(close, 12, 26, 9)
macdBullish = macdLine > signalLine
macdBearish = macdLine < signalLine
macdBullishCross = ta.crossover(macdLine, signalLine)
macdBearishCross = ta.crossunder(macdLine, signalLine)
macdHistRising = histLine > histLine[1]
macdHistFalling = histLine < histLine[1]

// Supertrend
[supertrend, direction] = ta.supertrend(stMultiplier, stATRPeriod)
stBullish = direction < 0
stBearish = direction > 0
stFlipBullish = direction < 0 and direction[1] > 0
stFlipBearish = direction > 0 and direction[1] < 0

// Stochastic
stochK = ta.sma(ta.stoch(close, high, low, 14), 3)
stochD = ta.sma(stochK, 3)
stochBullish = stochK > stochD
stochBearish = stochK < stochD
stochOversold = stochK < 20
stochOverbought = stochK > 80
stochBullishCross = ta.crossover(stochK, stochD)
stochBearishCross = ta.crossunder(stochK, stochD)

// ADX
[diPlus, diMinus, adxValue] = ta.dmi(14, 14)
isTrending = adxValue > 20
adxBullish = diPlus > diMinus
adxBearish = diMinus > diPlus

// Volume
volSMA = ta.sma(volume, 20)
isHighVolume = volume > volSMA * 1.2
isBullishCandle = close > open
isBearishCandle = close < open

// Price Action
higherHigh = high > high[1]
higherLow = low > low[1]
lowerHigh = high < high[1]
lowerLow = low < low[1]
twoBullishCandles = close > open and close[1] > open[1]
twoBearishCandles = close < open and close[1] < open[1]

// ATR
atrValue = ta.atr(14)


// ════════════════════════════════════════════════════════════════════════════
// SECTION 3: TREND SIGNAL SCORING
// ════════════════════════════════════════════════════════════════════════════

// TREND CALL Score
trendCallScore = 0
trendCallScore += priceAboveVWAP ? 3 : 0
trendCallScore += priceAboveTC ? 3 : 0
trendCallScore += emaBullishStack ? 3 : 0
trendCallScore += macdBullish ? 2 : 0
trendCallScore += stBullish ? 3 : 0
trendCallScore += adxBullish and isTrending ? 2 : 0
trendCallScore += rsiBullish and not rsiOverbought ? 2 : 0
trendCallScore += stochBullish ? 1 : 0
trendCallScore += isHighVolume and isBullishCandle ? 1 : 0
trendCallScore += emaBullishCross ? 2 : 0
trendCallScore += macdBullishCross ? 2 : 0
trendCallScore += stFlipBullish ? 3 : 0

// TREND PUT Score
trendPutScore = 0
trendPutScore += priceBelowVWAP ? 3 : 0
trendPutScore += priceBelowBC ? 3 : 0
trendPutScore += emaBearishStack ? 3 : 0
trendPutScore += macdBearish ? 2 : 0
trendPutScore += stBearish ? 3 : 0
trendPutScore += adxBearish and isTrending ? 2 : 0
trendPutScore += rsiBearish and not rsiOversold ? 2 : 0
trendPutScore += stochBearish ? 1 : 0
trendPutScore += isHighVolume and isBearishCandle ? 1 : 0
trendPutScore += emaBearishCross ? 2 : 0
trendPutScore += macdBearishCross ? 2 : 0
trendPutScore += stFlipBearish ? 3 : 0


// ════════════════════════════════════════════════════════════════════════════
// SECTION 4: SCALP SIGNAL SCORING (For catching bounces/reversals)
// ════════════════════════════════════════════════════════════════════════════

// SCALP CALL Score (momentum turning UP)
scalpCallScore = 0
scalpCallScore += fastEMARising ? 2 : 0
scalpCallScore += rsiRising ? 2 : 0
scalpCallScore += macdHistRising ? 2 : 0
scalpCallScore += priceAboveFastEMA ? 2 : 0
scalpCallScore += rsiOversold ? 3 : 0
scalpCallScore += stochOversold ? 2 : 0
scalpCallScore += stochBullishCross ? 3 : 0
scalpCallScore += higherLow ? 2 : 0
scalpCallScore += twoBullishCandles ? 2 : 0
scalpCallScore += isBullishCandle and isHighVolume ? 2 : 0
scalpCallScore += stFlipBullish ? 4 : 0
scalpCallScore += macdBullishCross ? 3 : 0
scalpCallScore += emaBullishCross ? 2 : 0

// SCALP PUT Score (momentum turning DOWN)
scalpPutScore = 0
scalpPutScore += fastEMAFalling ? 2 : 0
scalpPutScore += rsiFalling ? 2 : 0
scalpPutScore += macdHistFalling ? 2 : 0
scalpPutScore += priceBelowFastEMA ? 2 : 0
scalpPutScore += rsiOverbought ? 3 : 0
scalpPutScore += stochOverbought ? 2 : 0
scalpPutScore += stochBearishCross ? 3 : 0
scalpPutScore += lowerHigh ? 2 : 0
scalpPutScore += twoBearishCandles ? 2 : 0
scalpPutScore += isBearishCandle and isHighVolume ? 2 : 0
scalpPutScore += stFlipBearish ? 4 : 0
scalpPutScore += macdBearishCross ? 3 : 0
scalpPutScore += emaBearishCross ? 2 : 0


// ════════════════════════════════════════════════════════════════════════════
// SECTION 5: SIGNAL DETERMINATION
// ════════════════════════════════════════════════════════════════════════════

// Trend Signals
isTrendCall = trendCallScore >= minTrendScore and trendCallScore > trendPutScore + 5
isTrendPut = trendPutScore >= minTrendScore and trendPutScore > trendCallScore + 5

// Scalp Signals
isScalpCall = scalpCallScore >= minScalpScore and scalpCallScore > scalpPutScore + 4
isScalpPut = scalpPutScore >= minScalpScore and scalpPutScore > scalpCallScore + 4

// New signal detection
newTrendCall = isTrendCall and not isTrendCall[1]
newTrendPut = isTrendPut and not isTrendPut[1]
newScalpCall = isScalpCall and not isScalpCall[1]
newScalpPut = isScalpPut and not isScalpPut[1]


// ════════════════════════════════════════════════════════════════════════════
// SECTION 6: STOP/EXIT SIGNAL LOGIC (KEY NEW FEATURE)
// ════════════════════════════════════════════════════════════════════════════

// Track active positions
var bool inCallPosition = false
var bool inPutPosition = false
var float callEntryPrice = na
var float putEntryPrice = na
var int callEntryBar = na
var int putEntryBar = na

// Enter positions on signals
if newTrendCall or newScalpCall
    inCallPosition := true
    inPutPosition := false
    callEntryPrice := close
    callEntryBar := bar_index
    putEntryPrice := na

if newTrendPut or newScalpPut
    inPutPosition := true
    inCallPosition := false
    putEntryPrice := close
    putEntryBar := bar_index
    callEntryPrice := na

// ─────────────────────────────────────────────────────────────────────────────
// STOP CONDITIONS FOR CALL POSITION
// ─────────────────────────────────────────────────────────────────────────────
stopCallCondition = false
callStopReason = ""

if inCallPosition and not na(callEntryPrice)
    // 1. Price hit stop loss
    if close < callEntryPrice - slPoints
        stopCallCondition := true
        callStopReason := "SL HIT"
    
    // 2. Supertrend flipped bearish
    if stFlipBearish
        stopCallCondition := true
        callStopReason := "ST FLIP"
    
    // 3. Strong bearish reversal (multiple indicators flip)
    bearishCount = 0
    bearishCount += priceBelowVWAP ? 1 : 0
    bearishCount += macdBearish and macdBearish[1] == false ? 1 : 0
    bearishCount += emaBearishCross ? 1 : 0
    bearishCount += twoBearishCandles ? 1 : 0
    if bearishCount >= 3
        stopCallCondition := true
        callStopReason := "REVERSAL"
    
    // 4. Price closed below entry with 2 bearish candles
    if close < callEntryPrice and twoBearishCandles
        stopCallCondition := true
        callStopReason := "WEAK"

// ─────────────────────────────────────────────────────────────────────────────
// STOP CONDITIONS FOR PUT POSITION
// ─────────────────────────────────────────────────────────────────────────────
stopPutCondition = false
putStopReason = ""

if inPutPosition and not na(putEntryPrice)
    // 1. Price hit stop loss
    if close > putEntryPrice + slPoints
        stopPutCondition := true
        putStopReason := "SL HIT"
    
    // 2. Supertrend flipped bullish
    if stFlipBullish
        stopPutCondition := true
        putStopReason := "ST FLIP"
    
    // 3. Strong bullish reversal (multiple indicators flip)
    bullishCount = 0
    bullishCount += priceAboveVWAP ? 1 : 0
    bullishCount += macdBullish and macdBullish[1] == false ? 1 : 0
    bullishCount += emaBullishCross ? 1 : 0
    bullishCount += twoBullishCandles ? 1 : 0
    if bullishCount >= 3
        stopPutCondition := true
        putStopReason := "REVERSAL"
    
    // 4. Price closed above entry with 2 bullish candles
    if close > putEntryPrice and twoBullishCandles
        stopPutCondition := true
        putStopReason := "WEAK"

// Exit positions
if stopCallCondition
    inCallPosition := false
    callEntryPrice := na

if stopPutCondition
    inPutPosition := false
    putEntryPrice := na

// Target hit detection
callTargetHit = inCallPosition and not na(callEntryPrice) and close >= callEntryPrice + scalpTarget
putTargetHit = inPutPosition and not na(putEntryPrice) and close <= putEntryPrice - scalpTarget

if callTargetHit
    inCallPosition := false
    callEntryPrice := na

if putTargetHit
    inPutPosition := false
    putEntryPrice := na


// ════════════════════════════════════════════════════════════════════════════
// SECTION 7: PLOTTING
// ════════════════════════════════════════════════════════════════════════════

// VWAP
plot(showVWAP ? vwapValue : na, "VWAP", color=color.new(#2962FF, 0), linewidth=2)

// CPR
plot(showCPR ? pivotPoint : na, "PP", color=color.new(#FFA726, 0), linewidth=1, style=plot.style_cross)
plot(showCPR ? bc : na, "BC", color=color.new(#FF6D00, 0), linewidth=1)
plot(showCPR ? tc : na, "TC", color=color.new(#FF6D00, 0), linewidth=1)

// EMAs
plot(showEMA ? emaFast : na, "EMA 9", color=color.new(#00E676, 0), linewidth=2)
plot(showEMA ? emaMed : na, "EMA 21", color=color.new(#2196F3, 0), linewidth=2)
plot(showEMA ? emaSlow : na, "EMA 50", color=color.new(#FF9800, 0), linewidth=2)

// Supertrend
stColor = stBullish ? color.new(#00E676, 0) : color.new(#FF1744, 0)
plot(showSupertrend ? supertrend : na, "Supertrend", color=stColor, linewidth=2, style=plot.style_linebr)

// Prev Day High/Low
plot(showPrevDayHL ? prevDayHigh : na, "PDH", color=color.new(#FF1744, 50), linewidth=1, style=plot.style_linebr)
plot(showPrevDayHL ? prevDayLow : na, "PDL", color=color.new(#00E676, 50), linewidth=1, style=plot.style_linebr)


// ════════════════════════════════════════════════════════════════════════════
// SECTION 8: SIGNAL DASHBOARD
// ════════════════════════════════════════════════════════════════════════════

var table dashboard = table.new(position.top_left, 2, 18, bgcolor=color.new(#1E1E1E, 10), border_width=1, border_color=#404040)

if showSignalTable and barstate.islast
    // Header
    table.cell(dashboard, 0, 0, "═══ CONFLUENCE V4 ═══", bgcolor=#2A2A2A, text_color=#FFFFFF, text_size=size.small)
    table.merge_cells(dashboard, 0, 0, 1, 0)
    
    // TREND Scores
    table.cell(dashboard, 0, 1, "─── TREND ───", text_color=#AAAAAA, text_size=size.tiny)
    table.merge_cells(dashboard, 0, 1, 1, 1)
    
    trendCallColor = trendCallScore >= 20 ? #00FF00 : trendCallScore >= 15 ? #66FF66 : #808080
    table.cell(dashboard, 0, 2, "CALL:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 2, str.tostring(trendCallScore), text_color=trendCallColor, text_size=size.tiny)
    
    trendPutColor = trendPutScore >= 20 ? #FF0000 : trendPutScore >= 15 ? #FF6666 : #808080
    table.cell(dashboard, 0, 3, "PUT:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 3, str.tostring(trendPutScore), text_color=trendPutColor, text_size=size.tiny)
    
    // SCALP Scores
    table.cell(dashboard, 0, 4, "─── SCALP ───", text_color=#AAAAAA, text_size=size.tiny)
    table.merge_cells(dashboard, 0, 4, 1, 4)
    
    scalpCallColor = scalpCallScore >= 15 ? #00FFFF : scalpCallScore >= 12 ? #66FFFF : #808080
    table.cell(dashboard, 0, 5, "CALL:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 5, str.tostring(scalpCallScore), text_color=scalpCallColor, text_size=size.tiny)
    
    scalpPutColor = scalpPutScore >= 15 ? #FF00FF : scalpPutScore >= 12 ? #FF66FF : #808080
    table.cell(dashboard, 0, 6, "PUT:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 6, str.tostring(scalpPutScore), text_color=scalpPutColor, text_size=size.tiny)
    
    // Position Status
    table.cell(dashboard, 0, 7, "─── POSITION ───", text_color=#AAAAAA, text_size=size.tiny)
    table.merge_cells(dashboard, 0, 7, 1, 7)
    
    posStatus = inCallPosition ? "IN CALL" : inPutPosition ? "IN PUT" : "FLAT"
    posColor = inCallPosition ? #00FF00 : inPutPosition ? #FF0000 : #808080
    table.cell(dashboard, 0, 8, "Status:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 8, posStatus, text_color=posColor, text_size=size.tiny)
    
    // Entry Price
    entryPx = inCallPosition ? callEntryPrice : inPutPosition ? putEntryPrice : na
    table.cell(dashboard, 0, 9, "Entry:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 9, na(entryPx) ? "-" : str.tostring(entryPx, format.mintick), text_color=#FFFFFF, text_size=size.tiny)
    
    // P&L
    pnl = inCallPosition and not na(callEntryPrice) ? close - callEntryPrice : 
          inPutPosition and not na(putEntryPrice) ? putEntryPrice - close : 0
    pnlColor = pnl > 0 ? #00FF00 : pnl < 0 ? #FF0000 : #808080
    table.cell(dashboard, 0, 10, "P&L:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 10, str.tostring(pnl, "#.##") + " pts", text_color=pnlColor, text_size=size.tiny)
    
    // Indicators
    table.cell(dashboard, 0, 11, "─── STATUS ───", text_color=#AAAAAA, text_size=size.tiny)
    table.merge_cells(dashboard, 0, 11, 1, 11)
    
    table.cell(dashboard, 0, 12, "VWAP:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 12, priceAboveVWAP ? "↑" : "↓", text_color=priceAboveVWAP ? #00FF00 : #FF0000, text_size=size.tiny)
    
    table.cell(dashboard, 0, 13, "EMA:", text_color=#CCCCCC, text_size=size.tiny)
    emaStatus = emaBullishStack ? "↑↑" : emaBearishStack ? "↓↓" : "→"
    table.cell(dashboard, 1, 13, emaStatus, text_color=emaBullishStack ? #00FF00 : emaBearishStack ? #FF0000 : #FFFF00, text_size=size.tiny)
    
    table.cell(dashboard, 0, 14, "ST:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 14, stBullish ? "↑" : "↓", text_color=stBullish ? #00FF00 : #FF0000, text_size=size.tiny)
    
    table.cell(dashboard, 0, 15, "MACD:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 15, macdBullish ? "↑" : "↓", text_color=macdBullish ? #00FF00 : #FF0000, text_size=size.tiny)
    
    table.cell(dashboard, 0, 16, "RSI:", text_color=#CCCCCC, text_size=size.tiny)
    rsiStatus = rsiOversold ? "OS" : rsiOverbought ? "OB" : str.tostring(rsiValue, "#")
    table.cell(dashboard, 1, 16, rsiStatus, text_color=rsiOversold ? #00FF00 : rsiOverbought ? #FF0000 : #FFFFFF, text_size=size.tiny)
    
    table.cell(dashboard, 0, 17, "ADX:", text_color=#CCCCCC, text_size=size.tiny)
    table.cell(dashboard, 1, 17, str.tostring(adxValue, "#"), text_color=isTrending ? #00FF00 : #FFA500, text_size=size.tiny)


// ════════════════════════════════════════════════════════════════════════════
// SECTION 9: SIGNAL LABELS
// ════════════════════════════════════════════════════════════════════════════

// TREND CALL (Green)
if showTrendSignals and newTrendCall
    label.new(bar_index, low, "TREND\nCALL\n" + str.tostring(trendCallScore), 
              style=label.style_label_up, color=#00E676, textcolor=#FFFFFF, size=size.small)

// TREND PUT (Red)
if showTrendSignals and newTrendPut
    label.new(bar_index, high, "TREND\nPUT\n" + str.tostring(trendPutScore), 
              style=label.style_label_down, color=#FF1744, textcolor=#FFFFFF, size=size.small)

// SCALP CALL (Cyan)
if showScalpSignals and newScalpCall
    label.new(bar_index, low, "SCALP\nCALL\n" + str.tostring(scalpCallScore), 
              style=label.style_label_up, color=#00BCD4, textcolor=#FFFFFF, size=size.small)

// SCALP PUT (Magenta)
if showScalpSignals and newScalpPut
    label.new(bar_index, high, "SCALP\nPUT\n" + str.tostring(scalpPutScore), 
              style=label.style_label_down, color=#E91E63, textcolor=#FFFFFF, size=size.small)

// ═══════════════════════════════════════════════════════════════════════════
// STOP/EXIT SIGNALS (Yellow/Orange)
// ════════════════════════════════════════════════════════════════════════════

// STOP CALL - Exit long position
if showStopSignals and stopCallCondition
    label.new(bar_index, high, "⚠️ STOP\nCALL\n" + callStopReason, 
              style=label.style_label_down, color=#FF9800, textcolor=#000000, size=size.small)

// STOP PUT - Exit short position
if showStopSignals and stopPutCondition
    label.new(bar_index, low, "⚠️ STOP\nPUT\n" + putStopReason, 
              style=label.style_label_up, color=#FF9800, textcolor=#000000, size=size.small)

// TARGET HIT Labels
if showStopSignals and callTargetHit
    label.new(bar_index, high, "✓ TARGET\nHIT", 
              style=label.style_label_down, color=#4CAF50, textcolor=#FFFFFF, size=size.tiny)

if showStopSignals and putTargetHit
    label.new(bar_index, low, "✓ TARGET\nHIT", 
              style=label.style_label_up, color=#4CAF50, textcolor=#FFFFFF, size=size.tiny)

// Supertrend Flip Labels
if stFlipBullish
    label.new(bar_index, low, "ST↑", style=label.style_label_up, 
              color=color.new(#00E676, 50), textcolor=#FFFFFF, size=size.tiny)

if stFlipBearish
    label.new(bar_index, high, "ST↓", style=label.style_label_down, 
              color=color.new(#FF1744, 50), textcolor=#FFFFFF, size=size.tiny)


// ════════════════════════════════════════════════════════════════════════════
// SECTION 10: BACKGROUND HIGHLIGHTING
// ════════════════════════════════════════════════════════════════════════════

// Position background
bgcolor(inCallPosition ? color.new(#00FF00, 95) : na, title="In Call Position")
bgcolor(inPutPosition ? color.new(#FF0000, 95) : na, title="In Put Position")

// RSI Extreme zones
bgcolor(rsiOversold ? color.new(#00FF00, 92) : na, title="RSI Oversold")
bgcolor(rsiOverbought ? color.new(#FF0000, 92) : na, title="RSI Overbought")


// ════════════════════════════════════════════════════════════════════════════
// SECTION 11: ALERTS
// ════════════════════════════════════════════════════════════════════════════

alertcondition(newTrendCall, title="1. TREND CALL", message="{{ticker}} TREND CALL at {{close}}")
alertcondition(newTrendPut, title="2. TREND PUT", message="{{ticker}} TREND PUT at {{close}}")
alertcondition(newScalpCall, title="3. SCALP CALL", message="{{ticker}} SCALP CALL at {{close}}")
alertcondition(newScalpPut, title="4. SCALP PUT", message="{{ticker}} SCALP PUT at {{close}}")
alertcondition(stopCallCondition, title="5. ⚠️ STOP CALL", message="{{ticker}} EXIT CALL position!")
alertcondition(stopPutCondition, title="6. ⚠️ STOP PUT", message="{{ticker}} EXIT PUT position!")
alertcondition(callTargetHit, title="7. ✓ CALL Target Hit", message="{{ticker}} CALL target reached!")
alertcondition(putTargetHit, title="8. ✓ PUT Target Hit", message="{{ticker}} PUT target reached!")
alertcondition(stFlipBullish, title="9. Supertrend Bullish", message="{{ticker}} ST flipped bullish")
alertcondition(stFlipBearish, title="10. Supertrend Bearish", message="{{ticker}} ST flipped bearish")

// ════════════════════════════════════════════════════════════════════════════
// END OF SCRIPT
// ════════════════════════════════════════════════════════════════════════════

Overview

Minimum score thresholds for trend and scalp signals are adjustable, as are the fixed point distances used for scalp target, trend target and stop loss. A dashboard summarizes the state. The central pivot range uses daily data requested with lookahead and a one-bar offset.

Details

Published by

Ershubhambhagat on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Trend, Scalping, Support & resistance

Markets

Indices

Timeframes

M1-M5, M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Show VWAPbooltrueshowVWAP
Show CPRbooltrueshowCPR
Show EMA LinesbooltrueshowEMA
Show SupertrendbooltrueshowSupertrend
Show Prev Day High/LowboolfalseshowPrevDayHL
Show DashboardbooltrueshowSignalTable
Show TREND SignalsbooltrueshowTrendSignals
Show SCALP SignalsbooltrueshowScalpSignals
Show STOP/EXIT SignalsbooltrueshowStopSignals
Min TREND Scoreint15minTrendScore
Min SCALP Scoreint12minScalpScore
Fast EMAint9emaFastLen
Show all 19 settings
SettingTypeDefaultVariable
Medium EMAint21emaMedLen
Slow EMAint50emaSlowLen
ATR Periodint10stATRPeriod
Multiplierfloat3.0stMultiplier
Scalp Target (Points)int30scalpTarget
Trend Target (Points)int50trendTarget
Stop Loss (Points)int25slPoints
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

6 stars

Wick Rejection S/R Strategy identifies key support and resistance zones based on candlestick wick rejections and liquidity sweeps directly on the price chart. It calculates potential reversal and breakout retest zones using configurable wick thresholds, level

Indicator v5 Support & resistanceSMC / ICT / price action
Updated 7 months ago · None stated GitHub repository of Wick Rejection S/R Strategy

Scalping PullBack Tool R1.1

by Ahmed-GoCode
5 stars

This indicator plots a Price Action Channel (PAC) based on high, low, and close moving averages alongside fast, medium, and slow trend EMAs directly on the price chart. It detects regular and Bill Williams fractals to track market structure and identifies pull

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Scalping PullBack Tool R1.1

This indicator evaluates multiple technical trading strategies and strategy combinations across various timeframes to identify the top-performing setup for Turkish stocks and other assets. Depending on whether the active chart is intraday or higher timeframe,

Indicator v5 Screeners & dashboardsTrend
3 stars

The River Strategy with SuperScalper plots custom Bollinger Bands to form a price channel on the main chart overlay. It identifies breakout conditions when price bars clear the channel boundaries to generate entry, stop loss, and multi-tier take profit levels.

Indicator v5 Volatility & bandsSupport & resistance Repaints
Updated 12 months ago · None stated GitHub repository of River Strategy with SuperScalper by Leo

Sniper Algo

by TamTH-Dev
2 stars

Sniper Algo is a multi-indicator technical analysis suite that plots directly on the main price chart. It integrates Ichimoku Kinko Hyo components, automated support and resistance zones, dual exponential moving averages, and optional buy and sell signals. Use

Indicator v5 TrendSupport & resistance
Updated 5 weeks ago · None stated GitHub repository of Sniper Algo
575 stars

This indicator detects equal highs and lows by comparing prices within user-defined left and right bars using a tolerance percentage. It plots horizontal lines on the price chart for equal highs in one color and lows in another. A screener allows input of mult

Indicator v5 Support & resistanceTrend
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows with Screener

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers