Version 1.4 & 1.5 Changes
Chart Background Color
I have eliminated the need to define the chart background color. It was used to hollow out candle bodies when the volume didn't increase on that bar (when the corresponding option was selected, as it is by default). Instead, I don't use any color on the bodies now, which makes them see-through. It has the slight disadvantage of showing what's behind the body, but it allows the indicator to show decreasing volume bars on any chart background.
Divergence display on candle bodies
I have increased the priority of the display of divergences on bodies when they occur on decreasing volume bars and the option to empty bodies on decreasing volume is also selected. Before this update, emptying the body had precedence over showing divergences. Now, divergences have priority, so they will always show, even when volume is decreasing on the bar where they occur.
Divergence Levels
I have added a new component, which automatically builds dynamic levels based on divergences.
Setup:
1 — Select the "Mode" to determine which of the 3 types of divergence you want the levels to be calculated on.
One type of divergence corresponds to each of the 3 types of "volume balances" the indicator can use.
It will be easier to follow the levels logic if your candle bodies use the same type of divergence (determined by the "Mode" you use for the candles).
2 — Choose the "Hi/Lo levels" you want to use to define the divergence levels. "Full Range" refers to the total height of candles, including the volume tops/bottoms,
which may or may not be higher/lower than the candle's high/low. You can also choose Tops/Bottoms, High/Low or Open/Close.
When a new divergence level is created, this setting determines which value the indicator will use to create it.
3 — Specify the "Breach Reference", i.e., what condition is used to determine when a divergence level has been breached.
When a range is selected, the whole range must be outside the levels for the breach condition to be true.
When a level is used, only one of the levels needs to breach the divergence levels.
4 — Three colors and a common brightness are associated to the possible states for the levels: Bull means the breach reference is higher than the levels,
Bear means it's lower, and Neutral means the breach reference level(s) is between the levels.
5 — Choose if you want to fill the levels.
How it works:
• When a divergence occurs, the user-defined hi/lo levels determine where a new set of levels starts.
• Until there is a breach, levels will expand with each new divergence that is found, if the hi/lo levels on that bar are higher/lower than the current divergence levels.
• When a breach is detected, levels enter a mode where they will reset (rather than expand) on a new divergence. If that divergence happens to be on the bar where the breach occurs,
they will reset immediately, but a new divergence may also only happen after 10 bars. Until that happens, the levels will remain unchanged.
• After a breach has occurred, the brightness of the levels will increase to its maximum. This is the only visual clue signaling a breach has occurred (other than the candle itself),
so in order for you to see the difference, it's best to use a normal brightness level that will allow you to easily distinguish both brightnesses if you want to monitor breaches.