Advertisement

Pine Code

๐Ÿ“ˆ NIFTY50 SmartSignal Pro – AI Dashboard for Instant Market Insights! ๐Ÿ’น๐Ÿš€


//@version=5
indicator("๐Ÿ“ˆNIFTY50 SmartSignal Pro – Instant Market Insights!)", overlay=true, max_labels_count=500, max_lines_count=500)
//“Track 10 top NSE stocks & indices in real-time. EMA, VWAP, PDH/PDL, RSI + AI-powered final score – all in ONE dashboard. Make faster, smarter trading moves! ๐Ÿš€๐Ÿ’น”
//“Breakouts, trends, PDH/PDL, EMA cross & AI-powered final signals – all in one view! ⚡๐Ÿ”ฅ”
//“Real-time signals, breakout alerts & final AI score. Make decisions at lightning speed! ๐Ÿš€๐Ÿ“Š”
//“Monitor 10 NSE stocks, EMA/VWAP trends & get AI score for every trade. Trade like a pro! ๐Ÿง ๐Ÿ’น”
// “From confusion to clarity — AI tells you where smart money is moving.” ๐Ÿ’น

// ===== SYMBOL INPUTS =====
sym1  = input.symbol("NSE:NIFTY",     "Symbol 1")
sym2  = input.symbol("NSE:BANKNIFTY", "Symbol 2")
sym3  = input.symbol("NSE:HDFCBANK",  "Symbol 3")
sym4  = input.symbol("NSE:RELIANCE",  "Symbol 4")
sym5  = input.symbol("NSE:INFY",      "Symbol 5")
sym6  = input.symbol("NSE:TCS",       "Symbol 6")
sym7  = input.symbol("NSE:ICICIBANK", "Symbol 7")
sym8  = input.symbol("NSE:SBIN",      "Symbol 8")
sym9  = input.symbol("NSE:ITC",       "Symbol 9")
sym10 = input.symbol("NSE:AXISBANK",  "Symbol 10")

// ===== Chart Symbol Data =====
chartSym = syminfo.tickerid
[ema9, ema15, vwap, c] = request.security(chartSym, timeframe.period, [ta.ema(close, 9), ta.ema(close, 15), ta.vwap, close])

// ===== Plot EMA + VWAP =====
plot(ema9,  title="EMA 9",  color=color.green, linewidth=2)
plot(ema15, title="EMA 15", color=color.red,   linewidth=2)
plot(vwap,  title="VWAP",   color=color.blue,  linewidth=2, style=plot.style_line)

// ===== Buy / Sell Arrows (Unique) =====
buyCond  = ta.crossover(ema9, ema15)
sellCond = ta.crossunder(ema9, ema15)
var string lastSignal = "NONE"

if buyCond and lastSignal != "BUY"
    lastSignal := "BUY"
    label.new(bar_index, low, "๐Ÿš€ BUY", color=color.green, style=label.style_label_up, textcolor=color.white, size=size.large)

if sellCond and lastSignal != "SELL"
    lastSignal := "SELL"
    label.new(bar_index, high, "๐Ÿ”ป SELL", color=color.red, style=label.style_label_down, textcolor=color.white, size=size.large)

// ===== Dashboard Table =====
var table dash = table.new(position.top_right, 9, 11, border_width=1)

if barstate.isfirst
    table.cell(dash, 0, 0, "SYMBOL",   text_color=color.white, bgcolor=color.gray)
    table.cell(dash, 1, 0, "LTP",      text_color=color.white, bgcolor=color.gray)
    table.cell(dash, 2, 0, "% CHANGE", text_color=color.white, bgcolor=color.gray)
    table.cell(dash, 3, 0, "RSI",      text_color=color.white, bgcolor=color.gray)
    table.cell(dash, 4, 0, "LEVEL",    text_color=color.white, bgcolor=color.gray)
    table.cell(dash, 5, 0, "PDH/PDL",  text_color=color.white, bgcolor=color.gray)
    table.cell(dash, 6, 0, "EMA 9/15", text_color=color.white, bgcolor=color.gray)
    table.cell(dash, 7, 0, "VWAP",     text_color=color.white, bgcolor=color.gray)
    table.cell(dash, 8, 0, "FINAL",    text_color=color.white, bgcolor=color.gray)

