See: Book, Trading Chaos by
Coded by polyclick
A (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 .
-> We also check if this bar is below the three lines to avoid false positives.
A (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 .
-> We also check if this bar is above the three lines to avoid false positives.
Best used in combination with the indicator.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
Works best on higher timeframes (1H, 4H, 1D, ...).
It's important you look for, what Bill Williams calls, "angularation" before using the signal.
Angularation, for full explaination, check his book: "Trading Chaos".
Quick giveaway: draw an average line through the last few prices, draw an average line through the green/red line of the alligator.
When a divergent bar pops up when the angle between those 2 lines is very big, then the trend is about to switch.
So, what we want is: a divergent bar popping up from a big distance to the alligator. A correction, aka: trend switch will occur to go back to the alligator.
Then, for an extra confirmation, use the awesome oscillator.
For more insights, read his book, it's hard to explain it all in this description :D