This is a volume indicator has two Input values, where the longer length is compared to the shorter length.
That percent value is a hidden plot called vol_pct, which can be easily used in a Scan to find volume breakouts on any time frame. Use this vol_pct plot to create a custom column on your Scan Results list. Then when you do a Scan, for example: stocks that have had a 200% volume increase in the past 15 minutes, the vol_pct column on your Scan Results will match the white label Percent Value, displayed on your chart. If your results don't match, let me know.
PS: If you have two monitors, rather than saving the entire Scan Results to a Watchlist, you might find it easier to drag and drop potential breakouts from the Scan Results list to a chart on your 2nd monitor. Also, the potential breakouts that you want to keep an eye on, can also be easily dragged and dropped into any existing Watchlist. The one with the Gadgets that pops out from the left hand size of the screen.
- long length: the overall length to look back.
- short length: the most forward length to be compared to the longer length.
That percent value is a hidden plot called vol_pct, which can be easily used in a Scan to find volume breakouts on any time frame. Use this vol_pct plot to create a custom column on your Scan Results list. Then when you do a Scan, for example: stocks that have had a 200% volume increase in the past 15 minutes, the vol_pct column on your Scan Results will match the white label Percent Value, displayed on your chart. If your results don't match, let me know.
PS: If you have two monitors, rather than saving the entire Scan Results to a Watchlist, you might find it easier to drag and drop potential breakouts from the Scan Results list to a chart on your 2nd monitor. Also, the potential breakouts that you want to keep an eye on, can also be easily dragged and dropped into any existing Watchlist. The one with the Gadgets that pops out from the left hand size of the screen.
Code:
## Paul Townsend, 2019
declare lower;
input LongLenth = 100;
input shortLength = 5;
def lookBackVolume = average(volume[shortLength] /10000,LongLenth);
def recentVolume = average(volume /10000,shortLength);
plot lookback_Length = roundup(lookBackVolume,0);
lookback_Length.AssignValueColor(Color.white);
lookback_Length.SetLineWeight(3);
plot recent_percent_length = roundup(recentVolume,0);
recent_percent_length.AssignValueColor(Color.green);
recent_percent_length.AssignValueColor(if recentVolume > recentVolume[1] then Color.cyan else Color.magenta );
recent_percent_length.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
recent_percent_length.SetLineWeight(2);
def volpct = round((recentVolume - lookBackVolume) / lookBackVolume * 100,0);
plot vol_pct = volpct;
vol_pct.hide();
addlabel(yes, volpct + " %",color.white);
Attachments
Last edited by a moderator: