grigorykov

Alligator + Fractals + Divergent & Squat Bars + Signal Alerts

grigorykov アップデート済   
The indicator includes Williams Alligator, Williams Fractals, Divergent Bars, Market Facilitation Index, Highest and Lowest Bars, maximum and minimum peak of Awesome Oscillator, and signal alerts based on Bill Williams' Profitunity strategy.

MFI and Awesome Oscillator

According to the Market Facilitation Index Oscillator, the Squat bar is colored blue, all other bars are colored according to the Awesome Oscillator color, except for the Fake bars, colored with a lighter AO color. In the indicator settings, you can enable the display of "Green" bars (in the "Green Bars > Show" field). In the indicator style settings, you can disable changing the color of bars in accordance with the AO color (in the "AO bars" field), including changing the color for Fake bars (in the "Fake AO bars" field).


MFI is calculated using the formula: (high - low) / volume.

A Squat bar means that, compared to the previous bar, its MFI has decreased and at the same time its volume has increased, i.e. MFI < previous bar and volume > previous bar. A sign of a possible price reversal, so this is a particularly important signal.

A Fake bar is the opposite of a Squat bar and means that, compared to the previous bar, its MFI has increased and at the same time its volume has decreased, i.e. MFI > previous bar and volume < previous bar.

A "Green" bar means that, compared to the previous bar, its MFI has increased and at the same time its volume has increased, i.e. MFI > previous bar and volume > previous bar. A sign of trend continuation. But a more significant trend confirmation or warning of a possible reversal is the Awesome Oscillator, which measures market momentum by calculating the difference between the 5 Period and 34 Period Simple Moving Averages (SMA 5 - SMA 34) based on the midpoints of the bars (hl2). Therefore, by default, the "Green" bars and their opposite "Fade" bars are colored according to the color of the Awesome Oscillator.


According to Bill Williams' Profitunity strategy, using the Awesome Oscillator, the third Elliott wave is determined by the maximum peak of AO in the range from 100 to 140 bars. The presence of divergence between the maximum AO peak and the subsequent lower AO peak in this interval also warns of a possible correction, especially if the AO crosses the zero line between these AO peaks. Therefore, the chart additionally displays the prices of the highest and lowest bars, as well as the maximum or minimum peak of AO in the interval of 140 bars from the last bar. In the indicator settings, you can hide labels, lines, change the number of bars and any parameters for the AO indicator - method (SMA, Smoothed SMA, EMA and others), length, source (open, high, low, close, hl2 and others).


Bullish Divergent bar

🟢 A buy signal (Long) is a Bullish Divergent bar with a green circle displayed above it if such a bar simultaneously meets all of the following conditions:

  • The high of the bar is below all lines of the Alligator indicator.
  • The closing price of the bar is above its middle, i.e. close > (high + low) / 2.
  • The low of the bar is below the low of 2 previous bars or below the low of one previous bar, and the low of the second previous bar is a lower fractal (▼). By default, Divergent bars are not displayed, the low of which is lower than the low of only one previous bar and the low of the 2nd previous bar is not a lower fractal (▼), but you can enable the display of any Divergent bars in the indicator settings (by setting the value "no" in the " field Divergent Bars > Filtration").

The following conditions strengthen the Bullish Divergent bar signal:

  • The opening price of the bar, as well as the closing price, is higher than its middle, i.e. Open > (high + low) / 2.
  • The high of the bar is below all lines of the open Alligator indicator, i.e. the green line (Lips) is below the red line (Teeth) and the red line is below the blue line (Jaw). In this case, the color of the circle above the Bullish Divergent bar is dark green.
  • Squat Divergent bar.
  • The bar following the Bullish Divergent bar corresponds to the green color of the Awesome Oscillator.
  • Divergence on Awesome Oscillator.
  • Formation of the lower fractal (▼), in which the low of the Divergent bar is the peak of the fractal.


Bearish Divergent bar

🔴 A signal to sell (Short) is a Bearish Divergent bar under which a red circle is displayed if such a bar simultaneously meets all the following conditions:

  • The low of the bar is above all lines of the Alligator indicator.
  • The closing price of the bar is below its middle, i.e. close < (high + low) / 2.
  • The high of the bar is higher than the high of 2 previous bars or higher than the high of one previous bar, and the high of the second previous bar is an upper fractal (▲). By default, Divergent bars are not displayed, the high of which is higher than the high of only one previous bar and the high of the 2nd previous bar is not an upper fractal (▲), but you can enable the display of any Divergent bars in the indicator settings (by setting the value "no" in the " field Divergent Bars > Filtration").

The following conditions strengthen the Bearish Divergent bar signal:

  • The opening price of the bar, as well as the closing price, is below its middle, i.e. open < (high + low) / 2.
  • The low of the bar is above all lines of the open Alligator indicator, i.e. the green line (Lips) is above the red line (Teeth) and the red line is above the blue line (Jaw). In this case, the color of the circle under the Bearish Divergent bar is dark red.
  • Squat Divergent bar.
  • The bar following the Bearish Divergent bar corresponds to the red color of the Awesome Oscillator.
  • Divergence on Awesome Oscillator.
  • Formation of the upper fractal (▲), in which the high of the Divergent bar is the peak of the fractal.


Alligator lines crossing

Bars crossing the green line (Lips) of the open Alligator indicator is the first warning of a possible correction (price rollback) if one of the following conditions is met:

  • If the bar closed below the Lips line, which is above the Teeth line, and the Teeth line is above the Jaw line, while the closing price of the previous bar is above the Lips line.
  • If the bar closed above the Lips line, which is below the Teeth line, and the Teeth line is below the Jaw line, while the closing price of the previous bar is below the Lips line.

The intersection of all open Alligator lines by bars is a sign of a deep correction and a warning of a possible trend change.

Frequent intersection of Alligator lines with each other is a sign of a sideways trend (flat).


Signal Alerts

To receive notifications about signals when creating an alert, you must select the condition "Any alert() function is call", in which case notifications will arrive in the following format:


D — timeframe, for example: D, 4H, 15m.

🟢 BDB⎾ - a signal for a Bullish Divergent bar to buy (Long), triggers once after the bar closes and includes additional signals:

  • /// — if Alligator is open.
  • ⏉ — if the opening price of the bar, as well as the closing price, is above its middle.
  • + Squat 🔷 - Squat bar or + Green ↑ - "Green" bar or + Fake ↓ - Fake bar.
  • + AO 🟩 - if after the Divergent bar closes, the oscillator color change for the next bar corresponds the green color of the Awesome Oscillator. ┴/┬ — AO above/below the zero line. ∇ — if there is divergence on AO in the interval of 140 bars from the last bar.

🔴 BDB⎿ - a signal for a Bearish Divergent bar to sell (Short), triggers once after the bar closes and includes additional signals:

  • /// — if Alligator is open.
  • ⏊ — if the opening price of the bar, as well as the closing price, is below its middle.
  • + Squat 🔷 - Squat bar or + Green ↑ - "Green" bar or + Fake ↓ - Fake bar.
  • + AO 🟥 - if after the Divergent bar closes, the oscillator color change for the next bar corresponds to the red color of the Awesome Oscillator. ┴/┬ — AO above/below the zero line. ∇ — if there is divergence on AO in the interval of 140 bars from the last bar.

Alert for bars crossing the green line (Lips) of the open Alligator indicator (can be disabled in the indicator settings in the "Alligator > Enable crossing lips alerts" field):

  • 🔴 Crossing Lips ↓ - if the bar closed below the Lips line, which is above than the other lines, while the closing price of the previous bar is above the Lips line.
  • 🟢 Crossing Lips ↑ - if the bar closed above the Lips line, which is below the other lines, while the closing price of the previous bar is below the Lips line.

The fractal signal is triggered after the second bar closes, completing the formation of the fractal, if alerts about fractals are enabled in the indicator settings (the "Fractals > Enable alerts" field):

  • 🟢 Fractal ▲ - upper (Bearish) fractal.
  • 🔴 Fractal ▼ — lower (Bullish) fractal.
  • ⚪️ Fractal ▲/▼ - both upper and lower fractal.

↳ (H=high - L=low) = difference.

If you redirect notifications to a webhook URL, for example, to a Telegram bot, then you need to set the notification template for the webhook in the indicator settings in the "Webhook > Message" field (contains a tooltip with an example), in which you just need to specify the text {{message}}, which will be automatically replaced with the alert text with a ticker and a link to TradingView.

‼️ A signal is not a call to action, but only a reason to analyze the chart to make a decision based on the rules of your strategy.

***

Индикатор включает в себя Williams Alligator, Williams Fractals, Дивергентные бары, Market Facilitation Index, самый высокий и самый низкий бары, максимальный и минимальный пик Awesome Oscillator, а также оповещения о сигналах на основе стратегии Profitunity Билла Вильямса.

MFI и Awesome Oscillator

В соответствии с осциллятором Market Facilitation Index Приседающий бар окрашен в синий цвет, все остальные бары окрашены в соответствии с цветом Awesome Oscillator, кроме Фальшивых баров, которые окрашены более светлым цветом AO. В настройках индикатора вы можете включить отображение "Зеленых" баров (в поле "Green Bars > Show"). В настройках стиля индикатора вы можете выключить изменение цвета баров в соответствии с цветом AO (в поле "AO bars"), в том числе изменить цвет для Фальшивых баров (в поле "Fake AO bars").


MFI рассчитывается по формуле: (high - low) / volume.

Приседающий бар означает, что по сравнению с предыдущим баром его MFI снизился и в тоже время вырос его объем, т.е. MFI < предыдущего бара и объем > предыдущего бара. Признак возможного разворота цены, поэтому это особенно важный сигнал.

Фальшивый бар является противоположностью Приседающему бару и означает, что по сравнению с предыдущим баром его MFI увеличился и в тоже время снизился его объем, т.е. MFI > предыдущего бара и объем < предыдущего бара.

"Зеленый" бар означает, что по сравнению с предыдущим баром его MFI увеличился и в тоже время вырос его объем, т.е. MFI > предыдущего бара и объем > предыдущего бара. Признак продолжения тренда. Но более значимым подтверждением тренда или предупреждением о возможном развороте является Awesome Oscillator, который измеряет движущую силу рынка путем вычисления разницы между 5 Периодной и 34 Периодной Простыми Скользящими Средними (SMA 5 - SMA 34) по средним точкам баров (hl2). Поэтому по умолчанию "Зеленые" бары и противоположные им "Увядающие" бары окрашены в соответствии с цветом Awesome Oscillator.


По стратегии Profitunity Билла Вильямса с помощью осциллятора Awesome Oscillator определяется третья волна Эллиота по максимальному пику AO в интервале от 100 до 140 баров. Наличие дивергенции между максимальным пиком AO и следующим за ним более низким пиком AO в этом интервале также предупреждает о возможной коррекции, особенно если AO переходит через нулевую линию между этими пиками AO. Поэтому на графике дополнительно отображаются цены самого высокого и самого низкого баров, а также максимальный или минимальный пик АО в интервале 140 баров от последнего бара. В настройках индикатора вы можете скрыть метки, линии, изменить количество баров и любые параметры для индикатора AO – метод (SMA, Smoothed SMA, EMA и другие), длину, источник (open, high, low, close, hl2 и другие).


Бычий Дивергентный бар

🟢 Сигналом на покупку (Long) является Бычий Дивергентный бар над которым отображается зеленый круг, если такой бар соответствует одновременно всем следующим условиям:

  1. Максимум бара ниже всех линий индикатора Alligator.
  2. Цена закрытия бара выше его середины, т.е. close > (high + low) / 2.
  3. Минимум бара ниже минимума 2-х предыдущих баров или ниже минимума одного предыдущего бара, а минимум второго предыдущего бара является нижним фракталом (▼). По умолчанию не отображаются Дивергентные бары, минимум которых ниже минимума только одного предыдущего бара и минимум 2-го предыдущего бара не является нижним фракталом (▼), но вы можете включить отображение любых Дивергентных баров в настройках индикатора (установив значение "no" в поле "Divergent Bars > Filtration").

Усилением сигнала Бычьего Дивергентного бара являются следующие условия:

  • Цена открытия бара, как и цена закрытия, выше его середины, т.е. Open > (high + low) / 2.
  • Максимум бара ниже всех линий открытого индикатора Alligator, т.е. зеленая линия (Lips) ниже красной линии (Teeth) и красная линия ниже синей линии (Jaw). В этом случае цвет круга над Бычьим Дивергентным баром окрашен в темно-зеленый цвет.
  • Приседающий Дивергентный бар.
  • Бар, следующий за Бычьим Дивергентным баром, соответствует зеленому цвету Awesome Oscillator.
  • Дивергенция на Awesome Oscillator.
  • Образование нижнего фрактала (▼), у которого минимум Дивергентного бара является пиком фрактала.


Медвежий Дивергентный бар

🔴 Сигналом на продажу (Short) является Медвежий Дивергентный бар под которым отображается красный круг, если такой бар соответствует одновременно всем следующим условиям:

  • Минимум бара выше всех линий индикатора Alligator.
  • Цена закрытия бара ниже его середины, т.е. close < (high + low) / 2.
  • Максимум бара выше маскимума 2-х предыдущих баров или выше максимума одного предыдущего бара, а максимум второго предыдущего бара является верхним фракталом (▲). По умолчанию не отображаются Дивергентные бары, максимум которых выше максимума только одного предыдущего бара и максимум 2-го предыдущего бара не является верхним фракталом (▲), но вы можете включить отображение любых Дивергентных баров в настройках индикатора (установив значение "no" в поле "Divergent Bars > Filtration").

Усилением сигнала Медвежьего Дивергентного бара являются следующие условия:

  • Цена открытия бара, как и цена закрытия, ниже его середины, т.е. open < (high + low) / 2.
  • Минимум бара выше всех линий открытого индикатора Alligator, т.е. зеленая линия (Lips) выше красной линии (Teeth) и красная линия выше синей линии (Jaw). В этом случае цвет круга под Медвежьим Дивергентным Баром окрашен в темно-красный цвет.
  • Приседающий Дивергентный бар.
  • Бар, следующий за Медвежьим Дивергентным баром, соответствует красному цвету Awesome Oscillator.
  • Дивергенция на Awesome Oscillator.
  • Образование верхнего фрактала (▲), у которого максимум Дивергентного бара является пиком фрактала.


Пересечение линий Alligator

Пересечение барами зеленой линии (Lips) открытого индикатора Alligator является первым предупреждением о возможной коррекции (откате цены) при выполнении одного из следующих условий:

  • Если бар закрылся ниже линии Lips, которая выше линии Teeth, а линия Teeth выше линии Jaw, при этом цена закрытия предыдущего бара находится выше линии Lips.
  • Если бар закрылся выше линии Lips, которая ниже линии Teeth, а линия Teeth ниже линии Jaw, при этом цена закрытия предыдущего бара находится ниже линии Lips.

Пересечение барами всех линий открытого Alligator является признаком глубокой коррекции и предупреждением о возможной смене тренда.

Частое пересечение линий Alligator между собой является признаком бокового тренда (флэт).


Оповещения о сигналах

Для получения уведомлений о сигналах при создании оповещения необходимо выбрать условие "При любом вызове функции alert()", в таком случае уведомления будут приходить в следующем формате:


D — таймфрейм, например: D, 4H, 15m.

🟢 BDB⎾ — сигнал Бычьего Дивергентного бара на покупку (Long), срабатывает один раз после закрытия бара и включает дополнительные сигналы:

  • /// — если Alligator открыт.
  • ⏉ — если цена открытия бара, как и цена закрытия, выше его середины.
  • + Squat 🔷 — Приседающий бар или + Green ↑ — "Зеленый" бар или + Fake ↓ — Фальшивый бар.
  • + AO 🟩 — если после закрытия Дивергентного бара, изменение цвета осциллятора для следующего бара соответствует зеленому цвету Awesome Oscillator. ┴/┬ — AO выше/ниже нулевой линии. ∇ — если есть дивергенция на AO в интервале 140 баров от последнего бара.

🔴 BDB⎿ — сигнал Медвежьего Дивергентного бара на продажу (Short), срабатывает один раз после закрытия бара и включает дополнительные сигналы:

  • /// — если Alligator открыт.
  • ⏊ — если цена открытия бара, как и цена закрытия, ниже его середины.
  • + Squat 🔷 — Приседающий бар или + Green ↑ — "Зеленый" бар или + Fake ↓ — Фальшивый бар.
  • + AO 🟥 — если после закрытия Дивергентного бара, изменение цвета осциллятора для следующего бара соответствует красному цвету Awesome Oscillator. ┴/┬ — AO выше/ниже нулевой линии. ∇ — если есть дивергенция на AO в интервале 140 баров от последнего бара.

Сигнал пересечения барами зеленой линии (Lips) открытого индикатора Alligator (можно отключить в настройках индикатора в поле "Alligator > Enable crossing lips alerts"):

  • 🔴 Crossing Lips ↓ — если бар закрылся ниже линии Lips, которая выше остальных линий, при этом цена закрытия предыдущего бара находится выше линии Lips.
  • 🟢 Crossing Lips ↑ — если бар закрылся выше линии Lips, которая ниже остальных линий, при этом цена закрытия предыдущего бара находится ниже линии Lips.

Сигнал фрактала срабатывает после закрытия второго бара, завершающего формирование фрактала, если оповещения о фракталах включены в настройках индикатора (поле "Fractals > Enable alerts"):

  • 🟢 Fractal ▲ — верхний (Медвежий) фрактал.
  • 🔴 Fractal ▼ — нижний (Бычий) фрактал.
  • ⚪️ Fractal ▲/▼ — одновременно верхний и нижний фрактал.

↳ (H=high - L=low) = разница.

Если вы перенаправляете оповещения на URL вебхука, например, в бота Telegram, то вам необходимо установить шаблон оповещения для вебхука в настройках индикатора в поле "Webhook > Message" (содержит подсказку с примером), в котором в качестве текста сообщения достаточно указать текст {{message}}, который будет автоматически заменен на текст оповещения с тикером и ссылкой на TradingView.

‼️ Сигнал — это не призыв к действию, а лишь повод проанализировать график для принятия решения на основе правил вашей стратегии.
リリースノート:
Added a signal about the breakdown of the last upper or lower fractal, which is triggered immediately if alerts about fractals are enabled in the indicator settings (the "Fractals > Enable alerts" field):

  • 🟢 Breakout Fractal ▲ H={{high}} — breakout of the high of the last upper fractal.
  • 🔴 Breakout Fractal ▼ L={{low}} — breakout of the low of the last lower fractal.
  • ⚪️ Breakout Fractal ▲/▼ H={{high}} L={{low}} - breakout of the last upper and lower fractal simultaneously.

A signal about the appearance of a new maximum or minimum AO peak in the interval of 140 bars from the last bar is triggered after the bar closes, if alerts about the appearance of a maximum or minimum AO peak are enabled in the indicator settings (field "Interval for highest and lowest bars > Enable alerts for new MAX and MIN"):

  • 🟢 New MAX AO - new maximum AO peak, if the lowest bar is to the left of the highest bar in the interval of 140 bars from the last bar.
  • 🔴 New MIN AO - new minimum AO peak, if the highest bar is to the left of the lowest bar in the interval of 140 bars from the last bar.


***

Добавлен сигнал о пробое последнего верхнего или нижнего фрактала, который срабатывает сразу, если оповещения о фракталах включены в настройках индикатора (поле "Fractals > Enable alerts"):

  • 🟢 Breakout Fractal ▲ H={{high}} — пробой максимума последнего верхнего фрактала.
  • 🔴 Breakout Fractal ▼ L={{low}} — пробой минимума последнего нижнего фрактала.
  • ⚪️ Breakout Fractal ▲/▼ H={{high}} L={{low}} — пробой последнего верхнего и нижнего фрактала одновременно.

