OPEN-SOURCE SCRIPT
Aggiornato

Screener based on Profitunity strategy for multiple timeframes

414

Screener based on Profitunity strategy by Bill Williams for multiple timeframes (max 5, including chart timeframe) and customizable symbol list. The screener analyzes the Alligator and Awesome Oscillator indicators, Divergent bars and high volume bars.

The maximum allowed number of requests (symbols and timeframes) is limited to 40 requests, for example, for 10 symbols by 4 requests of different timeframes. Therefore, the indicator automatically limits the number of displayed symbols depending on the number of timeframes for each symbol, if there are more symbols than are displayed in the screener table, then the ordinal numbers are displayed to the left of the symbols, in this case you can display the next group of symbols by increasing the value by 1 in the "Show tickers from" field, if the "Group" field is enabled, or specify the symbol number by 1 more than the last symbol in the screener table. 👀 When timeframe filtering is applied, the screener table displays only the columns of those timeframes for which the filtering value is selected, which allows displaying more symbols.

For each timeframe, in the "TIMEFRAMES > Prev" field, you can enable the display of data for the previous bar relative to the last (current) one, if the market is open for the requested symbol. In the "TIMEFRAMES > Y" field, you can enable filtering depending on the location of the last five bars relative to the Alligator indicator lines, which are designated by special symbols in the screener table:
⬆️ — if the Alligator is open upwards (Lips > Teeth > Jaw) and none of the bars is closed below the Lips line;
↗️ — if one of the bars, except for the penultimate one, is closed below Lips, or two bars, except for the last one, are closed below Lips, or the Alligator is open upwards only below four bars, but none of the bars is closed below Lips;
⬇️ — if the Alligator is open downwards (Lips < Teeth < Jaw), but none of the bars is closed above Lips;
↘️ — if one of the bars, except the penultimate one, is closed above the Lips, or two bars, except the last one, are closed above the Lips, or the Alligator is open down only above four bars, but none of the bars are closed above the Lips;
➡️ — in other cases, including when the Alligator lines intersect and one of the bars is closed behind the Lips line or two bars intersect one of the Alligator lines.

In the "TIMEFRAMES > Show bar change value for TF" field, you can add a column to the right of the selected timeframe column with the percentage change between the closing price of the last bar (current) and the closing price of the previous bar ((close – previous close) / previous close * 100). Depending on the percentage value, the background color of the screener table cell will change: dark red if <= -3%; red if <= -2%, light red if <= -0.5%; dark green if >= 3%; green if >= 2%; light green if >= 0.5%.

For each timeframe, the screener table displays the symbol of the latest (current) bar, depending on the closing price relative to the bar's midpoint ((high + low) / 2) and its location relative to the Alligator indicator lines: ⎾ — the bar's closing price is above its midpoint; ⎿ — the bar's closing price is below its midpoint; ├ — the bar's closing price is equal to its midpoint; 🟢 — Bullish Divergent bar, i.e. the bar's closing price is above its midpoint, the bar's high is below all Alligator lines, the bar's low is below the previous bar's low; 🔴 — Bearish Divergent bar, i.e. the bar's closing price is below its midpoint, the bar's low is above all Alligator lines, the bar's high is above the previous bar's high. When filtering is enabled in the "TIMEFRAMES > Filtering by Divergent bar" field, the data in the screener table cells will be displayed only for those timeframes that have a Divergent bar. A high bar volume signal is also displayed — 📶/📶² if the bar volume is greater than 40%/70% of the average volume value calculated using a simple moving average (SMA) in the 140 bar interval from the last bar.

In the indicator settings in the "SYMBOL LIST" field, each ticker (for example: OANDA:SPX500USD) must be on a separate line. If the market is closed, then the data for requested symbols will be limited to the time of the last (current) bar on the chart, for example, if the current symbol was traded yesterday, and the requested symbol is traded today, when requesting data for an hourly timeframe, the last bar will be for yesterday, if the timeframe of the current chart is not higher than 1 day. Therefore, by default, a warning will be displayed on the chart instead of the screener table that if the market is open, you must wait for the screener to load (after the first price change on the current chart), or if the highest timeframe in the screener is 1 day, you will be prompted to change the timeframe on the current chart to 1 week, if the screener requests data for the timeframe of 1 week, you will be prompted to change the timeframe on the current chart to 1 month, or switch to another symbol on the current chart for which the market is open (for example: BINANCE:BTCUSDT), or disable the warning in the field "SYMBOL LIST > Do not display screener if market is close".

The number of the last columns with the color of the AO indicator that will be displayed in the screener table for each timeframe is specified in the indicator settings in the "AWESOME OSCILLATOR > Number of columns" field.

