This detects the following divergences between price and the oscillator.
- Regular Divergence: Price lower low | Oscillator higher low
- Regular Divergence: Price higher high | Oscillator lower high
- Hidden Divergence: Price higher low | Oscillator lower low
- Hidden Divergence: Price lower high | Oscillator higher high
Settings and Options.
- Lookback windows to identify .
- -The signal will be delayed by the number of bars used in the right lookback window.
- Maximum range to detect divergence is the largest distance allowed between two for them to be considered.
- Option to plot hidden and regular divergences.
- Option to use the price bars or oscillator to detect . If using price, the source used to calculate the oscillator (default is close) or high/low can be used.
Code borrowed from LazyBear (he has a long list of useful indicators)
- Price source.
- Lookback window.
Note: Click the settings cog next to the indicator name to access all the settings after addition of the indicator to the chart.
Links to my other indicators
TD sequential indicator
OBV Oscillator Divergences
RSI with a horizontal line
Average directional index with indicator
Bitmex 10% fee discount for 6 months
TradingView (50% off after trial period ends)