 # Volume Confirmation Indicator Version 2

##### Member
VIP
VIP Enthusiast
The idea is Buying + Selling = Volume. Thus plotting Buying/Volume and Selling/Volume tells us which side is more aggressive. If my strategy says go long then I enter the trade when the Buyers are more aggressive and volume is above average.

*This is just something early stages I am working on as far as volume confirmations, I hope to add to its value more later
**In the future I will probably consider adding multi time frame so then I have multiple confirmations from different angles.

Code:
``````declare lower;

input length = 12;

def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;

def SellingPer = (H-C)/(H-L);

def down = SellingPer;

def avgVolume = Average(volume, length = length);

def isGreen = up > down and volume > avgVolume;
def isLightGreen = up > down and volume < avgVolume;
def isOrange = up < down and volume < avgVolume;
def isRed = up < down and volume > avgVolume;

up.DefineColor("Green", Color.GREEN);
up.DefineColor("LightGreen", Color.Light_GREEN);
up.DefineColor("Orange", Color.ORANGE);
up.DefineColor("Red", Color.RED);
up.AssignValueColor(if isGreen then up.Color("Green") else if isLightGreen then up.Color("LightGreen") else if isOrange then up.Color("Orange") else if isRed then up.Color("Red") else Color.LIGHT_GRAY);``````

### Here is Version 1

Code:
``````input agg = AggregationPeriod.WEEK;

input length = 12;

def O = open;

def H = high;

def C = close;

def L = low;

def V = volume;

def Selling = V*(H-C)/(H-L);

Assert(length > 0, "'length' must be positive: " + length);

#def avgPrice = ExpAverage(close(period = agg), length = length);

def avgVolume = ExpAverage(volume, length = length);

def isGreen = Buying > Selling and volume > avgVolume;

def isLightGreen = Buying > Selling and volume < avgVolume;

def isOrange = Buying < Selling and volume < avgVolume;

def isRed = Buying < Selling and volume > avgVolume;

plot Vol = volume;

Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

Vol.SetLineWeight(3);

Vol.DefineColor("Green", Color.GREEN);

Vol.DefineColor("LightGreen", Color.Light_GREEN);

Vol.DefineColor("Orange", Color.ORANGE);

Vol.DefineColor("Red", Color.RED);

Vol.AssignValueColor(if isGreen then Vol.Color("Green") else if isLightGreen then Vol.Color("LightGreen") else if isOrange then Vol.Color("Orange") else if isRed then Vol.Color("Red") else Color.LIGHT_GRAY);``````

Last edited by a moderator:
• #### Kalyandundi

##### New member
VIP
Awesome.....
which time frame you prefer for better results?

##### Member
VIP
VIP Enthusiast
My strategy looks at the last 90 days to establish an uptrend and then I look at the dips on the hourly with volume as confirmation. Anything less than an hour seems to give to many false signals imho but day trading is not my style, I usually swing trade

• Kalyandundi