For each timeframe, the direction of the trend between the price of the highest and lowest bars in the specified range of bars from the last bar is displayed — ↑ if the trend is up (the highest bar is to the right of the lowest), or ↓ if the trend is down (the lowest bar is to the right of the highest). If there is a divergence on the AO indicator in the specified interval, the symbol ∇ is also displayed. The average volume value is also calculated in the specified interval using a simple moving average (SMA). The number of bars is set in the indicator settings in the "INTERVAL FOR HIGHEST AND LOWEST BARS > Bars count" field.

In the indicator settings in the "STYLE" field you can change the position of the screener table relative to the chart window, the background color, the color and size of the text.

***

Скринер на основе стратегии Profitunity Билла Вильямса для нескольких таймфреймов (максимум 5, включая таймфрейм графика) и настраиваемого списка символов. Скринер анализирует индикаторы Alligator и Awesome Oscillator, Дивергентные бары и бары с высоким объемом.

Максимально допустимое количество запросов (символы и таймфреймы) ограничено 40 запросами, например, для 10 символов по 4 запроса разных таймфреймов. Поэтому в индикаторе автоматически ограничивается количество отображаемых символов в зависимости от количества таймфреймов для каждого символа, если символов больше чем отображено в таблице скринера, то слева от символов отображаются порядковые номера, в таком случае можно отобразить следующую группу символов, увеличив значение на 1 в настройках индикатора поле "Show tickers from", если включено поле "Group", или указать номер символа на 1 больше, чем последний символ в таблице скринера. 👀 Когда применяется фильтрация по таймфрейму, в таблице скринера отображаются только столбцы тех таймфреймов, для которых выбрано значение фильтрации, что позволяет отображать большее количество символов.

Для каждого таймфрейма в настройках индикатора в поле "TIMEFRAMES > Prev" можно включить отображение данных для предыдущего бара относительно последнего (текущего), если для запрашиваемого символа рынок открыт. В поле "TIMEFRAMES > Y" можно включить фильтрацию, в зависимости от расположения последних пяти баров относительно линий индикатора Alligator, которые обозначаются специальными символами в таблице скринера:
⬆️ — если Alligator открыт вверх (Lips > Teeth > Jaw) и ни один из баров не закрыт ниже линии Lips;
↗️ — если один из баров, кроме предпоследнего, закрыт ниже Lips, или два бара, кроме последнего, закрыты ниже Lips, или Alligator открыт вверх только ниже четырех баров, но ни один из баров не закрыт ниже Lips;
⬇️ — если Alligator открыт вниз (Lips < Teeth < Jaw), но ни один из баров не закрыт выше Lips;
↘️ — если один из баров, кроме предпоследнего, закрыт выше Lips, или два бара, кроме последнего, закрыты выше Lips, или Alligator открыт вниз только выше четырех баров, но ни один из баров не закрыт выше Lips;
➡️ — в остальных случаях, в то числе когда линии Alligator пересекаются и один из баров закрыт за линией Lips или два бара пересекают одну из линий Alligator.

В поле "TIMEFRAMES > Show bar change value for TF" можно добавить справа от выбранного столбца таймфрейма столбец с процентным изменением между ценой закрытия последнего бара (текущего) и ценой закрытия предыдущего бара ((close – previous close) / previous close * 100). В зависимости от величины процента будет меняться цвет фона ячейки таблицы скринера: темно-красный, если <= -3%; красный, если <= -2%, светло-красный, если <= -0.5%; темно-зеленый, если >= 3%; зеленый, если >= 2%; светло-зеленый, если >= 0.5%.

Для каждого таймфрейма в таблице скринера отображается символ последнего (текущего) бара, в зависимости от цены закрытия относительно середины бара ((high + low) / 2) и расположения относительно линий индикатора Alligator: ⎾ — цена закрытия бара выше его середины; ⎿ — цена закрытия бара ниже его середины; ├ — цена закрытия бара равна его середине; 🟢 — Бычий Дивергентный бар, т.е. цена закрытия бара выше его середины, максимум бара ниже всех линий Alligator, минимум бара ниже минимума предыдущего бара; 🔴 — Медвежий Дивергентный бар, т.е. цена закрытия бара ниже его середины, минимум бара выше всех линий Alligator, максимум бара выше максимума предыдущего бара. При включении фильтрации в поле "TIMEFRAMES > Filtering by Divergent bar" данные в ячейках таблицы скринера будут отображаться только для тех таймфреймов, где есть Дивергентный бар. Также отображается сигнал высокого объема бара — 📶/📶², если объем бара больше чем на 40%/70% среднего значения объема, рассчитанного с помощью простой скользящей средней (SMA) в интервале 140 баров от последнего бара.