Сигнал о появлении нового максимального или минимального пика АО в интервале 140 баров от последнего бара срабатывает после закрытия бара, если оповещения о появлении максимального или минимального пика АО включены в настройках индикатора (поле "Interval for highest and lowest bars > Enable alerts for new MAX and MIN"):

  • 🟢 New MAX AO — новый максимальный пика AO, если самый низкий бар находится левее самого высокого бара в интервале 140 баров от последнего бара.
  • 🔴 New MIN AO — новый минимальный пика AO, если самый высокий бар находится левее самого низкого бара в интервале 140 баров от последнего бара.

リリースノート:
Added Alligator display for higher timeframe (with the same settings as Alligator for the current chart, with the exception of displaying the offset after the last bar due to technical features), if Alligator display for higher timeframe is enabled in the indicator settings (field "Alligator for higher timeframe > Enable"):

  • If the chart timeframe is one month, then the higher timeframe will be 4 months, for example, "1M – 4M", "2M – 8M".
  • If the chart timeframe is one week, then the higher timeframe will be one month, for example, "1W – 1M", "2W – 2M".
  • If the chart timeframe is one day, then the higher timeframe will be one week, for example, "1D – 1W", "2D – 2W".
  • If the chart timeframe is from 4 to 6 hours, then the higher timeframe will be "D", for example, "4h – 1D", "6h – 1D", "8h – 2D".
  • If the chart timeframe is 1 hour, then the higher timeframe will be 4 hours (60 * 4 = 240 minutes), for example, "1h – 240", "2h – 480".
  • If the chart timeframe is 15 minutes, then the higher timeframe will be 1 hour (15 * 4 = 60 minutes), for example, "5m – 20", "15m – 60", "30m – 120".
  • If the chart timeframe is 4 minutes, then the higher timeframe will be 15 minutes (4 * 3.75), for example, "1m – 4", "4m – 15".

In the indicator settings in the "Alligator for higher timeframe > Display higher timeframe" field, you can enable the display of the higher timeframe to the right of the Alligator lines, and you can also disable gaps and change the style of displaying the lines.


In addition, the "Enable all additional alerts" field has been added to enable alerts about all additional signals at once: crossing lips of an open Alligator, the formation of a fractal, the appearance of a new maximum or minimum AO peak.

***

Добавлено отображение Alligator для старшего таймфрейма (с теми же настройками, что и у Alligator для текущего графика, за исключением отображения смещения после последнего бара из-за технических особенностей), если отображение Alligator для старшего таймфрейма включено в настройках индикатора (поле "Alligator for higher timeframe > Enable"):

  • Если таймфрейм графика один месяц, то старший таймфрейм будет 4 месяца, например, "1M – 4M", "2M – 8M".
  • Если таймфрейм графика одна неделя, то старший таймфрейм будет один месяц, например, например, "1W – 1M", "2W – 2M".
  • Если таймфрейм графика один день, то старший таймфрейм будет одна неделя, например, "1D – 1W", "2D – 2W".
  • Если таймфрейм графика от 4 до 6 часов, то старший таймфрейм будет "D", например, "4h – 1D", "6h – 1D", "8h – 2D".
  • Если таймфрейм графика 1 час, то старший таймфрейм будет 4 часа (60 * 4 = 240 минут), например, "1h – 240", "2h – 480".
  • Если таймфрейм графика 15 минут, то старший таймфрейм будет 1 час (15 * 4 = 60 минут), например, "5m – 20", "15m – 60", "30m – 120".
  • Если таймфрейм графика 4 минуты, то старший таймфрейм будет 15 минут (4 * 3.75), например, "1m – 4", "4m – 15".

В настройках индикатора в поле "Alligator for higher timeframe > Display higher timeframe" можно включить отображение старшего таймфрейма справа от линий Alligator, а также можно отключить гэпы и изменить стиль отображения линий.


Кроме того, добавлено поле "Enable all additional alerts" для включения оповещений обо всех дополнительных сигналах сразу: пересечение губ открытого Alligator, формирование фрактала, появлении нового максимального или минимального пика АО.
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?