How to Build TradingView Custom Screener Pine Script
Look, I get it. You're tired of scrolling through hundreds of charts looking for that perfect setup. What if I told you there's a way to let TradingView do the heavy lifting while you grab a coffee?

What's a Pine Script Screener Anyway?
Think of it as your personal trading assistant that never sleeps. A Pine Script screener is basically a custom program you write that automatically scans through your watchlists, looking for specific patterns or conditions you care about.
Instead of manually checking if Apple hit oversold levels while also being above its 200-day moving average, your screener does it for you. Across hundreds of stocks. In seconds.
Why Bother Building Your Own?
Here's the thing - TradingView's built-in screeners are fine, but they're pretty basic. It's like using a butter knife when you need a scalpel.
- You get exactly what you want: Your screener finds the exact setups you trade, not some generic "momentum" filter
- Speed matters: Scan thousands of symbols faster than you can say "oversold bounce"
- Never miss a setup: Set up alerts so opportunities don't slip by while you're sleeping
- Test your ideas: See how your screening criteria would have performed historically
The Easy Way: Using Pineify's No-Code Builder

Honestly, if you're not into coding, Pineify makes this ridiculously simple. Just pick "Screener" when you're creating a new script, add your symbols and indicators, and boom - you've got a working screener. No syntax headaches, no debugging nightmares.