В настройках индикатора в поле "SYMBOL LIST" каждый тикер (например: OANDA:SPX500USD) должен быть на отдельной строке. Если рынок закрыт, то данные для запрашиваемых символов будут ограничены временем последнего (текущего) бара на графике, например, если текущий символ торговался последний день вчера, а запрашиваемый символ торгуется сегодня, при запросе данных для часового таймфрейма, последний бар будет за вчерашний день, если таймфрейм текущего графика не выше 1 дня. Поэтому по умолчанию на графике будет отображаться предупреждение вместо таблицы скринера о том, что если рынок открыт, то необходимо дождаться загрузки скринера (после первого изменения цены на текущем графике), или если в скринере самый высокий таймфрейм 1 день, то будет предложено изменить на текущем графике таймфрейм на 1 неделю, если в скринере запрашиваются данные для таймфрейма 1 неделя, то будет предложено изменить на текущем графике таймфрейм на 1 месяц, или же переключиться на другой символ на текущем графике, для которого рынок открыт (например: BINANCE:BTCUSDT), или отключить предупреждение в поле "SYMBOL LIST > Do not display screener if market is close".

Количество последних столбцов с цветом индикатора AO, которые будут отображены в таблице скринера для каждого таймфрейма, указывается в настройках индикатора в поле "AWESOME OSCILLATOR > Number of columns".

Для каждого таймфрейма отображается направление тренда между ценой самого высокого и самого низкого баров в указанном интервале баров от последнего бара — ↑, если тренд направлен вверх (самый высокий бар справа от самого низкого), или ↓, если тренд направлен вниз (самый низкий бар справа от самого высокого). Если есть дивергенция на индикаторе AO в указанном интервале, то также отображается символ — ∇. В указанном интервале также рассчитывается среднее значение объема с помощью простой скользящей средней (SMA). Количество баров устанавливается в настройках индикатора в поле "INTERVAL FOR HIGHEST AND LOWEST BARS > Bars count".

В настройках индикатора в поле "STYLE" можно изменить положение таблицы скринера относительно окна графика, цвет фона, цвет и размер текста.
Note di rilascio
Added the ability to split the symbol list into groups using hashtags, the text of which corresponds to the ticker prefix on the chart and must be written in capital letters. if the ticker prefix in the chart window begins with the text of the hashtag, then the screener will display only symbols that begin with the line after the corresponding hashtag and end before the next hashtag or in the last line of the symbol list. For example:

#OANDA
OANDA:SPX500USD
OANDA:XAUUSD
#AMEX
#NASDAQ
#NYSE
AMEX:SPY
NASDAQ:NVDA
NYSE:BRK.B
#CME
CME_MINI_DL:NQ1!
CME_DL:BTC1!
ES1!
#
BINANCE:BTCUSDT

For the ticker in the chart window OANDA:BCOUSD, the screener will display only the symbols:

OANDA:SPX500USD
OANDA:XAUUSD

For the tickers in the chart window AMEX:IWM, NASDAQ:MSFT and NYSE:WMT, the screener will display only the symbols:

AMEX:SPY
NASDAQ:NVDA
NYSE:BRK.B

👉 Multiple hashtags can be added for a ticker group. If you do not have a subscription to the AMEX, NASDAQ or NYSE exchange, then by default the ticker prefix in the chart window for any of the specified exchanges will be BATS, so you will not be able to separate tickers for these exchanges into separate groups, and you can only use one hashtag #BATS for all symbols of these exchanges.

For the CME:RTY1! ticker, the screener will display only the symbols:

CME_MINI_DL:NQ1!
CME_DL:BTC1!
ES1!

