How to scan for breakout volume and rising price?



[I'm looking for help with coding, as well as others' opinions on strategy to help with the effectiveness of the scan.]


I've been using the relative volume scan that Sonny wrote in July, and have found it quite effective in identifying stocks that could potentially rise quickly. However, sometimes I'm a few minutes too late to safely ride the wave, while on others I'm two hours too late; the stocks still fit the parameters the scan searches on — good relative volume, price 10% above yesterday's close — but the positive volume has dried up and the stocks are fading. Finally, I'll cycle through that watchlist later in the day and be surprised to learn that stock X had a prolonged comeback starting at 1:30, but I was again too late to take advantage.

I've made a number of attempts at writing a scan to try to find stocks that are percolating at that moment, meaning either a series of long green bars (on the 1M) or a prolonged period of consecutive greens, but too often the scan is calling attention to a stock that has had minimal volume for a significant portion of the day other than the latest two greens. Basically, an outlier for the past 90 minutes.

My guess is an effective scan will involve custom studies, but I'm not getting it right yet. Here's my latest attempt, which is still finding stocks at the wrong time.

Unusual Volume: Current bar has increased 200% over the last 20 bars (Day Aggregation)
Unusual Volume: Current bar has increased 200% over the last 10 bars (1M Aggregation)
Price Change: Close has increased 1% greater than the last bar (1M Aggregation)
Custom: 9D MovAvgExponential crosses above the 21D MovAvgExponential (1M Aggregation)

So let me give the English code for what I think each step should be:
1) Identify all stocks that have been trading at an above average rate since the start of the day.
2) Whittle down to those stocks whose last bar had significantly more positive volume versus the last X amount of minutes — meaning price is rising with heavy volume — and/or whittle down to those stocks whose last two or three bars have been growing in price, even if the volume is only somewhat higher than the last X amount of minutes.
3) Whittle down further to those stocks whose 9D MovAvgExponential is crossing above the 21D MovAvgExponential. Or perhaps crossing above the VWAP. Or maybe "is above" would be better than crossing above. Also, I'm not sure if the Price Change above would be necessary if this is working properly.

The bottom line is I'm hoping someone can help with a scan that alerts to what we all can see visually twenty times a day: "If only I had been watching ABCD at 11:43, because the volume and price were starting to fly and that was the time to buy."

Thanks for any help or input.



New member
@CDJay I have a script that might be useful to you instead of looking at relative volume which is difficult to search for I made a code that looks for relative range...say your middday and the on the 5 min bars the last 20 bars the high was 5.00 and the low was 4.90 for an avg range of .10 all of a sudden it jumps to 5.05 well that's a 50% in range, volume is probably spiking too, I have code for the study and instructions on how to use it in a scanner as well as customized for a watchlist column in that thread...Good Luck!

Similar threads