0% found this document useful (0 votes)
25 views4 pages

Screener 1

This document is a Pine Script for a trading indicator that screens stocks based on daily trend and momentum conditions. It checks for criteria such as high volume, moving averages, RSI levels, proximity to 52-week highs, and MACD signals. The results are displayed in a table and alerts are triggered when a ticker meets all specified conditions.

Uploaded by

fcgh383
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views4 pages

Screener 1

This document is a Pine Script for a trading indicator that screens stocks based on daily trend and momentum conditions. It checks for criteria such as high volume, moving averages, RSI levels, proximity to 52-week highs, and MACD signals. The results are displayed in a table and alerts are triggered when a ticker meets all specified conditions.

Uploaded by

fcgh383
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 4

//@version=5

indicator(" Screener - Strong Trend & Momentum (Daily Tracking)", overlay=true)

// 📌 **Daily Time Frame Data**

dailyClose = request.security(syminfo.tickerid, "D", close)

dailyHigh = request.security(syminfo.tickerid, "D", high)

dailyLow = request.security(syminfo.tickerid, "D", low)

dailyVolume = request.security(syminfo.tickerid, "D", volume)

// 📌 **Volume Filter (Min 100K)**

minVolume = 100000

highVolume = dailyVolume > minVolume

// 📌 **Moving Averages (Daily)**

sma5 = ta.sma(dailyClose, 5)

sma20 = ta.sma(dailyClose, 20)

sma50 = ta.sma(dailyClose, 50)

sma150 = ta.sma(dailyClose, 150)

sma200 = ta.sma(dailyClose, 200)

// 📌 **Trend Filters (Daily)**

trendUp = (sma5 > sma20) and (sma20 > sma50) and (sma50 > sma150) and (sma150 > sma200)

// 📌 **RSI Condition (Daily Momentum Strength)**

rsi = ta.rsi(dailyClose, 14)


rsiAbove70 = rsi > 70

rsiAbove55 = rsi > 55

// 📌 **52-Week High Criteria (Daily)**

high52 = ta.highest(dailyHigh, 252)

nearHigh = dailyClose > (high52 * 0.90) // Within 10% of 52-week high

// 📌 **Avoid Extended (>25% above 50-SMA)**

notExtended = dailyClose < (sma50 * 1.25)

// 📌 **MACD Calculation (Using Daily Data)**

[macdLine, signalLine, _] = request.security(syminfo.tickerid, "D", ta.macd(dailyClose, 12, 26, 9))

// **MACD Conditions**

macdBullish = macdLine > signalLine // MACD Crossover

macdAboveZero = macdLine > 0 // MACD Above Zero Line

// 🎯 **Final Screener Condition**

valid = highVolume and trendUp and rsiAbove70 and rsiAbove55 and nearHigh and notExtended and
macdBullish and macdAboveZero

// 📌 **Table for Screening Results**

var table resultTable = table.new(position=position.top_right, columns=8, rows=10)

// 📌 **Clear Table Every 5 Bars**

if bar_index % 5 == 0
table.clear(resultTable, 0, 0)

// **Table Header**

table.cell(resultTable, 0, 0, "Ticker", text_color=color.white)

table.cell(resultTable, 0, 1, "Volume > 100K", text_color=color.white)

table.cell(resultTable, 0, 2, "Uptrend", text_color=color.white)

table.cell(resultTable, 0, 3, "RSI > 70", text_color=color.white)

table.cell(resultTable, 0, 4, "RSI > 55", text_color=color.white)

table.cell(resultTable, 0, 5, "52W High", text_color=color.white)

table.cell(resultTable, 0, 6, "MACD Bullish", text_color=color.white)

table.cell(resultTable, 0, 7, "MACD > 0", text_color=color.white)

// **Data**

table.cell(resultTable, 1, 0, syminfo.ticker, text_color=color.white)

table.cell(resultTable, 1, 1, highVolume ? "✅ Yes" : "❌ No", text_color=highVolume ? color.green :


color.red)

table.cell(resultTable, 1, 2, trendUp ? "✅ Yes" : "❌ No", text_color=trendUp ? color.green : color.red)

table.cell(resultTable, 1, 3, rsiAbove70 ? "✅ Yes" : "❌ No", text_color=rsiAbove70 ? color.green :


color.red)

table.cell(resultTable, 1, 4, rsiAbove55 ? "✅ Yes" : "❌ No", text_color=rsiAbove55 ? color.green :


color.red)

table.cell(resultTable, 1, 5, nearHigh ? "✅ Yes" : "❌ No", text_color=nearHigh ? color.green : color.red)

table.cell(resultTable, 1, 6, macdBullish ? "✅ Yes" : "❌ No", text_color=macdBullish ? color.green :


color.red)

table.cell(resultTable, 1, 7, macdAboveZero ? "✅ Yes" : "❌ No", text_color=macdAboveZero ?


color.green : color.red)
// 📢 **Trigger Alerts When a Ticker Qualifies**

alertcondition(valid, title="Ticker Screener Alert", message="🚀 This Ticker meets all trend, volume,
momentum, and MACD conditions!")

You might also like