// ===== Function to Fill Each Row =====
f_fill_row(row, sym) =>
    cur = request.security(sym, timeframe.period, close)

    // Previous Day High/Low
    [prevClose, prevHigh, prevLow] = request.security(sym, "D", [close[1], high[1], low[1]])

    // % Change
    chg = (na(prevClose) or prevClose == 0) ? na : ((cur - prevClose) / prevClose) * 100
    chgColor = (not na(chg) and chg >= 0) ? color.green : color.red

   // RSI
    rsi = na(cur) ? na : ta.rsi(cur, 14)


    // === Level + Signal ===
    lvl = ""
    sig = "NO TRADE"
    sigColor = color.orange

    if not na(prevHigh) and cur > prevHigh
        lvl := "Above PDH"
        sig := "Break ↑"
        sigColor := color.green
    else if not na(prevLow) and cur < prevLow
        lvl := "Below PDL"
        sig := "Break ↓"
        sigColor := color.red
    else if not na(prevHigh) and not na(prevLow) and cur <= prevHigh and cur >= prevLow
        lvl := "Inside Range"
        sig := "Range"
        sigColor := color.orange
    else
        lvl := "N/A"
        sig := "NO TRADE"
        sigColor := color.gray

    // EMA & VWAP
    [e9, e15, vwp] = request.security(sym, timeframe.period, [ta.ema(close,9), ta.ema(close,15), ta.vwap])
    emaSig = e9 > e15 ? "BUY" : e9 < e15 ? "SELL" : "NEUTRAL"
    emaColor = e9 > e15 ? color.green : e9 < e15 ? color.red : color.orange

    vwapColor = cur > vwp ? color.green : cur < vwp ? color.red : color.gray

    // AI Final Score
    aiScore = 50
    if sig == "Break ↑" and emaSig == "BUY"
        aiScore := 85
    else if sig == "Break ↓" and emaSig == "SELL"
        aiScore := 15
    else
        aiScore := 50

    finalSig = (sig == "Break ↑" and emaSig == "BUY") ? "๐Ÿ”ฅ BUY" : 
               (sig == "Break ↓" and emaSig == "SELL") ? "❌ SELL" : "⚖️ NEUTRAL"
    finalText = finalSig + " | Score: " + str.tostring(aiScore)
    finalColor = finalSig == "๐Ÿ”ฅ BUY" ? color.green : finalSig == "❌ SELL" ? color.red : color.orange

    // Fill Table
    table.cell(dash, 0, row, str.replace_all(sym, "NSE:", ""), text_color=color.white, bgcolor=color.black)
    table.cell(dash, 1, row, na(cur) ? "-" : str.tostring(cur, format.mintick), text_color=color.white, bgcolor=color.black)
    table.cell(dash, 2, row, na(chg) ? "-" : str.tostring(chg, "#.##") + "%", text_color=color.white, bgcolor=chgColor)
    table.cell(dash, 3, row, na(rsi) ? "-" : str.tostring(rsi, "#.##"), text_color=color.white, bgcolor=color.black)
    table.cell(dash, 4, row, lvl, text_color=color.white, bgcolor=sigColor)
    table.cell(dash, 5, row, sig, text_color=color.white, bgcolor=sigColor)
    table.cell(dash, 6, row, emaSig, text_color=color.white, bgcolor=emaColor)
    table.cell(dash, 7, row, na(vwp) ? "-" : str.tostring(vwp, format.mintick), text_color=color.white, bgcolor=vwapColor)
    table.cell(dash, 8, row, finalText, text_color=color.white, bgcolor=finalColor)

// ===== Fill Rows =====
f_fill_row(1, sym1)
f_fill_row(2, sym2)
f_fill_row(3, sym3)
f_fill_row(4, sym4)
f_fill_row(5, sym5)
f_fill_row(6, sym6)
f_fill_row(7, sym7)
f_fill_row(8, sym8)
f_fill_row(9, sym9)
f_fill_row(10, sym10)

// ===== Chart Background Final Signal =====
prevHighChart = request.security(chartSym, "D", high[1])
prevLowChart  = request.security(chartSym, "D", low[1])

finalSigChart = "⚖️ NEUTRAL"
if (not na(c)) and (not na(prevHighChart)) and (not na(prevLowChart))
    if (c >= prevHighChart) and (ema9 > ema15)
        finalSigChart := "๐Ÿ”ฅ BUY"
    else if (c <= prevLowChart) and (ema9 < ema15)
        finalSigChart := "❌ SELL"

bgCol = finalSigChart == "๐Ÿ”ฅ BUY" ? color.new(color.green, 85) :
         finalSigChart == "❌ SELL" ? color.new(color.red, 85) :
         color.new(color.orange, 88)

bgcolor(bgCol)

// === PDH & PDL Lines ===
pdh_chart = request.security(syminfo.tickerid, "D", high[1], lookahead=barmerge.lookahead_on)
pdl_chart = request.security(syminfo.tickerid, "D", low[1],  lookahead=barmerge.lookahead_on)

plot(pdh_chart, title="PDH", color=color.green, linewidth=2, style=plot.style_line)
plot(pdl_chart, title="PDL", color=color.red,    linewidth=2, style=plot.style_line)

// ===== EMA200 TREND LINE =====
ema200 = ta.ema(close, 200)
plot(ema200, title="Trend EMA200", color=close > ema200 ? color.green : color.red, linewidth=4)

// ==========================================================================================

// === Dashboard with Telegram Link ===
var table myTable = table.new(position.top_center, 1, 1, border_width=1, frame_color=color.black, bgcolor=color.white)

// Add Telegram Message to Dashboard
table.cell(myTable, 0, 0, "Contact Me ๐Ÿ“ฑ 9713466747", bgcolor=color.blue, text_color=color.white, text_size=size.large)

Code Block 2 (CSS)


/* Paste your CSS code here */

Code Block 3 (JavaScript)


// Paste your JavaScript code here

Code Block 4 (Python)


# Paste your Python code here

Code Block 5 (Java)


// Paste your Java code here

Code Block 6 (C++)


// Paste your C++ code here

Code Block 7 (SQL)


-- Paste your SQL code here

Code Block 8 (Bash)


# Paste your Bash/Shell code here

Code Block 9 (JSON)


{
  "key": "value"
  /* Paste your JSON here */
}

Code Block 10 (XML)



Code Block 11 (PHP)



Post a Comment

0 Comments