v6.0
This is a significant release. Because Release Notes allow for a limited length of text, the release's notes are spread over two updates: v6.0 and v7.0. The code is the same in both.
The following improvements were made:
• A realtime calculation mode was added.
• Divergences are now calculated using different methods, depending on the display mode used.
• A new display mode showing Relative Delta Volume was added.
• Alerts can now be configured on the script.
• Inputs were streamlined and now contain tooltips showing more information on some of the inputs.
Realtime Mode
The script now works in realtime. This mode uses a completely different calculation method of Buy/Sell/Neutral volume than what is used on historical bars. Instead of intrabar inspection, which doesn't work in realtime, realtime mode uses a new Pine feature to calculate directional volume between volume/price updates during the realtime bars. Note that these updates are not the same as exchange ticks, as multiple exchange ticks can be aggregated in one TradingView price/volume update. When price increases between two realtime updates, the accrued volume between those updates is considered buying volume. If price does not change, then the volume is added to the neutral slot.
Realtime mode is interesting because it also allows the script to work on any timeframe. Certain precautions are required when interpreting data gathered during realtime bars:
1. While the script is still gathering Buy/Sell/Neutral volume, it is calculated using a different way, so the transition between historical bars and realtime bars will sometimes be bumpy.
2. Because realtime mode uses the volume data at the chart's timeframe, this means that on markets where end of day and intraday volume data differs
(i.e., markets where the "Show Intraday/Daily Volume Discrepancies" input setting will display a red background),
realtime calculations will typically be using much larger volume data than that used on historical bars if they are using an intraday intrabar timeframe.
This may cause important variations in the scale of values between historical and realtime bars.
3. If you refresh your chart or change inputs, which will force re-execution of the script, elapsed realtime bars will recalculate as historical bars, so using intrabar information.
Your elapsed realtime bar calculations on the chart will thus be lost.
A small dot appears on the zero line to distinguish bars calculated in realtime mode from historical bars. If you hover over the dot, a tooltip will display the number of realtime updates used to calculate delta volume on that bar. The more updates, the more reliable the information will be.
If you plan on using the indicator at chart timeframes that are not supported by the intrabar inspection calculations used on historical bars, you can turn the "Show Error Messages" input off.
Divergences
In previous versions, divergences were always calculated by comparing the values of the Buy/Sell volume on a bar with the direction of price on that bar. This mode is still used whenever columns are displayed. If, however, only the "Volume Balance MA Delta" or "Relative Delta Volume" signals are displayed, divergences occur when the signal's direction does not match the direction of the bar. As before, you can choose to display divergences in the indicator's pane, on chart bars, or both.