So I decided to update custom screener I published before. It was based on alerts from orders in strategies, that was the only way to create dynamic alerts in PineScript at that point.
With the alert() function code become cleaner and more readable.
It works for up to 40 symbols at the same time.
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 I set up in the code.
I created as an example a screener that tracks both overbought ( > 70) and oversold stocks ( < 30).
To create your own screener you have to change only screenerFunc().
By design it should output 2 values:
- cond - True/False Boolean variable. Should this instrument be displayed in the screener?
- value - Additional numeric value you can display in your screener. I display level for selected stocks for example.
Link to the old screener:
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.
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 đồ.
and because // This will keep screener only for the last bar label.delete(lab_l)
is it possible to have the close value used for RSI at end of each bar.
please advise. Thanks.
I find this really helpful as u make it simple with this neat scripting
Also, is it possible to make the alerts are separate for each ticker?
if (cond for s01 == true)
alert('Cond for s01 is true, buy!', freq = alert.freq_once_per_bar_close )
If its yes, can u give me an example how to do that?