TradingView
Daveatt
2021년 3월 31일 오전 9시 1분

Ultimate Screener Template 

RUNE / TetherUSBinance

설명

Hello Traders

With the Ultimate Strategy Template, I shared a template to connect any indicator to this template and get backtesting results in less than a few minutes

Now sharing another template ... many traders ask me to develop for them a screener/scanner based on a custom indicator on TradingView.

The current TradingView screeners are great but don't allow for much customization; as we can only select pre-defined filters

I don't know when we'll be able to natively screen among hundreds of assets with a custom indicator... then.... I created this template for the time being.... which should


A whole new world


The Ultimate Screener Template screens over 38 securities.

What's very cool is that you'll only need to create 1 alert to scan over 38 securities: Explanation with this image here

I totally understand that not all TradingView accounts have a lot of alarms; with this template, you can multiply the number of custom alerts you're initially allowed to.


What if I need to set alerts on more than 38 securities?


Pretty straightforward... you can create alerts only if the indicator is added to your chart first.

So if you need let's say 100 securities, add this indicator 3 times on your chart (38*3 > 100) and then... edit the securities for your 3 indicators


How to update your Screener settings


Alert mode


As per Pinescript reference, this template allows setting the alert frequency

Possible values are:

- alert.freq_all (all function calls trigger the alert)
- alert.freq_once_per_bar (the first function call during the bar triggers the alert)
- alert.freq_once_per_bar_close (the function call triggers the alert only when it occurs during the last script iteration of the real-time bar when it closes).


All-time-high and All-time-low


This template shows how to capture ATH and ATL alerts across many securities

I used the functions from Quantnomad: tradingview.com/script/y7dz7QKN-Kozlod-All-time-high-low-alerts/

Whenever a new ATH or ATL is made, the screener will send a personalized alarm with a personalized text based on the security triggering this alarm

The code is pretty straightforward and shows you the part you'll need to update to transform your favorite custom indicator into a powerful screener.


If anything is unclear in the code, please leave a comment and I'll respond as soon as possible


All the best
Dave
코멘트
Benedick
Hi @Daveatt ,

I would like to insert the screener function for "MACD histogram slope up/ slope down".
Basically I am quoting a MACD slope indicator script by tmyerskerr, as below:

//@version=3
study(title="Moving Average Convergence/Divergence Slope", shorttitle="MACD Slope", precision=8)
source = close
radians_to_degrees=180/3.14159265359
fastLength = input(12, minval=1), slowLength=input(26,minval=1)
signalLength=input(9,minval=1)
lookback_period=input(defval=5,title="Lookback periods",type=integer)
smoothing=input(defval=8,minval=2,title="Smoothing",type=integer)
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
macd = fastMA - slowMA
signal = ema(macd, signalLength)
histogram = macd - signal
macd_slope = radians_to_degrees*atan((macd[0]-nz(macd[lookback_period]))/lookback_period)
signal_slope = radians_to_degrees*atan((signal[0]-nz(signal[lookback_period]))/lookback_period)
histogram_slope = radians_to_degrees*atan((histogram[0]-nz(histogram[lookback_period]))/lookback_period)
plot(linreg(macd_slope, smoothing, 0), color=#FF0099, transp=0, title="MACD Slope")
plot(signal_slope, color=teal, transp=0, title="Signal Slope")
plot(linreg(histogram_slope, smoothing, 0), style=area, color=white, transp=95, title="Histogram Slope")
hline(0, color=white)

May I know how to insert into your script above?

Many Thanks in advance.
AtomOfScent
This looks very promising, thanks. :)

Not having custom indicator support makes the screener 1/10th as useful for me.

FYI, if anyone wants to upvote this as a feature request on the Tradingview Reddit, here's the link. ;)
reddit.com/r/TradingView/comments/it6gwm/feature_request_custom_stock_screener/
AtomOfScent
I'm having a bit of an issue replacing the example functions with my own.
@Daveatt (or anyone else) would you be able to provide an example for a function with arguments?

i.e if my function is:
rsx(src, _length)

How would I change the "h1, l1" line (73) to return the rsx value for t1?

Thanks in advance!
Daveatt
@AtomOfScent, what is the result returned by rsx?
is that a kind of RSI?
AtomOfScent
@Daveatt, yes it's an improved RSI created by Mark Jurik and returns similar results. The code is here (I just made it into a function).
tradingview.com/script/o4zx8PNC-RSX-D-ID-AC-P/

Perhaps the security values need to be assigned to variables first, then calling the function using those?
Daveatt
@AtomOfScent,

my_rsx = rsx(close, len) // assuming you want the security of the same period than the chart rsx1 = security(t1, timeframe.period, my_rsx) rsx2 = security(t2, timeframe.period, my_rsx) ... rsx38 = security(t38, timeframe.period, my_rsx)
AtomOfScent
@Daveatt, thank you, I'll give that a shot :)
anurag167
@Daveatt, Sir,
I am novice to pinescript.

Can you please post complete indicator so we Novice traders can use.
Daveatt
@anurag167, there is in this script post description, please read it
mohanee
@AtomOfScent,

See the line number 64 and 65
더보기