Multiple Instrument Automation ScreenerI have developed a Pine Script indicator on TradingView designed to demonstrate how to automate execution for ten instruments. This example utilizes a straightforward, Simple Moving Average (SMA) indicator. You can use it as a template, but use your indicator.
The indicator computes long/short signals based on the crossing of the SMA using the security function
It acts as a screener, presenting calculation results in an organized table format.
Utilizing the varip variable, the indicator sends alerts for multiple instruments sequentially rather than simultaneously.
For every generated signal, the indicator builds and sends a JSON execution command to a third-party tool, ensuring seamless integration and automation. You can use your own format.
Sent alerts look like this:
{"ticker": "DOGEBTC","action": "buy","price": "0.00000199","time": "1719754620658"}
Details and Limitations
Instrument Limit: The example is configured for ten instruments for simplicity. However, it can be expanded to handle up to 40 instruments.
Alert Rate Limit: There is a rate limit of 15 alerts in 3 minutes. Exceeding this limit may cause some alerts to be stopped. This can be managed by tracking the alert times and delaying some alerts, though this may affect the entry prices.
Timing of Signal Generation : The indicator processes signals at the bar close to the active instrument. Due to its computational complexity, there is a slight delay in collecting all records, potentially causing signals to reflect a few seconds before the bar closes. Care should be taken when executing based on these signals.
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 well as in historical backtesting.
This post and the script don’t provide any financial advice.
Customscreener
Didi's Needles setup screener Didi's Needles setup screener
I basically used the screener created by QuantNomad , made some modifications and used the indicators from the setup
Indicators used:
Didi Index, ADX, Bollinger Bands, Trix and Stochastic.
Signals from each column:
Column 'Symbol'
Blue Symbol: When the Didi, ADX and BB are with buy signals
Yellow Symbol: When Didi, ADX and BB are with sell signals
Red Symbol: When ADX, BB, Trix and Stoch are with signals to close the trade
ADX' Column
ADX Kick: When the ADX has given a Kick (Top or Bottom). ADX was rising and starts to fall
Uptrend: When the ADX is up and below the Level and the DI+ is above the DI-
Uptrend Strong: When the ADX is up and above the Level and the DI+ is above the DI-
Uptrend Falling: When the ADX is below and above the Level and the DI+ is above the DI-
Downtrend: When the ADX is below the level and the DI- is above the DI+
Downtrend Strong: When the ADX is above the level and the DI- is above the DI+
Downtrend Falling: When the ADX is below the level and the DI- is above the DI+
Didi' Column
Buy Alert: When the Fast Average crosses the Median to the upside (as long as it is not a False Point) = Needle Alert
Sell Alert: When Fast Average Crosses Median Down (as long as it is not a False Point) = Needle Alert
Needle Buy: When slow average crosses the median down = Needle confirmation
Needle Sell: When slow moving average crosses the median to high = Needle confirmation
Fake Buy: When the fast moving average crosses the median and the slow moving average is above the median and rising = False Point (Sell signal or if you are positioned on the buy side, hold the buy or raise the hand)
Fake Sell: When the fast moving average crosses the median and the slow moving average is below the median and falling = False Point (Buy signal or if you are positioned on the sell side, hold the sell or raise your hand)
BB' Column
Open Rising: When the Bollinger Bands are open and the Base Mean (BB) is rising
Open Falling: When the Bollinger Bands are open and the Base Mean (BB) is falling
Parallel Rising: When the Bollinger Bands are parallel and rising
Parallel Falling: When the Bollinger Bands are Parallel and falling
Close: When the Bollinger Bands are closed
Trix Column
Bought: When the Trix is above the MA (trix)
Sold: When the Trix is below the MA (trix)
Stoch Column
Bought: When %K is above %D
Sold: When %K is below %D
--------------------------
Rastreador para o setup de Agulhadas do Didi
Eu basicamente usei o screener criado por QuantNomad , fiz algumas modificações e usei os indicadores do setup
Indicadores usado:
Didi Index, ADX, Bandas de Bollinger, Trix e Estocástico.
Sinais de cada coluna:
Coluna 'Symbol'
Symbol Azul: Quando o Didi, ADX e BB estão com sinais de compra
Symbol Amarelo: Quando o Didi, ADX e BB estão com sinais de venda
Symbol Vermelho: Quando o ADX, BB, Trix e Stoch estão com sinais para fechar a operação
Coluna 'ADX'
Kick ADX: Quando o ADX deu um Kick (Topo ou Fundo). ADX vinha subinte e começa cair
Uptrend: Quando o ADX está subinte e abaixo do Nivel e o DI+ está acima do DI-
Uptrend Strong: Quando o ADX está subinte e acima do Nivel e o DI+ está acima do DI-
Uptrend Falling: Quando o ADX está cainte e acima do Nivel e o DI+ está acima do DI-
Downtrend: Quando o ADX está subinte e abaixo do Nivel e o DI- está acima do DI+
Downtrend Strong: Quando o ADX está subinte e acima do Nivel e o DI- está acima do DI+
Downtrend Falling: Quando o ADX está cainte e acima do Nivel e o DI- está acima do DI+
Coluna 'Didi'
Buy Alert: Quando a média rapida cruza a mediana para cima (contanto que não seja um Ponto Falso) = Alerta da Agulhada
Sell Alert: Quando a média rapida cruza a mediana para baixo (contanto que náo seja um Ponto Falso) = Alerta da Agulhada
Needle Buy: Quando a média lenta cruza a mediana para baixo = Confirmação da Agulhada
Needle Sell: Quando a média lenta cruza a mediana para cima = Confirmação da Agulhada
Fake Buy: Quando a média rapida cruza a mediana paa cima e a média lenta está acima da mediana e subindo = Ponto Falso (Sinal de venda ou caso esteja posicionado na compra, segurar a compra ou aumentar a mão)
Fake Sell: Quando a média rapida cruza a mediana para baixo e a média lenta está abaixo da mediana e caindo = Ponto Falso (Sinal de compra ou caso esteja posicionado na venda, segurar a venda ou aumentar a mão)
Coluna 'BB'
Open Rising: Quando as Bandas de Bollingers estão abertas e a média base (BB) está subindo
Open Falling: Quando as Bandas de Bollingers estão abertas e a média base (BB) está caindo
Parallel Rising: Quando as Bandas de Bollingers estão Paralelas e subindo
Parallel Falling: Quando as Bandas de Bollingers estão Paralelas e caindo
Close: Quando as Bandas de Bollingers estão fechadas
Coluna 'Trix'
Bought: Quando o Trix está acima da MA (trix)
Sold: Quando o Trix está abaixo da MA (trix)
Coluna 'Stoch'
Bought: Quando %K está acima do %D
Sold: Quando o %K está abaixo do %D
All-Time-High Drops and Bounces ScreenerThis screener tracks the following for up to 40 assets:
All-Time-High
Days since ATH
Percentage drop from ATH
Bounce off the low after ATH
Thanks to @QuantNomad and @MUQWISHI for building the base for this screener. I only adjusted it to show different data.
Custom Multi-Timeframe IndicatorIt's a pretty simple example of a nice custom screener you can run for multiple timeframes. This is an RSI screener, but you can easily change the function for your own Indicator.
Screener displays:
Last value of the instrument
RSI value for up to 10 instruments / 4 timeframes.
In Parameters you can change:
4 timeframes
10 instruments
Parameters for RSI
Styling parameters for table
If the selected timeframe will be lower than the current one you will receive a warning message in a table.
Thanks to @MUQWISHI to help me code it.
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 well as in historical backtesting.
This post and the script don’t provide any financial advice.
Screener for 40+ instrumentsAs you probably know in TradingView there is a limit of 40 instruments in one custom screener.
I created a script that will allow you to scan more symbols.
The idea of it is pretty simple. You have to add a screener a few times on your screen with a different set of symbols. Then select column width (as % of your chart width) and # of the screener right to left.
Script will plot #1 screener next to the right border. For #2 and all next tables, the script will compute the needed offset and will draw it on the left. This way it will look like one table and not a few separate indicators.
I created a script with an RSI screener, but you can create more complicated examples with it.
Off course, that's not a silver bullet solution but might work for some of you.
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 well as in historical backtesting.
This post and the script don’t provide any financial advice.
Multiple Indicators ScreenerA screener for multiple indicators with nice table output.
I was asked many times to update custom screener to display results in a table form. This way it looks much better.
You can play with background colors depend on values you're looking for.
In the screener, for example, I'm highlighting overbought/oversold RSI values, big ADX levels and trend of the Supertrend.
In parameters you can change settings for all indicators and change/disable tickers if 40 is too many for you.
There is only 1 function that calculates all these indicators. Potentially you can change and even add more indicators to this function.
Writing code for these kind of screener is a bit time consuming, so I even created a code generator in Python for these kind of indicators :) .
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 well as in historical backtesting.
This post and the script don’t provide any financial advice.
Custom Multi-Timeframe Screener with AlertsThis is a multi-timeframe screener with alerts. Use this way you can create a screener on indicators using 2 or more timeframes.
In TradingView there is a limit of 40 security function calls. Every timeframe requires another security call so you can screen fewer symbols with any additional timeframe.
In this example, I use 2 timeframes, so the maximum amount of symbols you can scan is 40/2 = 20.
For 3 timeframes - 13, 4tfs - 10, 5tfs - 8 symbols and so on.
In this simplistic example, I require a cross of EMAs on the current timeframe and confirmation that one EMA above/below another from the second timeframe.
Of course, you can create much more complicated functions for this screener.
Params
- higher timeframe
- ema params
- 20 symbol inputs for instruments you want to use in this screener
Alerts
You can create an alert from it easily by selecting the 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 the 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.
Multiple Screeners with AlertsI 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.
Custom Screener with Alerts V2 [QuantNomad]TradingView just recently announced the alert() function that allows you to create dynamic alerts from both strategies and studies.
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 (RSI > 70) and oversold stocks (RSI < 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 RSI level for selected stocks for example.
Link to the old screener:
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.
Custom Screener with Alerts [QuantNomad]Some time ago I published an example of simple custom screener in PineScript:
The only thing this screener did is created a dynamic label with screener output.
Recently TradingView announced alerts from the strategy with the possibility to add custom messages to alerts.
So using it I was able to create a bit more advanced screener which sends results as alert messages. With tools like Alertatron, you can easily redirect them to Telegram if you want.
It works for 40 symbols (limitation of the number of security calls).
To create your own screener you need to change only screenerFunc. The logic of this function is very simple, it outputs value you want to display in screener and condition based on which your screener should filter your stocks.
To create alerts for this screener create an alert from strategy and use {{strategy.order.alert_message}} as alert message.
Do you know now how to make this screener better? Let me know.
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.