Counting bars up with greater than 150% of average volume
Author: Tobey
Creation Date: 2/16/2019 6:24 PM
profile picture

Tobey

#1
Hi Cone & Eugene,

I'd like to count & graph the number of days a stock was up on volume greater than 150% of the average volume for the last 50 days.

This link looks like it is close to what I am trying to do.
https://www.wealth-lab.com/Forum/Posts/Using-Multi-Condition-Group-for-consecutive-condition-quot-Volume-above-below-SMA-quot-36724

But in the code below I'm not getting it to work. Hope I'm on the right track.

Thanks again for all your help
Tobey

New code starts at //Count Heavy Volume Days

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Tobey, this should get the job done:

CODE:
Please log in to see this code.
profile picture

Tobey

#3
Hi Eugene,

The code above is counting consecutive days the stock move on Heavy Volume.

I am looking to count the total number of days a stock was up on heavy volume (greater than 150% of its 50 day volume average) over the last 30 days.

Once I got that figured out I want to reverse it and count the number of days it was down on heavy volume. And then subtract Up from down. The HvyVol.jpg is an example of what it might look like. Red tracks the number of down days on heavy volume in the past 30 days. Green tracks Up days on heavy volume. White is Up Days less down days.

So at the end of the graph you can see in the last 30 days the stock was up 4 day on heavy volume and down 2 days on Heavy volume. So Up days less down days gives us a white line of 2.

I'm hoping this can be used to scan beaten down stock to find where buyers are coming back into the stock.

I hope this makes things clear.

As always thanks for your help!
Tobey

profile picture

Eugene

#4
Hi Tobey,

Makes sense. Thanks for the clarification. Is this closer to what you're looking for?

CODE:
Please log in to see this code.
profile picture

Tobey

#5
Hi Eugene,

This is great! I added a variable for the moving average seperate from the lookback period. And put it all in one indicator panel. I think my changes to the code are working.

Thanks so much for the help
Tobey

CODE:
Please log in to see this code.
profile picture

Eugene

#6
Looks good to me.
profile picture

Tobey

#7
Hi Eugene,

Now that, with your help, I've got it working I'd like to back test with different stops.

Once again thanks for the help
Tobey
profile picture

Eugene

#8
Tobey, I am pleased to know that it's working for you.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).