# 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[1];
def isLightGreen = up > down and volume < avgVolume[1];
def isOrange = up < down and volume < avgVolume[1];
def isRed = up < down and volume > avgVolume[1];

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[1];

def isLightGreen = Buying > Selling and volume < avgVolume[1];

def isOrange = Buying < Selling and volume < avgVolume[1];

def isRed = Buying < Selling and volume > avgVolume[1];

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

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?