Buongiorno,
gradirei testare questo indicatore che pur stand alone , viene utilizzato in abbinamento all’indicatore Alligator sempre di Williams (presente nella libreria PRT).
Grazie per il consueto aiuto.
https://it.tradingview.com/script/lLgCdjag-Bill-Williams-Divergent-Bars/
// Bill William Bull/Bear divergent bars
// See: Book, Trading Chaos by Bill Williams
//
// Coded by polyclick
//
// A bullish (green) divergent bar, signals a trend switch from bear -> bull
// -> The current bar has a lower low than the previous bar, but closes in the upper half of the candle.
// -> This means the bulls are pushing from below and are trying to take over, potentially resulting in a trend switch to bullish.
// -> We also check if this bar is below the three alligator lines to avoid false positives.
//
// A bearish (red) divergent bar, signals a trend switch from bull -> bear
// -> The current bar has a higher high than the previous bar, but closes in the lower half of the candle.
// -> This means the bears are pushing the price down and are taking over, potentially resulting in a trend switch to bearish.
// -> We also check if this bar is above the three alligator lines to avoid false positives.
//
// Best used in combination with the Bill Williams Alligator indicator.
//
study(title=”Divergent Bars”)
// utility function for smoothed average
smma(src, length) =>
smma = na(smma[1]) ? sma(src, length) : (smma[1] * (length – 1) + src) / length
smma
// teeth (bill w red line)
lips = smma(hl2, 5)[3]
teeth = smma(hl2, 8)[5]
jaw = smma(hl2, 13)[8]
// signals
bullDivSignal = low < low[1] and close > hl2 and high < lips and high < teeth and high < jaw
bearDivSignal = high > high[1] and close < hl2 and low > lips and low > teeth and low > jaw
// plot
plot(bullDivSignal, title=”Bullish divergent bars”, style=histogram, linewidth=3, color=green)
plot(bearDivSignal, title=”Bearish divergent bars”, style=histogram, linewidth=3, color=red)