But if you want to understand what's happening under the hood (or build something more custom), let's dive into the manual approach.
What You'll Need to Get Started
Before we jump in, make sure you've got:
- TradingView Pro+ subscription - Yeah, screeners aren't free. Trust me, it's worth it.
- Some Pine Script basics - You don't need to be a coding wizard, but knowing variables from functions helps
- A clear idea of what you're looking for - "Good stocks" isn't specific enough. "Oversold stocks in uptrends with volume spikes" is better.
Setting Up Your First Screener
Here's the step-by-step process (don't worry, it's easier than it sounds):
- Enable the screener feature - Go to your TradingView favorites and turn on the Pine Screener Beta
- Create your script - In the Pine Editor, make sure to add
screener=trueto your indicator declaration - Test it out - Open any watchlist, hit the "Scan" button, and watch your screener work its magic
If you're new to Pine Script, you might want to check out our Pine Script v6 cheat sheet to get familiar with the basics first.
Your First Real Screener (That Actually Works)
//@version=5
indicator("Oversold Bounce Screener", screener=true)
// Calculate our indicators
rsiValue = ta.rsi(close, 14)
sma200 = ta.sma(close, 200)
avgVol = ta.sma(volume, 20)
// Define what we're looking for
oversold = rsiValue < 30 // RSI below 30 (oversold)
uptrend = close > sma200 // Price above 200-day moving average
volSpike = volume > avgVol * 1.2 // Volume 20% above average
// Our final signal
signal = oversold and uptrend and volSpike
// Display the results
plot(signal ? 1 : 0, style=plot.style_columns, color=signal ? color.green : color.red)
alertcondition(signal, title="Buy Signal", message="{{ticker}} is oversold above 200-SMA with volume spike")
What this does: It finds stocks that are oversold (RSI below 30) but still in an uptrend (above their 200-day moving average) with unusual volume activity. These are often good bounce candidates.
Taking Your Screener to the Next Level
Once you've got the basics down, here are some tricks that'll make your screener way more powerful:
- Scan custom symbol lists: Use
array.from()andrequest.security()to check specific stocks you care about - Smart watchlists: Connect your alerts to external services that update your watchlists based on earnings, news, or other events
- Layered filtering: Set up multiple alert conditions for different signal strengths (weak, medium, strong)
For more advanced Pine Script techniques, check out our guide on Pine Script v6 strategy examples - it covers some patterns you can adapt for screening.
Multi-Timeframe Screening (The Good Stuff)
Here's where things get interesting. Instead of just looking at one timeframe, you can check multiple timeframes to find stronger setups.
Think about it: A stock might look oversold on the 1-hour chart, but if the daily trend is still bullish, that's a much better setup than if the daily is also tanking.
//@version=5
indicator("Multi-Timeframe Screener", screener=true)
// Check the daily trend (is it bullish?)
dailyTrend = request.security(syminfo.tickerid, "1D", ta.ema(close, 20) > ta.ema(close, 50))
// Check hourly momentum (not overbought?)
hourlyRSI = request.security(syminfo.tickerid, "1H", ta.rsi(close, 14))
// Current timeframe setup (price and volume action)
currentSetup = close > ta.sma(close, 20) and volume > ta.sma(volume, 10) * 1.5
// All conditions must be true
signal = dailyTrend and hourlyRSI < 70 and currentSetup
plot(signal ? 1 : 0, style=plot.style_columns, color=signal ? color.green : color.red)
Don't Ignore Volume (Seriously)
Volume tells you if other people actually care about the move. A breakout on 10 shares? Probably not worth your time. A breakout with 10x normal volume? Now we're talking.
Here are the volume patterns worth screening for:
- Volume spikes: When volume is way above average (usually 1.5x or more)
- Volume-weighted indicators: Like VWAP - shows where the smart money is
- Accumulation patterns: Steady volume increases over time (institutions building positions)
Making Your Screener Actually Useful
Keep It Simple (At First)
I see too many people trying to build the perfect screener with 15 different conditions. Start simple. Get something working. Then add complexity.
Test Everything
Your screener might look great in theory, but how did it perform last month? Last year? During the 2020 crash? Backtest your logic before you trust it with real money.
For more on testing trading strategies, our profit factor trading guide covers how to measure if your setups are actually profitable.
Two Screener Patterns That Actually Work
The Breakout Hunter
This one finds stocks breaking out of sideways action with volume confirmation:
//@version=5
indicator("Breakout Screener", screener=true)
// Look for 20-day highs and average volume
high20 = ta.highest(high, 20)
avgVol = ta.sma(volume, 20)
// What we're looking for:
priceBreakout = close > high20[1] // New 20-day high
volumeConfirmation = volume > avgVol * 1.5 // Volume spike
recentConsolidation = ta.atr(14) < ta.sma(ta.atr(14), 50) // Was consolidating
// All conditions must be true
signal = priceBreakout and volumeConfirmation and recentConsolidation
plot(signal ? 1 : 0, style=plot.style_columns, color=signal ? color.green : color.red)
The Mean Reversion Play
This finds oversold stocks in uptrends (my personal favorite):
//@version=5
indicator("Mean Reversion Screener", screener=true)
// Our indicators
ema50 = ta.ema(close, 50)
rsi = ta.rsi(close, 14)
bb_lower = ta.bb(close, 20, 2)[2]
// What we want:
uptrend = close > ema50 // Still in uptrend
oversold = rsi < 30 // But oversold
nearSupport = close <= bb_lower * 1.02 // Near Bollinger Band support
// Perfect storm for a bounce
signal = uptrend and oversold and nearSupport
plot(signal ? 1 : 0, style=plot.style_columns, color=signal ? color.green : color.red)
Setting Up Alerts (Don't Miss the Good Ones)
The whole point of a screener is that it works while you're not watching. Set up alerts so you get notified when your screener finds something interesting.
Here's what I recommend:
- Email alerts for important setups
- Mobile notifications for urgent signals
- Custom messages that tell you exactly what triggered (don't just say "alert" - say "AAPL oversold bounce setup")
If you're using other indicators in your trading, you might want to check out our guide on free TradingView indicators to see what else you can incorporate into your screening logic.
Common Mistakes (Learn From My Pain)
Too Many Conditions
I used to build screeners with 10+ conditions. They never found anything because I made them too specific. Start with 3-4 conditions max.
Ignoring Market Context
Your breakout screener might work great in bull markets but get destroyed in bear markets. Consider adding market regime filters.
Not Testing Enough
That screener that looks amazing on paper? Test it across different time periods, market conditions, and sectors before you trust it.
Frequently Asked Questions
Q: How many symbols can I scan at once? A: This depends on your TradingView plan, but Pro+ allows you to scan up to 100 symbols at once. Higher plans allow more.
Q: Can I use screeners on crypto and forex, or just stocks? A: Pine Script screeners work on any market TradingView supports - stocks, crypto, forex, commodities, you name it.
Q: My screener is running slowly. How can I speed it up? A: Keep your logic simple, avoid unnecessary calculations, and don't request too much historical data. Complex screeners with many conditions will naturally run slower.
Q: Can I backtest my screener results? A: Not directly, but you can copy your screener logic into a strategy script to see how the signals would have performed historically.
Q: What's the difference between a screener and a regular indicator?
A: A screener is designed to scan multiple symbols and find matches, while a regular indicator analyzes just the current chart. Screeners use screener=true in their declaration.
Wrapping Up
Building Pine Script screeners isn't rocket science, but it's not exactly plug-and-play either. Start simple - maybe just RSI and moving averages - then build from there.
The real magic happens when you stop manually hunting through charts and let your screener do the work. Yeah, it takes some time to set up, but once you've got a screener that consistently finds the setups you trade, you'll wonder how you ever lived without it.
Remember: a screener is only as good as the logic behind it. Spend time understanding what makes your trading setups work, then translate that into code. Test everything. And don't try to build the perfect screener on day one - build something that works, then make it better.
Your future self (and your trading account) will thank you for putting in the effort now.

