Well.......I came up with this below and it works fine....BUT, I need it for a year. Unfortunately, I have no idea if there is a workaround to have it look at a year rather than a month, day, hour.
def poc = reference tpoProfile("price per row height mode" = "TICKSIZE", "time per profile" = "Month", "on expansion" = no, multiplier = 3).poc;
def vahigh = reference tpoProfile("price per row height mode" = "TICKSIZE", "time per profile" = "MONTH", "on expansion" = no, multiplier = 3).VAHigh;
def valow = reference tpoProfile("price per row height mode" = "TICKSIZE", "time per profile" = "MONTH", "on expansion" = no, multiplier = 3).VALow;
plot tpoc = poc[1];
plot tavahigh = vahigh[1];
plot tvalow = valow[1];
I dug deeper and found this that you had posted on another thread. I changed the 3 to a 12 (see bold print below) and it works just fine, however, it seems to address only the previous calender year....is there a way to simply address the previous 365 days ? In other words more of a rolling 365 days ?
input pricePerRowHeightMode = {default AUTOMATIC, TICKSIZE, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {CHART, MINUTE, HOUR, DAY, WEEK, MONTH, default QUARTER, "OPT EXP", BAR};
input multiplier = 1;
input onExpansion = no;
input profiles = 2;
input showPointOfControl = yes;
input showValueArea = yes;
input valueAreaPercent = 70;
input opacity = 50;
def period;
def yyyymmdd = GetYYYYMMDD();
def seconds = SecondsFromTime(0);
def month = GetYear() * 12 + GetMonth();
def day_number = DaysFromDate(First(yyyymmdd)) + GetDayOfWeek(First(yyyymmdd));
def dom = GetDayOfMonth(yyyymmdd);
def dow = GetDayOfWeek(yyyymmdd - dom + 1);
def expthismonth = (if dow > 5 then 27 else 20) - dow;
def exp_opt = month + (dom > expthismonth);
def qtr = (GetMonth() - 1 ) %
12;
switch (timePerProfile) {
case CHART:
period = 0;
case MINUTE:
period = Floor(seconds / 60 + day_number * 24 * 60);
case HOUR:
period = Floor(seconds / 3600 + day_number * 24);
case DAY:
period = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
case WEEK:
period = Floor(day_number / 7);
case MONTH:
period = Floor(month - First(month));
case QUARTER:
period = qtr == 0 and qtr[1] != 0;
case "OPT EXP":
period = exp_opt - First(exp_opt);
case BAR:
period = BarNumber() - 1;
}
def count = CompoundValue(1, if period != period[1] then (count[1] + period - period[1]) % multiplier else count[1], 0);
def cond = count < count[1] + period - period[1];
def height;
switch (pricePerRowHeightMode) {
case AUTOMATIC:
height = PricePerRow.AUTOMATIC;
case TICKSIZE:
height = PricePerRow.TICKSIZE;
case CUSTOM:
height = customRowHeight;
}
profile tpo = TimeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height, "value area percent" = valueAreaPercent);
def con = CompoundValue(1, onExpansion, no);
def pc = if IsNaN(tpo.GetPointOfControl()) and con then pc[1] else tpo.GetPointOfControl();
def hVA = if IsNaN(tpo.GetHighestValueArea()) and con then hVA[1] else tpo.GetHighestValueArea();
def lVA = if IsNaN(tpo.GetLowestValueArea()) and con then lVA[1] else tpo.GetLowestValueArea();
def hProfile = if IsNaN(tpo.GetHighest()) and con then hProfile[1] else tpo.GetHighest();
def lProfile = if IsNaN(tpo.GetLowest()) and con then lProfile[1] else tpo.GetLowest();
def plotsDomain = IsNaN(close) == onExpansion;
plot POC = if plotsDomain then pc else Double.NaN;
plot VAH = if plotsDomain then hVA else Double.NaN;
plot VAL = if plotsDomain then lVA else Double.NaN;
def poc1 = if POC != POC[1] then pc[1] else poc1[1];
#plot xpoc1 = poc1;
def vah1 = if VAH != VAH[1] then VAH[1] else vah1[1];
#plot xvah1 = vah1;
def val1 = if VAL != VAL[1] then VAL[1] else val1[1];
#plot xval1 = val1;
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAH.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#xpoc1.SetPaintingStrategy(PaintingStrategy.DASHES);
#xvah1.SetPaintingStrategy(PaintingStrategy.DASHES);
#xval1.SetPaintingStrategy(PaintingStrategy.DASHES);
POC.SetDefaultColor(Color.RED);
VAH.SetDefaultColor(Color.YELLOW);
VAL.SetDefaultColor(Color.YELLOW);
#xpoc1.SetDefaultColor(Color.RED);
#xvah1.SetDefaultColor(Color.YELLOW);
#xval1.SetDefaultColor(Color.YELLOW);