TradingView

How to create a custom screener in TradingView?

How to create a custom screener in TradingView?

TradingView is limited in some ways and unfortunately, it’s not possible to create a custom screener in TradingView using standard features.

However, you can create a simple screener using PineScript, receive screener filters as alerts, and even resend them to the telegram. Here I will show you how you can do that.

Here you can find a simple example you can use to create your own screener: https://www.tradingview.com/script/QKgb0Fud-Custom-Screener-with-Alerts-QuantNomad/

When you add it to the chart, you might notice that it’s a strategy. I was able to create this script using the recently announced alerts on strategies in TradingView. I created a dummy strategy that executes an order for every bar and you can use alert on this strategy to send yourself the result of the screener.

You can find in inputs 40 symbols you can use for this screener (40 is a limitation of PineSript for the max number of security calls).

Screener custom condition you can find in screenerFunc() function. For example:

// Screener Function
screenerFunc() => 
    rsi  = rsi(close, rsi_length) // Value
    cond = rsi > rsi_overbought   // Condition
    [rsi, cond]

To create your own screener you need to add to this function functionality you need. As you can see the logic of this function is pretty simple, I calculate RSI and boolean condition that RSI is overbought and I return both values [rsi, cond].

In screener, I will display symbol if the condition is true and I will display the returned value as well:

Its pretty simple to change that function, here is an example to find out if your products are above MA:

// Screener Function
screenerFunc() => 
    ma  = sma(close, 200) // Value
    cond = close > ma     // Condition
    [ma, cond]

I think you got the point, it’s pretty basic. However, you can make it much more complicated, and even return multiple values and conditions if you want (for that you need to adjust other code in this indicator).

This screener is executed for the same timeframe as your current chart’s timeframe and it checked only once at bar’s close.

To create an alert based on it you can add it to the chart, then create alerts as if you create this alert from a strategy. Use {{strategy.order.alert_message}}  placeholder as an alert message and you will receive screener as an alert.

You probably noticed that I have #telegram hashtag in my screener message. It allows me to resend my alerts from TradingView to my Telegram. Below you can find a video with details about it.


Follow me on TradingView and YouTube.

This image has an empty alt attribute; its file name is wide.png

You can find more details about this screener in my video:


Creating alerts from strategies in TradingView:


Sending TradingView Alerts to Telegram in few clicks (Alertatron)

Pine Script Programming Courses
Pine Script Programming Courses
Learn to build your own TradingView Indicators and Strategies
Sidebar Signup Form
If you want to be the first in this business, subscribe to the latest news