IM SUPER IMPRESSED with this BOX VOLUME STATS indicator by enigma. I'm equally or even more impressed that some of you programming wizards are able to take existing code and modify it to accommodate other aspects. I have tried quite a few times and now that my fingers are bleeding. Im hoping to get some help.
I would like to convert this Enigmas indicator to be able to copy and paste in the Studies custom think script editor for the scanner, so i can save the scan. It would be nice to have the ability to change the percentage in the code to allow for different watchlists that alert (ex: 1 watchlist for 100% daily avg. volume another thats 200% or whatever percent anybody wanted to get a scan alert when it hit)
This would help because then instead of speed clicking down a watchlist of 100+ in the morning to see what tickers might be worth jumping in because volume is cooking would then just be able to have them narrowed down already in the scanners updated watchlist... Let me know if its feasible, I APPRECIATE YA!
I would like to convert this Enigmas indicator to be able to copy and paste in the Studies custom think script editor for the scanner, so i can save the scan. It would be nice to have the ability to change the percentage in the code to allow for different watchlists that alert (ex: 1 watchlist for 100% daily avg. volume another thats 200% or whatever percent anybody wanted to get a scan alert when it hit)
This would help because then instead of speed clicking down a watchlist of 100+ in the morning to see what tickers might be worth jumping in because volume is cooking would then just be able to have them narrowed down already in the scanners updated watchlist... Let me know if its feasible, I APPRECIATE YA!
Ruby:
# Box Volume Stats
# Version 1.2
# Created by: Enigma
# Created: 05/18/17
# Modified by: Surya Kiran C ## Included rVolume label and Changed length as input. ## Additionally Pre-Market, 1Hr Volume, AfterHour Volume labels are added.
declare on_volume;
input length = 30;
input ShowDayAvg = yes;
input ShowTodayVolume = yes;
input ShowPercentOfDayAvg = yes;
input UnusualVolumePercent = 200;
input ShowBarAvg = yes;
input ShowCurrentBar = yes;
input PreMktVol = yes;
input RTH1HrVol = yes;
input PostMktVol = yes;
def VolDayAvg = (fold index = 1 to length + 1 with Avg = 0 do (Avg + volume(period = "DAY")[index])) / length;
def AvgBars = (fold index2 = 1 to length + 1 with Bar = 0 do (Bar + volume[index2])) / length;
def Today = volume(period = "DAY");
def PercentOfDayAvg = Round((Today / VolDayAvg) * 100, 0);
def CurVol = volume;
def offset = 1;
def ADV = Average(volume, length)[offset];
def rVol = volume / ADV;
# Labels
#if GetAggregationPeriod() >= AggregationPeriod.DAY then 0 else if 1HrRTHVol then 1 else 0,
AddLabel(ShowDayAvg, length + "Day Avg: " + Round(VolDayAvg, 0) + " ", Color.LIGHT_GRAY);
AddLabel(ShowTodayVolume, "Today: " + Today + " ", (if PercentOfDayAvg >= UnusualVolumePercent then Color.GREEN else if PercentOfDayAvg >= 100 then Color.ORANGE else Color.LIGHT_GRAY));
AddLabel(ShowPercentOfDayAvg, PercentOfDayAvg + "%", (if PercentOfDayAvg >= UnusualVolumePercent then Color.GREEN else if PercentOfDayAvg >= 100 then Color.ORANGE else Color.WHITE) );
AddLabel(ShowBarAvg, "Avg" + length + "Bars: " + Round(AvgBars, 0) + " ", Color.LIGHT_GRAY);
AddLabel(ShowCurrentBar, "Cur Bar: " + CurVol + " ", (if CurVol >= AvgBars then Color.GREEN else Color.ORANGE));
AddLabel(yes, "rVol :" + Round(rVol, 2));
#AddLabel(yes, "ADV :" + ADV);
#AddLabel(yes, asPercent(rVol)); # remove "#" infront of Addlabels to select prefer choice
#AssignPriceColor(if rVol >= 1 then color.dark_red else if rVol <=.5 then Color.black else color.Gray);
#Pre, 1Hr RTH, AfterHours Volumes.
##if GetAggregationPeriod() >= AggregationPeriod.DAY then 0 else if PreMktVol then 1 else 0
input PrestartTime = 0400;
input PreendTime = 0929;
def PreMkt = SecondsFromTime(PrestartTime) >= 0 and SecondsTillTime(PreendTime) >= 0;
def PreVolMins = if PreMkt and !PreMkt[1] then volume
else if PreMkt then PreVolMins[1] + volume
else PreVolMins[1];
AddLabel(if GetAggregationPeriod() >= AggregationPeriod.DAY then 0 else if PreMktVol then 1 else 0, "PreMktVol = " + PreVolMins + " ", Color.Gray);
# End Volume PreMarket
input RTH1HrstartTime = 0930;
input RTH1HrendTime = 1029;
def RTH1Hr = SecondsFromTime(RTH1HrstartTime) >= 0 and SecondsTillTime(RTH1HrendTime) >= 0;
def RTH1HrMins = if RTH1Hr and !RTH1Hr[1] then volume
else if RTH1Hr then RTH1HrMins[1] + volume
else RTH1HrMins[1];
AddLabel(if GetAggregationPeriod() >= AggregationPeriod.DAY then 0 else if RTH1HrVol then 1 else 0, "RTH1HrVol = " + RTH1HrMins + " ", Color.Gray);
#End Volume RTH First 60 Mins
input PoststartTime = 1600;
input PostendTime = 1959;
def PostMkt = SecondsFromTime(PoststartTime) >= 0 and SecondsTillTime(PostendTime) >= 0;
def PostVolMins = if PostMkt and !PostMkt[1] then volume
else if PostMkt then PostVolMins[1] + volume
else PostVolMins[1];
AddLabel(if GetAggregationPeriod() >= AggregationPeriod.DAY then 0 else if PostMktVol then 1 else 0, "PostMktVol = " + PostVolMins + " ", Color.Gray);
# End Volume PostMarket
Last edited by a moderator: