This is a divergence indicator that draws regular and hidden divergences based on the Zigzag indicator and RSI indicator. There are two degrees of Zigzag. So, in each Zigzag degree, there are two types of regular divergences and one type of hidden divergence.
👉(The logic is written in case of a bearish regular divergence. The opposite will apply for a bullish one.)
Type 1 of regular divergence (Logic 1):
Zigzag has to form a higher high. The highest RSI within both Zigzag legs must form lower highs, but the RSI values which are exactly at the Zigzag highs should not form lower highs.
Type 2 of regular divergence (Logic 2):
Zigzag has to form a higher high. The highest RSI within both Zigzag legs must form lower highs, and the RSI values which are exactly at the Zigzag highs should form lower highs.
👉(The logic is written in case of a bearish hidden divergence. The opposite will apply for a bullish one.)
Zigzag has to form a lower high. The highest RSI within both Zigzag legs must form higher highs.
👉There is also a filter that will be applied to all the divergences. It only shows the divergences whose corresponding RSI value was above/below a level (overbought level/oversold level).
Logic for regular divergences:
Bearish regular divergence's first high's (leftmost) RSI value should be greater than or equal to 70.
Bullish regular divergence's first low's (leftmost) RSI value should be less than or equal to 30.
Logic for hidden divergences:
Bearish hidden divergence's second high's (rightmost) RSI value should be greater than or equal to 70.
Bullish hidden divergence's second low's (rightmost) RSI value should be less than or equal to 30.
👉There is another feature also. This indicator colors the background based on whether the RSI is in a bullish or bearish range.
If it's within 80-60, the background will be colored green (this means that RSI is in a bullish range).
If it's within 40-20, the background will be colored red (this means that RSI is in a bearish range).