Found this one to be quite interesting, so I converted it over to ThinkorSwim. I also added paintbars (turned off by default) to highlight climatic volume bars.
- Climate volume detection
- Relative volume value in bar
- Automatic zone generation (possibility of configuration)
thinkScript Code
Code:
# Climatic Volume X
# Converted by BenTen at useThinkScript.com
# Original https://www.tradingview.com/script/rNEj0sM2-Climatic-Volume-X/
# Cloud Zone Code adopted from Larthomp's 'Big Bar Breakout' indicator
input limit_cloud_length = yes;
input cloud_length = 10;
input paintbar = no;
input Length = 10;
def AverageVolume = simpleMovingAvg(volume, Length);
def RelativeVolume = volume / AverageVolume;
input HighVolume = 2;
def a = RelativeVolume > HighVolume;
def climatice_vol = if a then 1 else 0;
def vol_high = if climatice_vol then high else vol_high[1];
def vol_low = if climatice_vol then low else vol_low[1];
def vol_length = if climatice_vol then 1 else vol_length[1] + 1;
plot vol_hh = if limit_cloud_length == no or limit_cloud_length == yes and vol_length <= cloud_length then vol_high
else Double.NaN;
plot vol_ll = if limit_cloud_length == no or limit_cloud_length == yes and vol_length <= cloud_length then vol_low
else Double.NaN;
vol_hh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
vol_ll.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
vol_hh.SetDefaultColor(Color.GRAY);
vol_ll.SetDefaultColor(Color.GRAY);
assignPriceColor(if paintbar and a then color.blue else color.current);