👉 In the indicator, if a symbol with the CME prefix is ​​specified, for example, CME:ES1!, then the request will be made to the ES1! symbol without a prefix, because the full prefix for the ES1! symbol will be CME_MINI or CME_MINI_DL if you do not have a subscription to the CME exchange. To see the full prefix for the symbol you are interested in, select it in the chart window (for example: CME:RTY1!), enable the "SYMBOL LIST > Add current symbol to symbol list" field in the indicator settings and the "Display prefix of symbols" field, as a result, the ticker selected in the chart window together with the prefix will be displayed first in the list of symbols in the screener. You can use an empty hashtag (#) to indicate when the ticker group for the previous hashtag ends.

istantanea

Instead of a prefix, the hashtag text can be equal to the ticker market type in the chart window (see security info) and must be written in lowercase, for example:

#cfd
OANDA:XAUUSD
FOREXCOM:XAGUSD
#index
OANDA:SPX500USD
FOREXCOM:NAS100
#forex
OANDA:EURUSD
FOREXCOM:GBPUSD
#fund
AMEX:SPY
NASDAQ:IBIT
#stock
NASDAQ:NVDA
NYSE:BRK.B
#futures
CME_MINI_DL:NQ1!
CME_DL:BTC1!
ES1!
#crypto
BINANCE:BTCUSDT
OANDA:ETHUSD

Also, the hashtag text can contain both a prefix and a market type separated by a colon, for example:

#OANDA:cfd
OANDA:XAUUSD
OANDA:XAGUSD
#OANDA:index
OANDA:SPX500USD
OANDA:NAS100USD
#OANDA:forex
OANDA:EURUSD
OANDA:GBPUSD

Hashtags can be combined, for example:

#OANDA
#NASDAQ:fund
#crypto
OANDA:XAUUSD
NASDAQ:IBIT
BINANCE:BTCUSDT

***

Добавлена возможность разделять список символов на группы с помощью хэштегов, текст которых соответствует префиксу тикеров на графике и должен быть написан заглавными буквами. Таким образом, если префикс тикера в окне графика начинается с текста хэштега, то в скринере будут отображаться только символы, начинающиеся со строки после соответствующего хэштега и заканчивающиеся перед следующим любым хэштегом или в последней строке списка символов. Например:

#OANDA
OANDA:SPX500USD
OANDA:XAUUSD
#AMEX
#NASDAQ
#NYSE
AMEX:SPY
NASDAQ:NVDA
NYSE:BRK.B
#CME
CME_MINI_DL:NQ1!
CME_DL:BTC1!
ES1!
#
BINANCE:BTCUSDT

Для тикера в окне графика OANDA:BCOUSD в скринере будут отображены только символы:

OANDA:SPX500USD
OANDA:XAUUSD

Для тикеров в окне графика AMEX:IWM, NASDAQ:MSFT и NYSE:WMT в скринере будут отображены только символы:

AMEX:SPY
NASDAQ:NVDA
NYSE:BRK.B

👉 Для группы тикеров может быть добавлено несколько хэштегов. Если у вас нет подписки на биржу AMEX, NASDAQ или NYSE, то по умолчанию префикс тикера в окне графика для любой из указанных бирж будет BATS, таким образом вы не сможете разделить тикеры для этих бирж на отдельные группы, и можете использовать только один хэштег #BATS для всех символов этих бирж.

Для тикера CME:RTY1! в скринере будут отображены только символы:

CME_MINI_DL:NQ1!
CME_DL:BTC1!
ES1!

👉 В индикаторе, если указан символ с префиксом CME, например, CME:ES1!, то запрос будет выполняться к символу ES1! без префикса, потому что полный префикс для символа ES1! будет CME_MINI или CME_MINI_DL, если у вас нет подписки на биржу CME. Чтобы увидеть полный префикс для интересующего вас символа, выберете его в окне графика (например: CME:RTY1!), включите в настройках индикатора поле "SYMBOL LIST > Add current symbol to symbol list" и поле "Display prefix of symbols", в результате выбранный в окне графика тикер вместе с префиксом будет отображаться первым в списке символов в скринере. Можно использовать пустой хэштег (#), чтобы указать когда завершается группа тикеров для предыдущего хэштега.

istantanea

Вместо префикса текст хэштега может быть равен типу рынка тикера в окне графика (см. информацию об инструменте) и должен быть написан строчными буквами, например:

#cfd
OANDA:XAUUSD
FOREXCOM:XAGUSD
#index
OANDA:SPX500USD
FOREXCOM:NAS100
#forex
OANDA:EURUSD
FOREXCOM:GBPUSD
#fund
AMEX:SPY
NASDAQ:IBIT
#stock
NASDAQ:NVDA
NYSE:BRK.B
#futures
CME_MINI_DL:NQ1!
CME_DL:BTC1!
ES1!
#crypto
BINANCE:BTCUSDT
OANDA:ETHUSD

Также текст хэштега может содержать одновременно префикс и тип рынка разделенные двоеточием, например:

#OANDA:cfd
OANDA:XAUUSD
OANDA:XAGUSD
#OANDA:index
OANDA:SPX500USD
OANDA:NAS100USD
#OANDA:forex
OANDA:EURUSD
OANDA:GBPUSD

Хэштеги можно совмещать, например:

#OANDA
#NASDAQ:fund
#crypto
OANDA:XAUUSD
NASDAQ:IBIT
BINANCE:BTCUSDT
Note di rilascio
Fixed a bug with the display of the Divergent Bar symbol.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.