QuantNomad

Multiple Screeners with Alerts

I already published few version of my custom screeners. Unfortunately, because of TradingView's security function call limit you can't use more than 40 stocks in 1 screener.
Fortunately, you can compute multiple values in your function and screen few indicators at once.
In this script I show how you can compute 5 indicators at the same time for 40 instruments. I display then in different labels.
Every label consist of list of instruments satisfying current indicator conditions and a value for it. It can be absolute value as for RSI or -1/1 representing Bullish / Bearish event.
Also you can create 1 alert with result of all screeners inside.

In this example I took 5 indicators with following conditions:
  • RSI - "RSI < 30" or "RSI > 70"
  • TSI - "TSI < -30" or "RSI >30"
  • ADX - "ADX > 40"
  • MACD - "MACD Bullish Cross" or "MACD Bearish Cross" (1 and -1 in screener)
  • AO - "AO Crosses 0 UP" or "AO Crosses 0 DOWN" (1 and -1 in screener)

Params

  • - bars_apart - this parameter define how may bars apart you labels are on your chart. If you see labels overlapping, increase this number.
  • - Parameters for all used indicators
  • - 40 symbol inputs for instruments you want to use in this screener

Alerts

You can create an alert from it easily by selecting screener name from the list and then selecting "Any alert() function call".
No additional configuration is required, message and alert on close is generated in the code.
You should better change default name for your alert. Sometimes because of big amount of inputs you might receive an error.

Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as good as in historical backtesting.
This post and the script don’t provide any financial advice.
Mã nguồn mở

Với tinh thần của TradingView, tác giả đã xuất bản tập lệnh theo mã nguồn mở, vì thế trader có thể dễ dàng hiểu và tùy chỉnh được. Bạn có thể sử dụng miễn phí, hoặc tùy chỉnh lại mã đã được cấp phép bởi Quy tắc Chung. Bạn có thể sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
Courses:
Pine Programming: https://qntly.com/pineprog
Advanc. Pine Use-Cases: https://qntly.com/advpine

Access to Pro Indic.: https://qntly.com/proind

YouTube: https://qntly.com/youtube
Discord: https://qntly.com/discord
Telegram: https://qntly.com/tel

Bình luận

wowo so great thanks alot ,,, any tf i can use ?
+1 Phản hồi
QuantNomad naba_naif
@naba_naif, Hi, it works on any timeframe you apply it on. So basically it takes a timeframe of your main chart.
+1 Phản hồi
great screener... can you add "vstop" function so it shows when there is a trend reversal?
Phản hồi
Great script!! Please see if you can help me with this question: is the screener list ordered by the time the condition were met? I am trying to figure out how to put the newest pair/stock at the top of list aways, because the alert comes with the full list, so I would know what's the newest by seen the top of the list, Is that possible? how to organize the list by the newest in a screener alert, not sure how you display, what's the list order criteria behind it, but I really need to know, if you can help me explain me how to code that, I would really appreciate, thanks!!!!
Phản hồi
QuantNomad jonas_sp
@jonas_sp, Hi, it's a bit tricky question. First of all, you have to be sure that your signal doesn't repaint and your signal won't disappear on close.
To solve that you can try to create "varip" arrays where you'll save all triggers and times it happened at. There you can maintain the same order they happen. This might work for you.
Phản hồi
jonas_sp QuantNomad
@QuantNomad, Thanks for you answer, Quant. I will try to look deeper on "varip" arrays and see if I can figure it out somehow!
Phản hồi
MatthewKreh QuantNomad
@QuantNomad, could jonas_sp get what he wants by changing the alert frequency to something like alert(alert_message, freq = alert.freq_all ) or alert(alert_message, freq = alert.freq_once_per_bar ) ?
Phản hồi
Do you want to write this code? A screener that warns when each asset reaches a price that the user chooses. Example: If btc reaches 34000 or ETH reaches 2200, etc. With inputs to change the price of each asset. Something like a support / resistance screener to be defined by the user. Is this possible to do?
Phản hồi
Hi sir, I modified this script in order to use 2 labels instead of one. I am having an issue with the alert functionality. Even when the script doesn't find anything based on the conditions the alert still goes off. Is there something I'm doing wrong or is there something I can do?
Phản hồi
Could you please add the possibility to screen RSI divergences using the method from this indicator? Or at least explain which lines need to be modified and how? Thanks and amazing work!
Phản hồi