Almost seems like you were trying to hype a product from the way you sounded like you had it but didn't have it.. aside from that point ..
since the title of this is "volume forecast" here is my version of it, obviously it wont be the same as yours since the formula is different. As others in the thread have stated, it seems more like hype that anything else, but here goes the code for whoever can find it useful.
Note: Every timeframe will be different as it "forecasts" by the closest volume bars. If you want it relative to the Daily then use the day, if you want it relative to the minute then use the minute, if you want it relative to 30 mins, then use 30 mins and so on. It "Forecasts" till the closing bell, will not factor in afterhours.
Code:
#Volume ForeCast v1.0 by XeoNoX via usethinkscript.com
#Note: Every timeframe will be different as it "forecasts" by the closest volume.
# If you want it relative to the Daily then use the day, if you want it relative to the minute then use the minute, if you want it relative to 30 mins, then use 30 mins and so on.
# It "Forecasts" till the closing bell, will not factor in afterhours.
def Daily_Total_Vol = volume(period = AggregationPeriod.DAY);
def Current_Vol = volume;
def VolAvg = Average(volume, 10);
def VolAvg2 = Average(volume, 20);
def VolAvg3 = Average(volume, 50);
def mid_vol = (
if VolAvg > VolAvg2 and VolAvg < VolAvg3 then VolAvg else
if VolAvg < VolAvg2 and VolAvg > VolAvg3 then VolAvg else
if VolAvg2 > VolAvg3 and VolAvg2 < VolAvg then VolAvg2 else
if VolAvg2 < VolAvg3 and VolAvg2 > VolAvg then VolAvg2 else
if VolAvg3 > VolAvg2 and VolAvg3 < VolAvg then VolAvg3 else
if VolAvg3 < VolAvg2 and VolAvg3 > VolAvg then VolAvg3 else volavg2 );
def vf = (mid_vol * (RegularTradingEnd(GetYYYYMMDD()) - GetTime()) / GetAggregationPeriod()) + Daily_Total_Vol;
def percent = (Daily_Total_Vol)/vf;
AddLabel (yes, "VF: " + vf , Color.YELLOW);
AddLabel (yes, "Volume So Far: " + Daily_Total_Vol , Color.GREEN);
AddLabel (yes, "% of VF: " + round(percent*100,0) , Color.GRAY);