Volume Profile Indicator & POCs For ThinkOrSwim

See if the bold code change below does what you want
OENVaL4.png


For anyone who cares 1500 will make it one continuous AA/PM line
 
This is a paid script that I don't have

@draw9300 @Tiredoflosing - this is pretty close to that study you posted.


Code:
# Volume Profile RTH / ETH
# by bigboss

input rth_start = 0930;
input eth_start = 1800;

def cond = secondsTillTime(rth_start) == 0 or secondstilltime(eth_start)==0;
def eth = if secondstilltime(rth_start) == 0 then 0 else if secondstilltime(eth_start)==0 then 1 else eth[1];

profile vol = volumeProfile("startNewProfile" = cond, "onExpansion" = no, "numberOfProfiles" = 1000, "pricePerRow" = priceperrow.TICKSIZE, "value area percent" = 70);
def con = compoundValue(1, no, no);
def pc = if IsNaN(vol.getPointOfControl()) and con then pc[1] else vol.getPointOfControl();
def hVA = if IsNaN(vol.getHighestValueArea()) and con then hVA[1] else vol.getHighestValueArea();
def lVA = if IsNaN(vol.getLowestValueArea()) and con then lVA[1] else vol.getLowestValueArea();

def hProfile = if IsNaN(vol.getHighest()) and con then hProfile[1] else vol.getHighest();
def lProfile = if IsNaN(vol.getLowest()) and con then lProfile[1] else vol.getLowest();
def plotsDomain = IsNaN(close) == no;

plot POC = if plotsDomain then pc else Double.NaN;
plot ProfileHigh = if plotsDomain then hProfile else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile else Double.NaN;
plot VAHigh = if plotsDomain then hVA else Double.NaN;
plot VALow = if plotsDomain then lVA else Double.NaN;

DefineGlobalColor("Profile", color.gray);
DefineGlobalColor("Point Of Control", Color.LIGHT_ORANGE);
DefineGlobalColor("Value Area", GetColor(8));

vol.show(globalColor("Profile"), if yes then globalColor("Point Of Control") else color.current, if no then globalColor("Value Area") else color.current, 50);
POC.SetDefaultColor(globalColor("Point Of Control"));
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VALow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetDefaultColor(globalColor("Value Area"));
VALow.SetDefaultColor(globalColor("Value Area"));
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));

profilehigh.AssignValueColor(if eth then color.black else color.white);
profilelow.AssignValueColor(if eth then color.black else color.white);
poc.AssignValueColor(if eth then  createcolor(159,255,255) else color.orange);
profilehigh.setlineWeight(2);
profilelow.setlineWeight(2);
poc.setlineWeight(2);
vahigh.AssignValueColor(if eth then createcolor(55,125,125) else createcolor(22,65,144));
valow.AssignValueColor(if eth then createcolor(55,125,125) else createcolor(22,65,144));
def exp = eth;
addcloud(if !exp then vahigh else double.nan, if !exp then valow else double.nan,  createcolor(22,65,144),  createcolor(22,65,144));
addcloud(if exp then vahigh else double.nan, if exp then valow else double.nan, createcolor(55,125,125), createcolor(5,125,125));

addcloud(if exp then vahigh else double.nan, if exp then profilehigh else double.nan, color.gray, color.GRAY);
addcloud(if exp then valow else double.nan, if exp then profilelow else double.nan, color.gray, color.gray);
addcloud(if !exp then vahigh else double.nan, if !exp then profilehigh else double.nan, color.gray, color.GRAY);
addcloud(if !exp then valow else double.nan, if !exp then profilelow else double.nan, color.gray, color.gray);
 
Odd question but on the default TPO/VPOC scripts is there a way to remove the current time per profile line and keep only the previous anchored ones?
zAwkdKy.png


Like this 1 hour per profile line wouldn't open this new profile line until that hour is over

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2010-2022
#

input pricePerRowHeightMode = {default AUTOMATIC, TICKSIZE, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {default CHART, MINUTE, HOUR, DAY, WEEK, MONTH, "OPT EXP", BAR};
input multiplier = 1;
input onExpansion = yes;
input profiles = 1000;
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);
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 "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 ProfileHigh = if plotsDomain then hProfile else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile else Double.NaN;
plot VAHigh = if plotsDomain then hVA else Double.NaN;
plot VALow = if plotsDomain then lVA else Double.NaN;

DefineGlobalColor("Profile", GetColor(1));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", GetColor(8));

tpo.show(globalColor("Profile"), if showPointOfControl then globalColor("Point Of Control") else color.current, if showValueArea then globalColor("Value Area") else color.current, opacity);
POC.SetDefaultColor(globalColor("Point Of Control"));
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VALow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetDefaultColor(globalColor("Value Area"));
VALow.SetDefaultColor(globalColor("Value Area"));
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));
ProfileHigh.hide();
ProfileLow.hide();
 
@BeakedFish There is an indicator that can create support and resistance zones based on high volume i believe, if this helps.

YlS7jnj.png


Code:
#A nice indicator to play with. See notes below.
#Using volume to determine significant areas of support / resistance on intra-day charts.
#This indicator will work on 5 minute charts or below. The green boxes show the major areas
#from the morning sessions; gray boxes are from the mid-day session; and yellow boxes are from
#the late-afternoon session. The gray lines are the significant areas from the previous day.

def Today = if getday() == getlastday() then 1 else 0;

# Split the day into three trading blocks
def block1 = if SecondsFromTime(0930) >= 0 and SecondsTillTime(1100) > 0 then 1 else 0;
def block2 = if SecondsFromTime(1100) >= 0 and SecondsTillTime(1400) > 0 then 1 else 0;
def block3 = if SecondsFromTime(1400) >= 0 and SecondsTillTime(1600) > 0 then 1 else 0;

def startBlock1 = if block1 and !block1[1] then 1 else 0;
def startBlock2 = if block2 and !block2[1] then 1 else 0;
def startBlock3 = if block3 and !block3[1] then 1 else 0;

# Determine the first bar of the day
def nMinutes = GetAggregationPeriod() / 60000;
def nBars = RoundUp(390 / nMinutes, 0);
def FirstBar = if (BarNumber() - 1) % nBars == 0 then 1 else 0;

# Determine day number
def dayNumber = 1 + RoundDown((BarNumber() - 1) / nBars, 0);

# Track volume in each session block
def vol1 = if !block1 then 0 else if block1 and volume(period="5 min" ) > vol1[1] then volume(period="5 min" ) else vol1[1];
def vol2 = if !block2 then 0 else if block2 and volume(period="5 min" ) > vol2[1] then volume(period="5 min" ) else vol2[1];
def vol3 = if !block3 then 0 else if block3 and volume(period="5 min" ) > vol3[1] then volume(period="5 min" ) else vol3[1];

# Determine high / low for each block
def HighB1 = if startBlock1 then high(period="5 min" ) else if block1 and volume(period="5 min" ) > vol1[1] then high(period="5 min" ) else HighB1[1];
def LowB1 = if startBlock1 then low(period="5 min" ) else if block1 and volume(period="5 min" ) > vol1[1] then low(period="5 min" ) else LowB1[1];
def HighB2 = if startBlock2 then high(period="5 min" ) else if block2 and volume(period="5 min" ) > vol2[1] then high(period="5 min" ) else HighB2[1];
def LowB2 = if startBlock2 then low(period="5 min" ) else if block2 and volume(period="5 min" ) > vol2[1] then low(period="5 min" ) else LowB2[1];
def HighB3 = if startBlock3 then high(period="5 min" ) else if block3 and volume(period="5 min" ) > vol3[1] then high(period="5 min" ) else HighB3[1];
def LowB3 = if startBlock3 then low(period="5 min" ) else if block3 and volume(period="5 min" ) > vol3[1] then low(period="5 min" ) else LowB3[1];

# Plot today's data
plot hb1 = HighB1;
plot lb1 = LowB1;
plot hb2 = if block1 and dayNumber == 1 then Double.NaN else HighB2;
plot lb2 = if block1 and dayNumber == 1 then Double.NaN else LowB2;
plot hb3 = if (block1 or block2) and dayNumber == 1 then Double.NaN else HighB3;
plot lb3 = if (block1 or block2) and dayNumber == 1 then Double.NaN else LowB3;

hb1.SetHiding(1);
hb2.SetHiding(1);
hb3.SetHiding(1);
lb1.SetHiding(1);
lb2.SetHiding(1);
lb3.SetHiding(1);

# Color between the lines
def chb1 = if  hb1 == hb1[-1] then hb1 else double.nan;
def chb2 = if  !block1 and hb2 == hb2[-1] then hb2 else double.nan;
def chb3 = if  block3 and hb3 == hb3[-1] then hb3 else double.nan;
AddCloud(chb1, lb1, color.light_green);
AddCloud(chb2, lb2, color.white);
AddCloud(chb3, lb3, color.yellow);

# Plot yesterday's data
def hb2_1 = if daynumber == 1 then double.nan else if firstbar then highb1[1] else hb2_1[1];
def lb2_1 = if daynumber == 1 then double.nan else if firstbar then lowb1[1] else lb2_1[1];
def hb2_2 = if daynumber ==1 then double.nan else if firstbar then highb2[1] else hb2_2[1];
def lb2_2 = if daynumber == 1 then double.nan else if firstbar then lowb2[1] else lb2_2[1];
def hb2_3 = if daynumber ==1 then double.nan else if firstbar then highb3[1] else hb2_3[1];
def lb2_3 = if daynumber == 1 then double.nan else if firstbar then lowb3[1] else lb2_3[1];

plot l1 = hb2_1;
plot l2 = lb2_1;
plot l3 = hb2_2;
plot l4 = lb2_2;
plot l5 = hb2_3;
plot l6 = lb2_3;

l1.setdefaultColor(color.light_gray);
l2.setdefaultcolor(color.light_gray);
l3.setdefaultcolor(color.light_gray);
l4.setdefaultcolor(color.light_gray);
l5.setdefaultcolor(color.light_gray);
l6.setdefaultcolor(color.light_gray);
l1.setpaintingStrategy(paintingStrategy.HORIZONTAL);
l2.setpaintingStrategy(paintingStrategy.HORIZONTAL);
l3.setpaintingStrategy(paintingStrategy.HORIZONTAL);
l4.setpaintingStrategy(paintingStrategy.HORIZONTAL);
l5.setpaintingStrategy(paintingStrategy.HORIZONTAL);
l6.setpaintingStrategy(paintingStrategy.HORIZONTAL);
Do you use this? If so, what do you make of the Grey and Yellow zones? Once out of the Green, Grey is upper lvl resistance, and yellow as support? I've seen on lower time frames the Grey zone being in the green zone. Just wondering how you read this. Thank you.
 
Do you use this? If so, what do you make of the Grey and Yellow zones? Once out of the Green, Grey is upper lvl resistance, and yellow as support? I've seen on lower time frames the Grey zone being in the green zone. Just wondering how you read this. Thank you.
i dont use it, i think its areas where there was high volume in think that grey zones are smaller volume areas, i just posted it for the code, incase someone wanted to use it.
 
Great thread. Does anyone have a script to post a clearly delineated day/week/month Volume Profile with POC on the same chart?
 
I am using volume profile POS values and trying to get the yellow POC line extend as price levels. Like white lines shown below in pic.

thanks in advance

cPPc2PK.png














input timeFrame = { default DAY, WEEK, MONTH};





input pricePerRowHeightMode = {default AUTOMATIC, TICKSIZE, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {default CHART, MINUTE, HOUR, DAY, WEEK, MONTH, "OPT EXP", BAR};
input multiplier = 1;
input onExpansion = yes;
input profiles = 1000;
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);
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 "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 vol = volumeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height, "value area percent" = valueAreaPercent);
def con = compoundValue(1, onExpansion, no);
def pc = if IsNaN(vol.getPointOfControl()) and con then pc[1] else vol.getPointOfControl();
def hVA = if IsNaN(vol.getHighestValueArea()) and con then hVA[1] else vol.getHighestValueArea();
def lVA = if IsNaN(vol.getLowestValueArea()) and con then lVA[1] else vol.getLowestValueArea();

def hProfile = if IsNaN(vol.getHighest()) and con then hProfile[1] else vol.getHighest();
def lProfile = if IsNaN(vol.getLowest()) and con then lProfile[1] else vol.getLowest();
def plotsDomain = IsNaN(close) == onExpansion;

def tf1d = AggregationPeriod.week;


plot POC = if plotsDomain then pc else Double.NaN;
plot ProfileHigh = if plotsDomain then hProfile else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile else Double.NaN;
plot VAHigh = if plotsDomain then hVA else Double.NaN;
plot VALow = if plotsDomain then lVA else Double.NaN;

DefineGlobalColor("Profile", GetColor(1));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", GetColor(8));

vol.show(globalColor("Profile"), if showPointOfControl then globalColor("Point Of Control") else color.current, if showValueArea then globalColor("Value Area") else color.current, opacity);
POC.SetDefaultColor(globalColor("Point Of Control"));
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VALow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetDefaultColor(globalColor("Value Area"));
VALow.SetDefaultColor(globalColor("Value Area"));
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));
ProfileHigh.hide();
ProfileLow.hide();
 
Great thread. Does anyone have a script to post a clearly delineated day/week/month Volume Profile with POC on the same chart?

This uses the script function to create the 3 profilles

Capture.jpg
Ruby:
script vp {
# TD Ameritrade IP Company, Inc. (c) 2010-2022
#

    input pricePerRowHeightMode = {AUTOMATIC, default TICKSIZE, CUSTOM};
    input customRowHeight = 1.0;
    input timePerProfile = {default CHART, MINUTE, HOUR, DAY, WEEK, MONTH, "OPT EXP", BAR};
    input multiplier = 1;
    input onExpansion = no;
    input profiles = 1;
    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);
    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 "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 vol = VolumeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height, "value area percent" = valueAreaPercent);
    def con = CompoundValue(1, onExpansion, no);
    def pc = if IsNaN(vol.GetPointOfControl()) and con then pc[1] else vol.GetPointOfControl();
    def hVA = if IsNaN(vol.GetHighestValueArea()) and con then hVA[1] else vol.GetHighestValueArea();
    def lVA = if IsNaN(vol.GetLowestValueArea()) and con then lVA[1] else vol.GetLowestValueArea();

    def hProfile = if IsNaN(vol.GetHighest()) and con then hProfile[1] else vol.GetHighest();
    def lProfile = if IsNaN(vol.GetLowest()) and con then lProfile[1] else vol.GetLowest();
    def plotsDomain = IsNaN(close) == onExpansion;

    plot POC = if plotsDomain then pc else Double.NaN;
    plot ProfileHigh = if plotsDomain then hProfile else Double.NaN;
    plot ProfileLow = if plotsDomain then lProfile else Double.NaN;
    plot VAHigh = if plotsDomain then hVA else Double.NaN;
    plot VALow = if plotsDomain then lVA else Double.NaN;

    DefineGlobalColor("Profile", GetColor(1));
    DefineGlobalColor("Point Of Control", GetColor(5));
    DefineGlobalColor("Value Area", GetColor(8));

    vol.Show(GlobalColor("Profile"), if showPointOfControl then GlobalColor("Point Of Control") else Color.CURRENT, if showValueArea then GlobalColor("Value Area") else Color.CURRENT, opacity);
}

plot dpoc = vp("time per profile" = "DAY");
plot wpoc = vp("time per profile" = "WEEK");
plot mpoc = vp("time per profile" = "MONTH");

plot dvah = vp("time per profile" = "DAY").VAHigh;
plot wvah = vp("time per profile" = "WEEK").VAHigh;
plot mvah = vp("time per profile" = "MONTH").VAHigh;

plot dval = vp("time per profile" = "DAY").VALow;
plot wval = vp("time per profile" = "WEEK").VALow;
plot mval = vp("time per profile" = "MONTH").VALow;

DefineGlobalColor("Profile", GetColor(1));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", GetColor(8));

dpoc.SetDefaultColor(GlobalColor("Point Of Control"));
dpoc.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
dvah.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
dval.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
dvah.SetDefaultColor(GlobalColor("Value Area"));
dval.SetDefaultColor(GlobalColor("Value Area"));

wpoc.SetDefaultColor(GlobalColor("Point Of Control"));
wpoc.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
wvah.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
wval.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
wvah.SetDefaultColor(GlobalColor("Value Area"));
wval.SetDefaultColor(GlobalColor("Value Area"));

mpoc.SetDefaultColor(GlobalColor("Point Of Control"));
mpoc.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
mvah.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
mval.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
mvah.SetDefaultColor(GlobalColor("Value Area"));
mval.SetDefaultColor(GlobalColor("Value Area"));

input showbubbles = yes;
input bubblemover = 3;
def m = bubblemover;
def m1 = m + 1;

AddChartBubble(showbubbles and IsNaN(close[m]) and !IsNaN(close[m1]), dpoc[m1], "DPOC", dpoc.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[m]) and !IsNaN(close[m1]), wpoc[m1], "WPOC", wpoc.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[m]) and !IsNaN(close[m1]), mpoc[m1], "MPOC", mpoc.TakeValueColor());

AddChartBubble(showbubbles and IsNaN(close[m]) and !IsNaN(close[m1]), dvah[m1], "DVAH", dvah.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[m]) and !IsNaN(close[m1]), wvah[m1], "WVAH", wvah.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[m]) and !IsNaN(close[m1]), mvah[m1], "MVAH", mvah.TakeValueColor());

AddChartBubble(showbubbles and IsNaN(close[m]) and !IsNaN(close[m1]), dval[m1], "DVAL", dval.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[m]) and !IsNaN(close[m1]), wval[m1], "WVAL", wval.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[m]) and !IsNaN(close[m1]), mval[m1], "MVAL", mval.TakeValueColor());
 
This might work on most symbols and timeframes that match the periods you requested. The way this works is to assign different values to each period, which remain the same until the next period. The variable cond then prints a new volume profile when the values change.

Is there way to change the layout of the volume profile. The Volume profile starts from right to left. Is there way to flip the profile starts from right side of the chart?

Thank u🙏
 
I am using volume profile POS values and trying to get the yellow POC line extend as price levels. Like white lines shown below in pic.

thanks in advance

cPPc2PK.png

Here is the script you provided with 5 poc extensions to the right added at the bottom of the code. You can create more using the logic in the code. It is a very manual process.

Capture.jpg
Ruby:
#input timeFrame = { default DAY, WEEK, MONTH};

input pricePerRowHeightMode = {default AUTOMATIC, TICKSIZE, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {default CHART, MINUTE, HOUR, DAY, WEEK, MONTH, "OPT EXP", BAR};
input multiplier = 1;
input onExpansion = yes;
input profiles = 1000;
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);
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 "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 vol = VolumeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height, "value area percent" = valueAreaPercent);
def con = CompoundValue(1, onExpansion, no);
def pc = if IsNaN(vol.GetPointOfControl()) and con then pc[1] else vol.GetPointOfControl();
def hVA = if IsNaN(vol.GetHighestValueArea()) and con then hVA[1] else vol.GetHighestValueArea();
def lVA = if IsNaN(vol.GetLowestValueArea()) and con then lVA[1] else vol.GetLowestValueArea();

def hProfile = if IsNaN(vol.GetHighest()) and con then hProfile[1] else vol.GetHighest();
def lProfile = if IsNaN(vol.GetLowest()) and con then lProfile[1] else vol.GetLowest();
def plotsDomain = IsNaN(close) == onExpansion;

def tf1d = AggregationPeriod.WEEK;


plot POC = if plotsDomain then pc else Double.NaN;
plot ProfileHigh = if plotsDomain then hProfile else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile else Double.NaN;
plot VAHigh = if plotsDomain then hVA else Double.NaN;
plot VALow = if plotsDomain then lVA else Double.NaN;

DefineGlobalColor("Profile", GetColor(1));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", GetColor(8));

vol.Show(GlobalColor("Profile"), if showPointOfControl then GlobalColor("Point Of Control") else Color.CURRENT, if showValueArea then GlobalColor("Value Area") else Color.CURRENT, opacity);
POC.SetDefaultColor(GlobalColor("Point Of Control"));
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VALow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetDefaultColor(GlobalColor("Value Area"));
VALow.SetDefaultColor(GlobalColor("Value Area"));
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));
ProfileHigh.Hide();
ProfileLow.Hide();


def vp = if IsNaN(close) then vp[1] else POC;
plot v = vp;
v.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
v.SetDefaultColor(Color.WHITE);
v.SetLineWeight(3);

def poc1 = if POC != POC[1] then POC[1] else poc1[1];
def vp1 = if IsNaN(close) then vp1[1] else poc1;
plot v1 = vp1;
v1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
v1.SetDefaultColor(Color.WHITE);
v1.SetLineWeight(3);

def poc2 = if poc1 != poc1[1] then poc1[1] else poc2[1];
def vp2 = if IsNaN(close) then vp2[1] else poc2;
plot v2 = vp2;
v2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
v2.SetDefaultColor(Color.WHITE);
v2.SetLineWeight(3);

def poc3 = if poc2 != poc2[1] then poc2[1] else poc3[1];
def vp3 = if IsNaN(close) then vp3[1] else poc3;
plot v3 = vp3;
v3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
v3.SetDefaultColor(Color.WHITE);
v3.SetLineWeight(3);

def poc4 = if poc3 != poc3[1] then poc3[1] else poc4[1];
def vp4 = if IsNaN(close) then vp4[1] else poc4;
plot v4 = vp4;
v4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
v4.SetDefaultColor(Color.WHITE);
v4.SetLineWeight(3);

def poc5 = if poc4 != poc4[1] then poc4[1] else poc5[1];
def vp5 = if IsNaN(close) then vp5[1] else poc5;
plot v5 = vp5;
v5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
v5.SetDefaultColor(Color.WHITE);
v5.SetLineWeight(3);
 
Last edited:
This might work on most symbols and timeframes that match the periods you requested. The way this works is to assign different values to each period, which remain the same until the next period. The variable cond then prints a new volume profile when the values change.
Can this indicator be turn into monkey bar indicator or flip the indicator? Starts from the right and points to left.

I looked at the link you shared. can it be applied to the code you created for me?
 
Last edited:
Can this indicator be turn into monkey bar indicator or flip the indicator? Starts from the right and points to left.

I looked at the link you shared. can it be applied to the code you created for me?
Basically, no. We do not have very much control or actual understanding of how TOS forms the profiles. The monkey bars does not look usable when breaking it down similar to the link.
 
@rlohmeyer Is this any better?

Code:
# Profile TPO & Volume
input profileType = {default Volume, Time};
input pricePerRowHeightMode = {default Ticksize, Automatic, Custom};
input customRowHeight = 1.0;
input timePerProfile = {default Day, Week, Month, Year, Hour, Chart, "Opt Exp"};
input multiplier = 1;
input OnExpansionProfile = No;
input OnExpansionValueArea = No;
input profiles = 2;
input showPointOfControl = Yes;
input showValueArea = Yes;
input ValueAreaPercent = 70;
input ShowHighLow = Yes;
input opacity = 5;
input ShowExtensions = No;
input DynamicHideExtensions = Yes;
def SE = ShowExtensions;


def period;
def yyyymmdd = GetYYYYMMDD();
def seconds = SecondsFromTime(0);
def month = GetYear() * 12 + GetMonth();
def year = GetYear();
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);
switch (timePerProfile) {
case Chart:
    period = 0;
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 Year:
    period = Floor(year - First(year));
case "Opt Exp":
    period = exp_opt - First(exp_opt);
}

def CloseByPeriod = close(Period = timePerProfile)[-1];
def Openbyperiod  = open(Period = timePerProfile)[-1];
def NewDay = if !IsNaN(CloseByPeriod) then 0 else 1;

rec Count = if period != period[1] then (Count[1] + period - period[1]) % 1 else Count[1];
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 VOL = if profileType == profileType.Volume then VolumeProfile("startNewProfile" = Cond, "onExpansion" = onExpansionProfile, "NumberOfProfiles" = profiles, "PricePerRow" = height, "Value Area Percent" = ValueAreaPercent) else TimeProfile("startNewProfile" = Cond, "OnExpansion" = onExpansionProfile, "NumberOfProfiles" = profiles, "PricePerRow" = height, "Value Area Percent" = ValueAreaPercent);

def con = CompoundValue(1, onExpansionProfile, no);
rec pc = if IsNaN(VOL.GetPointOfControl()) and con then pc[1] else VOL.GetPointOfControl();
rec hVA = if IsNaN(VOL.GetHighestValueArea()) and con then hVA[1] else VOL.GetHighestValueArea();
rec lVA = if IsNaN(VOL.GetLowestValueArea()) and con then lVA[1] else VOL.GetLowestValueArea();
rec HVA_Last = if period == period[1] then HVA_Last[1] else hVA[1];
rec PC_Last  = if period == period[1] then PC_Last[1]  else pc[1];
rec LVA_Last = if period == period[1] then LVA_Last[1] else lVA[1];
rec hProfile = if IsNaN(VOL.GetHighest()) and con then hProfile[1] else VOL.GetHighest();
rec lProfile = if IsNaN(VOL.GetLowest()) and con then lProfile[1] else VOL.GetLowest();
def plotsDomain = IsNaN(close) == onExpansionProfile;

rec hP_Last = if period == period[1] then hP_Last[1] else hProfile[1];
rec lP_Last = if period == period[1] then lP_Last[1] else lProfile[1];

plot VAH  = if !showValueArea then Double.NaN else if IsNaN(close[0]) then HVA_Last[0] else if !OnExpansionValueArea then HVA_Last[0] else Double.NaN;
plot POC  = if IsNaN(close[0]) then PC_Last[0] else if !OnExpansionValueArea then PC_Last[0] else Double.NaN;
plot VAL  = if !showValueArea then Double.NaN else if IsNaN(close[0]) then LVA_Last[0] else if !OnExpansionValueArea then LVA_Last[0] else Double.NaN;
plot High = if !ShowHighLow then Double.NaN else if IsNaN(close[0]) then hP_Last[0] else if !OnExpansionValueArea then hP_Last[0] else Double.NaN;
plot Low = if !ShowHighLow then Double.NaN else if IsNaN(close[0]) then lP_Last[0] else if !OnExpansionValueArea then lP_Last[0] else Double.NaN;

DefineGlobalColor("Profile", GetColor(7));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", GetColor(8));


POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
POC.SetDefaultColor(Color.DARK_GRAY);
POC.SetLineWeight(1);
POC.HideTitle();

VAH.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAH.SetDefaultColor(Color.DARK_GREEN);
VAH.SetLineWeight(1);
VAH.HideBubble();
VAH.HideTitle();

VAL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAL.SetDefaultColor(Color.DARK_RED);
VAL.SetLineWeight(1);
VAL.HideBubble();
VAL.HideTitle();

High.SetPaintingStrategy(PaintingStrategy.DASHES);
High.SetDefaultColor(CreateColor(38, 38, 8));
High.SetLineWeight(1);
High.HideBubble();
High.HideTitle();

Low.SetPaintingStrategy(PaintingStrategy.DASHES);
Low.SetDefaultColor(CreateColor(38, 38, 8));
Low.SetLineWeight(1);
Low.HideBubble();
Low.HideTitle();
For this particular code could someone add a piece of code to shade in between the VAH and VAL?
 
For this particular code could someone add a piece of code to shade in between the VAH and VAL?

Adjust the opacity and global color for value area to your liking in the following modification to the above code. Vol.show() was added to accomplish this.

Ruby:
# Profile TPO & Volume
input profileType = {default Volume, Time};
input pricePerRowHeightMode = {default Ticksize, Automatic, Custom};
input customRowHeight = 1.0;
input timePerProfile = {default Day, Week, Month, Year, Hour, Chart, "Opt Exp"};
input multiplier = 1;
input OnExpansionProfile = No;
input OnExpansionValueArea = No;
input profiles = 2;
input showPointOfControl = Yes;
input showValueArea = Yes;
input ValueAreaPercent = 70;
input ShowHighLow = Yes;
input opacity = 40;
input ShowExtensions = No;
input DynamicHideExtensions = Yes;
def SE = ShowExtensions;


def period;
def yyyymmdd = GetYYYYMMDD();
def seconds = SecondsFromTime(0);
def month = GetYear() * 12 + GetMonth();
def year = GetYear();
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);
switch (timePerProfile) {
case Chart:
    period = 0;
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 Year:
    period = Floor(year - First(year));
case "Opt Exp":
    period = exp_opt - First(exp_opt);
}

def CloseByPeriod = close(Period = timePerProfile)[-1];
def Openbyperiod  = open(Period = timePerProfile)[-1];
def NewDay = if !IsNaN(CloseByPeriod) then 0 else 1;

rec Count = if period != period[1] then (Count[1] + period - period[1]) % 1 else Count[1];
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 VOL = if profileType == profileType.Volume then VolumeProfile("startNewProfile" = Cond, "onExpansion" = onExpansionProfile, "NumberOfProfiles" = profiles, "PricePerRow" = height, "Value Area Percent" = ValueAreaPercent) else TimeProfile("startNewProfile" = Cond, "OnExpansion" = onExpansionProfile, "NumberOfProfiles" = profiles, "PricePerRow" = height, "Value Area Percent" = ValueAreaPercent);

def con = CompoundValue(1, onExpansionProfile, no);
rec pc = if IsNaN(VOL.GetPointOfControl()) and con then pc[1] else VOL.GetPointOfControl();
rec hVA = if IsNaN(VOL.GetHighestValueArea()) and con then hVA[1] else VOL.GetHighestValueArea();
rec lVA = if IsNaN(VOL.GetLowestValueArea()) and con then lVA[1] else VOL.GetLowestValueArea();
rec HVA_Last = if period == period[1] then HVA_Last[1] else hVA[1];
rec PC_Last  = if period == period[1] then PC_Last[1]  else pc[1];
rec LVA_Last = if period == period[1] then LVA_Last[1] else lVA[1];
rec hProfile = if IsNaN(VOL.GetHighest()) and con then hProfile[1] else VOL.GetHighest();
rec lProfile = if IsNaN(VOL.GetLowest()) and con then lProfile[1] else VOL.GetLowest();
def plotsDomain = IsNaN(close) == onExpansionProfile;

rec hP_Last = if period == period[1] then hP_Last[1] else hProfile[1];
rec lP_Last = if period == period[1] then lP_Last[1] else lProfile[1];

plot VAH  = if !showValueArea then Double.NaN else if IsNaN(close[0]) then HVA_Last[0] else if !OnExpansionValueArea then HVA_Last[0] else Double.NaN;
plot POC  = if IsNaN(close[0]) then PC_Last[0] else if !OnExpansionValueArea then PC_Last[0] else Double.NaN;
plot VAL  = if !showValueArea then Double.NaN else if IsNaN(close[0]) then LVA_Last[0] else if !OnExpansionValueArea then LVA_Last[0] else Double.NaN;
plot High = if !ShowHighLow then Double.NaN else if IsNaN(close[0]) then hP_Last[0] else if !OnExpansionValueArea then hP_Last[0] else Double.NaN;
plot Low = if !ShowHighLow then Double.NaN else if IsNaN(close[0]) then lP_Last[0] else if !OnExpansionValueArea then lP_Last[0] else Double.NaN;

DefineGlobalColor("Profile", GetColor(7));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", color.cyan);

vol.Show("va color" = globalColor("value area"), color = Color.CURRENT, "volume color" = Color.CURRENT, opacity = opacity);

POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
POC.SetDefaultColor(Color.DARK_GRAY);
POC.SetLineWeight(1);
POC.HideTitle();

VAH.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAH.SetDefaultColor(Color.DARK_GREEN);
VAH.SetLineWeight(1);
VAH.HideBubble();
VAH.HideTitle();

VAL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAL.SetDefaultColor(Color.DARK_RED);
VAL.SetLineWeight(1);
VAL.HideBubble();
VAL.HideTitle();

High.SetPaintingStrategy(PaintingStrategy.DASHES);
High.SetDefaultColor(CreateColor(38, 38, 8));
High.SetLineWeight(1);
High.HideBubble();
High.HideTitle();

Low.SetPaintingStrategy(PaintingStrategy.DASHES);
Low.SetDefaultColor(CreateColor(38, 38, 8));
Low.SetLineWeight(1);
Low.HideBubble();
Low.HideTitle();
 
The hidebubble function to hide the bubbles on the price axis is not able to be modified. So I made code to hide them all.

I then created addchartbubbles with the option to display the price at the end of the poc lines remaining uncrossed.

You may want to reduce the number of plots if this study slows your computer,

Capture.jpg
Ruby:
#Example_Prior Day_POC_Extended_until_Crossed_
[QUOTE]
#20171027 - BLT... chat request by Tb8... using parts of TOS VolumeProfile study to define POC
#Black lines are extended until POC crossed

# VolumeProfile
# TD Ameritrade IP Company, Inc. (c) 2010-2017
#

def height = PricePerRow.TICKSIZE;
input timePerProfile = {CHART, MINUTE, HOUR, default DAY, WEEK, MONTH, "OPT EXP", BAR};
input multiplier = 1;
input profiles = 1000;
input valueAreaPercent = 70;

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);
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 "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];
profile vol = VolumeProfile("startNewProfile" = cond, "numberOfProfiles" = profiles, "pricePerRow" = height, "value area percent" = valueAreaPercent, onExpansion = no);

def HVA = if IsNaN(vol.GetHighestValueArea()) then HVA[1] else vol.GetHighestValueArea();
def pHVA = CompoundValue(1, if cond then HVA[1] else pHVA[1], Double.NaN);
def LVA = if IsNaN(vol.GetLowestValueArea()) then LVA[1] else vol.GetLowestValueArea();
def pLVA = CompoundValue(1, if cond then LVA[1] else pLVA[1], Double.NaN);

#Define Prior POC Calc.
def POC = if IsNaN(vol.GetPointOfControl()) and cond then POC[1] else vol.GetPointOfControl();
def pPOC = CompoundValue (1, if cond then POC[1] else pPOC[1], Double.NaN);

def CurHVA = HVA;
def CurLVA = LVA;

def PrevHVA = pHVA;
def PrevLVA = pLVA;

#Plot Prior POC
def xppoc    = if period != period[1] then 1 else if xppoc[1] == 1 and close crosses pPOC then 0 else xppoc[1];

plot PrevPOC = pPOC;

PrevPOC.SetPaintingStrategy(PaintingStrategy.POINTS);
PrevPOC.SetDefaultColor(Color.PLUM);

###
#20171027 - Additional Code for Limited Extended POC plot request by Tb8
input debug = no;
plot xx = if !debug then Double.NaN else period;
xx.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);

input c = close;#change this to some other price if desired

#Extends Plot of pPOC (Point of Control) for each day to the right
def p1a = if period == 90 then pPOC else p1a[1];
def p2a = if period == 89 then pPOC else p2a[1];
def p3a = if period == 88 then pPOC else p3a[1];
def p4a = if period == 87 then pPOC else p4a[1];
def p5a = if period == 86 then pPOC else p5a[1];
def p6a = if period == 85 then pPOC else p6a[1];
def p7a = if period == 84 then pPOC else p7a[1];
def p8a = if period == 83 then pPOC else p8a[1];
def p9a = if period == 82 then pPOC else p9a[1];
def p10a = if period == 81 then pPOC else p10a[1];
def p11a = if period == 80 then pPOC else p11a[1];
def p12a = if period == 79 then pPOC else p12a[1];
def p13a = if period == 78 then pPOC else p13a[1];
def p14a = if period == 77 then pPOC else p14a[1];
def p15a = if period == 76 then pPOC else p15a[1];
def p16a = if period == 75 then pPOC else p16a[1];
def p17a = if period == 74 then pPOC else p17a[1];
def p18a = if period == 73 then pPOC else p18a[1];
def p19a = if period == 72 then pPOC else p19a[1];
def p20a = if period == 71 then pPOC else p20a[1];

def p1b = if period == 70 then pPOC else p1b[1];
def p2b = if period == 69 then pPOC else p2b[1];
def p3b = if period == 68 then pPOC else p3b[1];
def p4b = if period == 67 then pPOC else p4b[1];
def p5b = if period == 66 then pPOC else p5b[1];
def p6b = if period == 65 then pPOC else p6b[1];
def p7b = if period == 64 then pPOC else p7b[1];
def p8b = if period == 63 then pPOC else p8b[1];
def p9b = if period == 62 then pPOC else p9b[1];
def p10b = if period == 61 then pPOC else p10b[1];
def p11b = if period == 60 then pPOC else p11b[1];
def p12b = if period == 59 then pPOC else p12b[1];
def p13b = if period == 58 then pPOC else p13b[1];
def p14b = if period == 57 then pPOC else p14b[1];
def p15b = if period == 56 then pPOC else p15b[1];
def p16b = if period == 55 then pPOC else p16b[1];
def p17b = if period == 54 then pPOC else p17b[1];
def p18b = if period == 53 then pPOC else p18b[1];
def p19b = if period == 52 then pPOC else p19b[1];
def p20b = if period == 51 then pPOC else p20b[1];

def p1c = if period == 50 then pPOC else p1c[1];
def p2c = if period == 49 then pPOC else p2c[1];
def p3c = if period == 48 then pPOC else p3c[1];
def p4c = if period == 47 then pPOC else p4c[1];
def p5c = if period == 46 then pPOC else p5c[1];
def p6c = if period == 45 then pPOC else p6c[1];
def p7c = if period == 44 then pPOC else p7c[1];
def p8c = if period == 43 then pPOC else p8c[1];
def p9c = if period == 42 then pPOC else p9c[1];
def p10c = if period == 41 then pPOC else p10c[1];
def p11c = if period == 40 then pPOC else p11c[1];
def p12c = if period == 39 then pPOC else p12c[1];
def p13c = if period == 38 then pPOC else p13c[1];
def p14c = if period == 37 then pPOC else p14c[1];
def p15c = if period == 36 then pPOC else p15c[1];
def p16c = if period == 35 then pPOC else p16c[1];
def p17c = if period == 34 then pPOC else p17c[1];
def p18c = if period == 33 then pPOC else p18c[1];
def p19c = if period == 32 then pPOC else p19c[1];
def p20c = if period == 31 then pPOC else p20c[1];

def p1d = if period == 30 then pPOC else p1d[1];
def p2d = if period == 29 then pPOC else p2d[1];
def p3d = if period == 28 then pPOC else p3d[1];
def p4d = if period == 27 then pPOC else p4d[1];
def p5d = if period == 26 then pPOC else p5d[1];
def p6d = if period == 25 then pPOC else p6d[1];
def p7d = if period == 24 then pPOC else p7d[1];
def p8d = if period == 23 then pPOC else p8d[1];
def p9d = if period == 22 then pPOC else p9d[1];
def p10d = if period == 21 then pPOC else p10d[1];

def p1 = if period == 20 then pPOC else p1[1];
def p2 = if period == 19 then pPOC else p2[1];
def p3 = if period == 18 then pPOC else p3[1];
def p4 = if period == 17 then pPOC else p4[1];
def p5 = if period == 16 then pPOC else p5[1];
def p6 = if period == 15 then pPOC else p6[1];
def p7 = if period == 14 then pPOC else p7[1];
def p8 = if period == 13 then pPOC else p8[1];
def p9 = if period == 12 then pPOC else p9[1];
def p10 = if period == 11 then pPOC else p10[1];
def p11 = if period == 10 then pPOC else p11[1];
def p12 = if period == 9 then pPOC else p12[1];
def p13 = if period == 8 then pPOC else p13[1];
def p14 = if period == 7 then pPOC else p14[1];
def p15 = if period == 6 then pPOC else p15[1];
def p16 = if period == 5 then pPOC else p16[1];
def p17 = if period == 4 then pPOC else p17[1];
def p18 = if period == 3 then pPOC else p18[1];
def p19 = if period == 2 then pPOC else p19[1];
def p20 = if period == 1 then pPOC else p20[1];


#Defines Crossing of 'c'(can be defined to be other prices) and a POC at any point after the extended POC line is plotted... initially this is defined as a one.. once crossed it becomes zero
def xp1a = if period[1] == 89 and period == 90 then 1 else if xp1a[1] == 1 and c crosses p1a then 0 else xp1a[1];
def xp2a = if period[1] == 88 and period == 89 then 1 else if xp2a[1] == 1 and c crosses p2a then 0 else xp2a[1];
def xp3a = if period[1] == 87 and period == 88 then 1 else if xp3a[1] == 1 and c crosses p3a then 0 else xp3a[1];
def xp4a = if period[1] == 86 and period == 87 then 1 else if xp4a[1] == 1 and c crosses p4a then 0 else xp4a[1];
def xp5a = if period[1] == 85 and period == 86 then 1 else if xp5a[1] == 1 and c crosses p5a then 0 else xp5a[1];
def xp6a = if period[1] == 84 and period == 85 then 1 else if xp6a[1] == 1 and c crosses p6a then 0 else xp6a[1];
def xp7a = if period[1] == 83 and period == 84 then 1 else if xp7a[1] == 1 and c crosses p7a then 0 else xp7a[1];
def xp8a = if period[1] == 82 and period == 83 then 1 else if xp8a[1] == 1 and c crosses p8a then 0 else xp8a[1];
def xp9a = if period[1] == 81 and period == 82 then 1 else if xp9a[1] == 1 and c crosses p9a then 0 else xp9a[1];
def xp10a = if period[1] == 80 and period == 81 then 1 else if xp10a[1] == 1 and c crosses p10a then 0 else xp10a[1];
def xp11a = if period[1] == 79 and period == 80 then 1 else if xp11a[1] == 1 and c crosses p11a then 0 else xp11a[1];
def xp12a = if period[1] == 78 and period == 79 then 1 else if xp12a[1] == 1 and c crosses p12a then 0 else xp12a[1];
def xp13a = if period[1] == 77 and period == 78 then 1 else if xp13a[1] == 1 and c crosses p13a then 0 else xp13a[1];
def xp14a = if period[1] == 76 and period == 77 then 1 else if xp14a[1] == 1 and c crosses p14a then 0 else xp14a[1];
def xp15a = if period[1] == 75 and period == 76 then 1 else if xp15a[1] == 1 and c crosses p15a then 0 else xp15a[1];
def xp16a = if period[1] == 74 and period == 75 then 1 else if xp16a[1] == 1 and c crosses p16a then 0 else xp16a[1];
def xp17a = if period[1] == 73 and period == 74 then 1 else if xp17a[1] == 1 and c crosses p17a then 0 else xp17a[1];
def xp18a = if period[1] == 72 and period == 73 then 1 else if xp18a[1] == 1 and c crosses p18a then 0 else xp18a[1];
def xp19a = if period[1] == 71 and period == 72 then 1 else if xp19a[1] == 1 and c crosses p19a then 0 else xp19a[1];
def xp20a = if period[1] == 70 and period == 71 then 1 else if xp20a[1] == 1 and c crosses p20a then 0 else xp20a[1];
def xp1b = if period[1] == 69 and period == 70 then 1 else if xp1b[1] == 1 and c crosses p1b then 0 else xp1b[1];
def xp2b = if period[1] == 68 and period == 69 then 1 else if xp2b[1] == 1 and c crosses p2b then 0 else xp2b[1];
def xp3b = if period[1] == 67 and period == 68 then 1 else if xp3b[1] == 1 and c crosses p3b then 0 else xp3b[1];
def xp4b = if period[1] == 66 and period == 67 then 1 else if xp4b[1] == 1 and c crosses p4b then 0 else xp4b[1];
def xp5b = if period[1] == 65 and period == 66 then 1 else if xp5b[1] == 1 and c crosses p5b then 0 else xp5b[1];
def xp6b = if period[1] == 64 and period == 65 then 1 else if xp6b[1] == 1 and c crosses p6b then 0 else xp6b[1];
def xp7b = if period[1] == 63 and period == 64 then 1 else if xp7b[1] == 1 and c crosses p7b then 0 else xp7b[1];
def xp8b = if period[1] == 62 and period == 63 then 1 else if xp8b[1] == 1 and c crosses p8b then 0 else xp8b[1];
def xp9b = if period[1] == 61 and period == 62 then 1 else if xp9b[1] == 1 and c crosses p9b then 0 else xp9b[1];
def xp10b = if period[1] == 60 and period == 61 then 1 else if xp10b[1] == 1 and c crosses p10b then 0 else xp10b[1];
def xp11b = if period[1] == 59 and period == 60 then 1 else if xp11b[1] == 1 and c crosses p11b then 0 else xp11b[1];
def xp12b = if period[1] == 58 and period == 59 then 1 else if xp12b[1] == 1 and c crosses p12b then 0 else xp12b[1];
def xp13b = if period[1] == 57 and period == 58 then 1 else if xp13b[1] == 1 and c crosses p13b then 0 else xp13b[1];
def xp14b = if period[1] == 56 and period == 57 then 1 else if xp14b[1] == 1 and c crosses p14b then 0 else xp14b[1];
def xp15b = if period[1] == 55 and period == 56 then 1 else if xp15b[1] == 1 and c crosses p15b then 0 else xp15b[1];
def xp16b = if period[1] == 54 and period == 55 then 1 else if xp16b[1] == 1 and c crosses p16b then 0 else xp16b[1];
def xp17b = if period[1] == 53 and period == 54 then 1 else if xp17b[1] == 1 and c crosses p17b then 0 else xp17b[1];
def xp18b = if period[1] == 52 and period == 53 then 1 else if xp18b[1] == 1 and c crosses p18b then 0 else xp18b[1];
def xp19b = if period[1] == 51 and period == 52 then 1 else if xp19b[1] == 1 and c crosses p19b then 0 else xp19b[1];
def xp20b = if period[1] == 50 and period == 51 then 1 else if xp20b[1] == 1 and c crosses p20b then 0 else xp20b[1];

def xp1c = if period[1] == 49 and period == 50 then 1 else if xp1c[1] == 1 and c crosses p1c then 0 else xp1c[1];
def xp2c = if period[1] == 48 and period == 49 then 1 else if xp2c[1] == 1 and c crosses p2c then 0 else xp2c[1];
def xp3c = if period[1] == 47 and period == 48 then 1 else if xp3c[1] == 1 and c crosses p3c then 0 else xp3c[1];
def xp4c = if period[1] == 46 and period == 47 then 1 else if xp4c[1] == 1 and c crosses p4c then 0 else xp4c[1];
def xp5c = if period[1] == 45 and period == 46 then 1 else if xp5c[1] == 1 and c crosses p5c then 0 else xp5c[1];
def xp6c = if period[1] == 44 and period == 45 then 1 else if xp6c[1] == 1 and c crosses p6c then 0 else xp6c[1];
def xp7c = if period[1] == 43 and period == 44 then 1 else if xp7c[1] == 1 and c crosses p7c then 0 else xp7c[1];
def xp8c = if period[1] == 42 and period == 43 then 1 else if xp8c[1] == 1 and c crosses p8c then 0 else xp8c[1];
def xp9c = if period[1] == 41 and period == 42 then 1 else if xp9c[1] == 1 and c crosses p9c then 0 else xp9c[1];
def xp10c = if period[1] == 40 and period == 41 then 1 else if xp10c[1] == 1 and c crosses p10c then 0 else xp10c[1];
def xp11c = if period[1] == 39 and period == 40 then 1 else if xp11c[1] == 1 and c crosses p11c then 0 else xp11c[1];
def xp12c = if period[1] == 38 and period == 39 then 1 else if xp12c[1] == 1 and c crosses p12c then 0 else xp12c[1];
def xp13c = if period[1] == 37 and period == 38 then 1 else if xp13c[1] == 1 and c crosses p13c then 0 else xp13c[1];
def xp14c = if period[1] == 36 and period == 37 then 1 else if xp14c[1] == 1 and c crosses p14c then 0 else xp14c[1];
def xp15c = if period[1] == 35 and period == 36 then 1 else if xp15c[1] == 1 and c crosses p15c then 0 else xp15c[1];
def xp16c = if period[1] == 34 and period == 35 then 1 else if xp16c[1] == 1 and c crosses p16c then 0 else xp16c[1];
def xp17c = if period[1] == 33 and period == 34 then 1 else if xp17c[1] == 1 and c crosses p17c then 0 else xp17c[1];
def xp18c = if period[1] == 32 and period == 33 then 1 else if xp18c[1] == 1 and c crosses p18c then 0 else xp18c[1];
def xp19c = if period[1] == 31 and period == 32 then 1 else if xp19c[1] == 1 and c crosses p19c then 0 else xp19c[1];
def xp20c = if period[1] == 30 and period == 31 then 1 else if xp20c[1] == 1 and c crosses p20c then 0 else xp20c[1];

def xp1d = if period[1] == 29 and period == 30 then 1 else if xp1d[1] == 1 and c crosses p1d then 0 else xp1d[1];
def xp2d = if period[1] == 28 and period == 29 then 1 else if xp2d[1] == 1 and c crosses p2d then 0 else xp2d[1];
def xp3d = if period[1] == 27 and period == 28 then 1 else if xp3d[1] == 1 and c crosses p3d then 0 else xp3d[1];
def xp4d = if period[1] == 26 and period == 27 then 1 else if xp4d[1] == 1 and c crosses p4d then 0 else xp4d[1];
def xp5d = if period[1] == 25 and period == 26 then 1 else if xp5d[1] == 1 and c crosses p5d then 0 else xp5d[1];
def xp6d = if period[1] == 24 and period == 25 then 1 else if xp6d[1] == 1 and c crosses p6d then 0 else xp6d[1];
def xp7d = if period[1] == 23 and period == 24 then 1 else if xp7d[1] == 1 and c crosses p7d then 0 else xp7d[1];
def xp8d = if period[1] == 22 and period == 23 then 1 else if xp8d[1] == 1 and c crosses p8d then 0 else xp8d[1];
def xp9d = if period[1] == 21 and period == 22 then 1 else if xp9d[1] == 1 and c crosses p9d then 0 else xp9d[1];
def xp10d = if period[1] == 20 and period == 21 then 1 else if xp10d[1] == 1 and c crosses p10d then 0 else xp10d[1];

def xp1 = if period[1] == 19 and period == 20 then 1 else if xp1[1] == 1 and c crosses p1 then 0 else xp1[1];
def xp2 = if period[1] == 18 and period == 19 then 1 else if xp2[1] == 1 and c crosses p2 then 0 else xp2[1];
def xp3 = if period[1] == 17 and period == 18 then 1 else if xp3[1] == 1 and c crosses p3 then 0 else xp3[1];
def xp4 = if period[1] == 16 and period == 17 then 1 else if xp4[1] == 1 and c crosses p4 then 0 else xp4[1];
def xp5 = if period[1] == 15 and period == 16 then 1 else if xp5[1] == 1 and c crosses p5 then 0 else xp5[1];
def xp6 = if period[1] == 14 and period == 15 then 1 else if xp6[1] == 1 and c crosses p6 then 0 else xp6[1];
def xp7 = if period[1] == 13 and period == 14 then 1 else if xp7[1] == 1 and c crosses p7 then 0 else xp7[1];
def xp8 = if period[1] == 12 and period == 13 then 1 else if xp8[1] == 1 and c crosses p8 then 0 else xp8[1];
def xp9 = if period[1] == 11 and period == 12 then 1 else if xp9[1] == 1 and c crosses p9 then 0 else xp9[1];
def xp10 = if period[1] == 10 and period == 11 then 1 else if xp10[1] == 1 and c crosses p10 then 0 else xp10[1];
def xp11 = if period[1] == 9 and period == 10 then 1 else if xp11[1] == 1 and c crosses p11 then 0 else xp11[1];
def xp12 = if period[1] == 8 and period == 9 then 1 else if xp12[1] == 1 and c crosses p12 then 0 else xp12[1];
def xp13 = if period[1] == 7 and period == 8 then 1 else if xp13[1] == 1 and c crosses p13 then 0 else xp13[1];
def xp14 = if period[1] == 6 and period == 7 then 1 else if xp14[1] == 1 and c crosses p14 then 0 else xp14[1];
def xp15 = if period[1] == 5 and period == 6 then 1 else if xp15[1] == 1 and c crosses p15 then 0 else xp15[1];
def xp16 = if period[1] == 4 and period == 5 then 1 else if xp16[1] == 1 and c crosses p16 then 0 else xp16[1];
def xp17 = if period[1] == 3 and period == 4 then 1 else if xp17[1] == 1 and c crosses p17 then 0 else xp17[1];
def xp18 = if period[1] == 2 and period == 3 then 1 else if xp18[1] == 1 and c crosses p18 then 0 else xp18[1];
def xp19 = if period[1] == 1 and period == 2 then 1 else if xp19[1] == 1 and c crosses p19 then 0 else xp19[1];
def xp20 = if period[1] == 0 and period == 1 then 1 else if xp20[1] == 1 and c crosses p20 then 0 else xp20[1];

#Plots of Extended POC for each day until a crossing of it occurs... the 'period < 90' prohibits the plot of the POC for periods prior to the day each POC is generated ... the 'xp1a == 0' stops the plot of each POC from the point the crossing has occurred
plot poc1a = if period < 90 or xp1a == 0 then Double.NaN else p1a;
plot poc2a = if period < 89 or xp2a == 0 then Double.NaN else p2a;
plot poc3a = if period < 88 or xp3a == 0 then Double.NaN else p3a;
plot poc4a = if period < 87 or xp4a == 0 then Double.NaN else p4a;
plot poc5a = if period < 86 or xp5a == 0 then Double.NaN else p5a;
plot poc6a = if period < 85 or xp6a == 0 then Double.NaN else p6a;
plot poc7a = if period < 84 or xp7a == 0 then Double.NaN else p7a;
plot poc8a = if period < 83 or xp8a == 0 then Double.NaN else p8a;
plot poc9a = if period < 82 or xp9a == 0 then Double.NaN else p9a;
plot poc10a = if period < 81 or xp10a == 0 then Double.NaN else p10a;
plot poc11a = if period < 80 or xp11a == 0 then Double.NaN else p11a;
plot poc12a = if period < 79 or xp12a == 0 then Double.NaN else p12a;
plot poc13a = if period < 78 or xp13a == 0 then Double.NaN else p13a;
plot poc14a = if period < 77 or xp14a == 0 then Double.NaN else p14a;
plot poc15a = if period < 76 or xp15a == 0 then Double.NaN else p15a;
plot poc16a = if period < 75 or xp16a == 0 then Double.NaN else p16a;
plot poc17a = if period < 74 or xp17a == 0 then Double.NaN else p17a;
plot poc18a = if period < 73 or xp18a == 0 then Double.NaN else p18a;
plot poc19a = if period < 72 or xp19a == 0 then Double.NaN else p19a;
plot poc20a = if period < 71 or xp20a == 0 then Double.NaN else p20a;

plot poc1b = if period < 70 or xp1b == 0 then Double.NaN else p1b;
plot poc2b = if period < 69 or xp2b == 0 then Double.NaN else p2b;
plot poc3b = if period < 68 or xp3b == 0 then Double.NaN else p3b;
plot poc4b = if period < 67 or xp4b == 0 then Double.NaN else p4b;
plot poc5b = if period < 66 or xp5b == 0 then Double.NaN else p5b;
plot poc6b = if period < 65 or xp6b == 0 then Double.NaN else p6b;
plot poc7b = if period < 64 or xp7b == 0 then Double.NaN else p7b;
plot poc8b = if period < 63 or xp8b == 0 then Double.NaN else p8b;
plot poc9b = if period < 62 or xp9b == 0 then Double.NaN else p9b;
plot poc10b = if period < 61 or xp10b == 0 then Double.NaN else p10b;
plot poc11b = if period < 60 or xp11b == 0 then Double.NaN else p11b;
plot poc12b = if period < 59 or xp12b == 0 then Double.NaN else p12b;
plot poc13b = if period < 58 or xp13b == 0 then Double.NaN else p13b;
plot poc14b = if period < 57 or xp14b == 0 then Double.NaN else p14b;
plot poc15b = if period < 56 or xp15b == 0 then Double.NaN else p15b;
plot poc16b = if period < 55 or xp16b == 0 then Double.NaN else p16b;
plot poc17b = if period < 54 or xp17b == 0 then Double.NaN else p17b;
plot poc18b = if period < 53 or xp18b == 0 then Double.NaN else p18b;
plot poc19b = if period < 52 or xp19b == 0 then Double.NaN else p19b;
plot poc20b = if period < 51 or xp20b == 0 then Double.NaN else p20b;

plot poc1c = if period < 50 or xp1c == 0 then Double.NaN else p1c;
plot poc2c = if period < 49 or xp2c == 0 then Double.NaN else p2c;
plot poc3c = if period < 48 or xp3c == 0 then Double.NaN else p3c;
plot poc4c = if period < 47 or xp4c == 0 then Double.NaN else p4c;
plot poc5c = if period < 46 or xp5c == 0 then Double.NaN else p5c;
plot poc6c = if period < 45 or xp6c == 0 then Double.NaN else p6c;
plot poc7c = if period < 44 or xp7c == 0 then Double.NaN else p7c;
plot poc8c = if period < 43 or xp8c == 0 then Double.NaN else p8c;
plot poc9c = if period < 42 or xp9c == 0 then Double.NaN else p9c;
plot poc10c = if period < 41 or xp10c == 0 then Double.NaN else p10c;
plot poc11c = if period < 40 or xp11c == 0 then Double.NaN else p11c;
plot poc12c = if period < 39 or xp12c == 0 then Double.NaN else p12c;
plot poc13c = if period < 38 or xp13c == 0 then Double.NaN else p13c;
plot poc14c = if period < 37 or xp14c == 0 then Double.NaN else p14c;
plot poc15c = if period < 36 or xp15c == 0 then Double.NaN else p15c;
plot poc16c = if period < 35 or xp16c == 0 then Double.NaN else p16c;
plot poc17c = if period < 34 or xp17c == 0 then Double.NaN else p17c;
plot poc18c = if period < 33 or xp18c == 0 then Double.NaN else p18c;
plot poc19c = if period < 32 or xp19c == 0 then Double.NaN else p19c;
plot poc20c = if period < 31 or xp20c == 0 then Double.NaN else p20c;

plot poc1d = if period < 30 or xp1d == 0 then Double.NaN else p1d;
plot poc2d = if period < 29 or xp2d == 0 then Double.NaN else p2d;
plot poc3d = if period < 28 or xp3d == 0 then Double.NaN else p3d;
plot poc4d = if period < 27 or xp4d == 0 then Double.NaN else p4d;
plot poc5d = if period < 26 or xp5d == 0 then Double.NaN else p5d;
plot poc6d = if period < 25 or xp6d == 0 then Double.NaN else p6d;
plot poc7d = if period < 24 or xp7d == 0 then Double.NaN else p7d;
plot poc8d = if period < 23 or xp8d == 0 then Double.NaN else p8d;
plot poc9d = if period < 22 or xp9d == 0 then Double.NaN else p9d;
plot poc10d = if period < 21 or xp10d == 0 then Double.NaN else p10d;

plot poc1 = if period < 20 or xp1 == 0 then Double.NaN else p1;
plot poc2 = if period < 19 or xp2 == 0 then Double.NaN else p2;
plot poc3 = if period < 18 or xp3 == 0 then Double.NaN else p3;
plot poc4 = if period < 17 or xp4 == 0 then Double.NaN else p4;
plot poc5 = if period < 16 or xp5 == 0 then Double.NaN else p5;
plot poc6 = if period < 15 or xp6 == 0 then Double.NaN else p6;
plot poc7 = if period < 14 or xp7 == 0 then Double.NaN else p7;
plot poc8 = if period < 13 or xp8 == 0 then Double.NaN else p8;
plot poc9 = if period < 12 or xp9 == 0 then Double.NaN else p9;
plot poc10 = if period < 11 or xp10 == 0 then Double.NaN else p10;
plot poc11 = if period < 10 or xp11 == 0 then Double.NaN else p11;
plot poc12 = if period < 9 or xp12 == 0 then Double.NaN else p12;
plot poc13 = if period < 8 or xp13 == 0 then Double.NaN else p13;
plot poc14 = if period < 7 or xp14 == 0 then Double.NaN else p14;
plot poc15 = if period < 6 or xp15 == 0 then Double.NaN else p15;
plot poc16 = if period < 5 or xp16 == 0 then Double.NaN else p16;
plot poc17 = if period < 4 or xp17 == 0 then Double.NaN else p17;
plot poc18 = if period < 3 or xp18 == 0 then Double.NaN else p18;
plot poc19 = if period < 2 or xp19 == 0 then Double.NaN else p19;
plot poc20 = if period < 1 or xp20 == 0 then Double.NaN else p20;

input showbubbles = yes;
AddChartBubble(showbubbles and showbubbles and barnumber()== highestall(barnumber()) and !isnan(prevpoc[1])  , PrevPOC, PrevPOC, Color.WHITE);
AddChartBubble(showbubbles and showbubbles and isnan(close[-1]) and !IsNaN(poc1[1]), poc1, poc1 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc2[1]), poc2, poc2 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc3[1]), poc3, poc3 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc4[1]), poc4, poc4 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc5[1]), poc5, poc5 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc6[1]), poc6, poc6 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc7[1]), poc7, poc7 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc8[1]), poc8, poc8 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc9[1]), poc9, poc9 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc10[1]), poc10, poc10 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc11[1]), poc11, poc11 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc12), poc12, poc12 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc13[1]), poc13, poc13 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc14[1]), poc14, poc14 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc15[1]), poc15, poc15 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc16[1]), poc16, poc16 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc17[1]), poc17, poc17 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc18[1]), poc18, poc18 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc19[1]), poc19, poc19 , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc20[1]), poc20, poc20 , Color.WHITE);

AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc1a[1]), poc1a, poc1a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc2a[1]), poc2a, poc2a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc3a[1]), poc3a, poc3a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc4a[1]), poc4a, poc4a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc5a[1]), poc5a, poc5a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc6a[1]), poc6a, poc6a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc7a[1]), poc7a, poc7a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc8a[1]), poc8a, poc8a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc9a[1]), poc9a, poc9a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc10a[1]), poc10a, poc10a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc11a[1]), poc11a, poc11a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc12a), poc12a, poc12a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc13a[1]), poc13a, poc13a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc14a[1]), poc14a, poc14a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc15a[1]), poc15a, poc15a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc16a[1]), poc16a, poc16a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc17a[1]), poc17a, poc17a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc18a[1]), poc18a, poc18a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc19a[1]), poc19a, poc19a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc20a[1]), poc20a, poc20a , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc1b[1]), poc1b, poc1b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc2b[1]), poc2b, poc2b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc3b[1]), poc3b, poc3b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc4b[1]), poc4b, poc4b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc5b[1]), poc5b, poc5b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc6b[1]), poc6b, poc6b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc7b[1]), poc7b, poc7b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc8b[1]), poc8b, poc8b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc9b[1]), poc9b, poc9b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc10b[1]), poc10b, poc10b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc11b[1]), poc11b, poc11b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc12b), poc12b, poc12b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc13b[1]), poc13b, poc13b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc14b[1]), poc14b, poc14b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc15b[1]), poc15b, poc15b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc16b[1]), poc16b, poc16b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc17b[1]), poc17b, poc17b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc18b[1]), poc18b, poc18b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc19b[1]), poc19b, poc19b , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc20b[1]), poc20b, poc20b , Color.WHITE);

AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc1c[1]), poc1c, poc1c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc2c[1]), poc2c, poc2c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc3c[1]), poc3c, poc3c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc4c[1]), poc4c, poc4c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc5c[1]), poc5c, poc5c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc6c[1]), poc6c, poc6c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc7c[1]), poc7c, poc7c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc8c[1]), poc8c, poc8c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc9c[1]), poc9c, poc9c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc10c[1]), poc10c, poc10c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc11c[1]), poc11c, poc11c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc12c), poc12c, poc12c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc13c[1]), poc13c, poc13c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc14c[1]), poc14c, poc14c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc15c[1]), poc15c, poc15c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc16c[1]), poc16c, poc16c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc17c[1]), poc17c, poc17c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc18c[1]), poc18c, poc18c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc19c[1]), poc19c, poc19c , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(poc20c[1]), poc20c, poc20c , Color.WHITE);

AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(POC1d[1]), poc1d, POC1d , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(POC2d[1]), poc2d, POC2d , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(POC3d[1]), poc3d, POC3d , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(POC4d[1]), poc4d, POC4d , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(POC5d[1]), poc5d, POC5d , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(POC6d[1]), poc6d, POC6d , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(POC7d[1]), poc7d, POC7d , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(POC8d[1]), poc8d, POC8d , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(POC9d[1]), poc9d, POC9d , Color.WHITE);
AddChartBubble(showbubbles and isnan(close[-1]) and !IsNaN(POC10d[1]), poc10d, POC10d , Color.WHITE);


#Color and Line Weight
DefineGlobalColor("POC", Color.BLACK);

poc1.SetDefaultColor(GlobalColor("POC"));
poc2.SetDefaultColor(GlobalColor("POC"));
poc3.SetDefaultColor(GlobalColor("POC"));
poc4.SetDefaultColor(GlobalColor("POC"));
poc5.SetDefaultColor(GlobalColor("POC"));
poc6.SetDefaultColor(GlobalColor("POC"));
poc7.SetDefaultColor(GlobalColor("POC"));
poc8.SetDefaultColor(GlobalColor("POC"));
poc9.SetDefaultColor(GlobalColor("POC"));
poc10.SetDefaultColor(GlobalColor("POC"));
poc11.SetDefaultColor(GlobalColor("POC"));
poc12.SetDefaultColor(GlobalColor("POC"));
poc13.SetDefaultColor(GlobalColor("POC"));
poc14.SetDefaultColor(GlobalColor("POC"));
poc15.SetDefaultColor(GlobalColor("POC"));
poc16.SetDefaultColor(GlobalColor("POC"));
poc17.SetDefaultColor(GlobalColor("POC"));
poc18.SetDefaultColor(GlobalColor("POC"));
poc19.SetDefaultColor(GlobalColor("POC"));
poc20.SetDefaultColor(GlobalColor("POC"));

poc1a.SetDefaultColor(GlobalColor("POC"));
poc2a.SetDefaultColor(GlobalColor("POC"));
poc3a.SetDefaultColor(GlobalColor("POC"));
poc4a.SetDefaultColor(GlobalColor("POC"));
poc5a.SetDefaultColor(GlobalColor("POC"));
poc6a.SetDefaultColor(GlobalColor("POC"));
poc7a.SetDefaultColor(GlobalColor("POC"));
poc8a.SetDefaultColor(GlobalColor("POC"));
poc9a.SetDefaultColor(GlobalColor("POC"));
poc10a.SetDefaultColor(GlobalColor("POC"));
poc11a.SetDefaultColor(GlobalColor("POC"));
poc12a.SetDefaultColor(GlobalColor("POC"));
poc13a.SetDefaultColor(GlobalColor("POC"));
poc14a.SetDefaultColor(GlobalColor("POC"));
poc15a.SetDefaultColor(GlobalColor("POC"));
poc16a.SetDefaultColor(GlobalColor("POC"));
poc17a.SetDefaultColor(GlobalColor("POC"));
poc18a.SetDefaultColor(GlobalColor("POC"));
poc19a.SetDefaultColor(GlobalColor("POC"));
poc20a.SetDefaultColor(GlobalColor("POC"));

poc1b.SetDefaultColor(GlobalColor("POC"));
poc2b.SetDefaultColor(GlobalColor("POC"));
poc3b.SetDefaultColor(GlobalColor("POC"));
poc4b.SetDefaultColor(GlobalColor("POC"));
poc5b.SetDefaultColor(GlobalColor("POC"));
poc6b.SetDefaultColor(GlobalColor("POC"));
poc7b.SetDefaultColor(GlobalColor("POC"));
poc8b.SetDefaultColor(GlobalColor("POC"));
poc9b.SetDefaultColor(GlobalColor("POC"));
poc10b.SetDefaultColor(GlobalColor("POC"));
poc11b.SetDefaultColor(GlobalColor("POC"));
poc12b.SetDefaultColor(GlobalColor("POC"));
poc13b.SetDefaultColor(GlobalColor("POC"));
poc14b.SetDefaultColor(GlobalColor("POC"));
poc15b.SetDefaultColor(GlobalColor("POC"));
poc16b.SetDefaultColor(GlobalColor("POC"));
poc17b.SetDefaultColor(GlobalColor("POC"));
poc18b.SetDefaultColor(GlobalColor("POC"));
poc19b.SetDefaultColor(GlobalColor("POC"));
poc20b.SetDefaultColor(GlobalColor("POC"));

poc1c.SetDefaultColor(GlobalColor("POC"));
poc2c.SetDefaultColor(GlobalColor("POC"));
poc3c.SetDefaultColor(GlobalColor("POC"));
poc4c.SetDefaultColor(GlobalColor("POC"));
poc5c.SetDefaultColor(GlobalColor("POC"));
poc6c.SetDefaultColor(GlobalColor("POC"));
poc7c.SetDefaultColor(GlobalColor("POC"));
poc8c.SetDefaultColor(GlobalColor("POC"));
poc9c.SetDefaultColor(GlobalColor("POC"));
poc10c.SetDefaultColor(GlobalColor("POC"));
poc11c.SetDefaultColor(GlobalColor("POC"));
poc12c.SetDefaultColor(GlobalColor("POC"));
poc13c.SetDefaultColor(GlobalColor("POC"));
poc14c.SetDefaultColor(GlobalColor("POC"));
poc15c.SetDefaultColor(GlobalColor("POC"));
poc16c.SetDefaultColor(GlobalColor("POC"));
poc17c.SetDefaultColor(GlobalColor("POC"));
poc18c.SetDefaultColor(GlobalColor("POC"));
poc19c.SetDefaultColor(GlobalColor("POC"));
poc20c.SetDefaultColor(GlobalColor("POC"));

poc1d.SetDefaultColor(GlobalColor("POC"));
poc2d.SetDefaultColor(GlobalColor("POC"));
poc3d.SetDefaultColor(GlobalColor("POC"));
poc4d.SetDefaultColor(GlobalColor("POC"));
poc5d.SetDefaultColor(GlobalColor("POC"));
poc6d.SetDefaultColor(GlobalColor("POC"));
poc7d.SetDefaultColor(GlobalColor("POC"));
poc8d.SetDefaultColor(GlobalColor("POC"));
poc9d.SetDefaultColor(GlobalColor("POC"));
poc10d.SetDefaultColor(GlobalColor("POC"));

input lineweight = 2;
poc1.SetLineWeight(lineweight);
poc2.SetLineWeight(lineweight);
poc3.SetLineWeight(lineweight);
poc4.SetLineWeight(lineweight);
poc5.SetLineWeight(lineweight);
poc6.SetLineWeight(lineweight);
poc7.SetLineWeight(lineweight);
poc8.SetLineWeight(lineweight);
poc9.SetLineWeight(lineweight);
poc10.SetLineWeight(lineweight);
poc11.SetLineWeight(lineweight);
poc12.SetLineWeight(lineweight);
poc13.SetLineWeight(lineweight);
poc14.SetLineWeight(lineweight);
poc15.SetLineWeight(lineweight);
poc16.SetLineWeight(lineweight);
poc17.SetLineWeight(lineweight);
poc18.SetLineWeight(lineweight);
poc19.SetLineWeight(lineweight);
poc20.SetLineWeight(lineweight);

poc1a.SetLineWeight(lineweight);
poc2a.SetLineWeight(lineweight);
poc3a.SetLineWeight(lineweight);
poc4a.SetLineWeight(lineweight);
poc5a.SetLineWeight(lineweight);
poc6a.SetLineWeight(lineweight);
poc7a.SetLineWeight(lineweight);
poc8a.SetLineWeight(lineweight);
poc9a.SetLineWeight(lineweight);
poc10a.SetLineWeight(lineweight);
poc11a.SetLineWeight(lineweight);
poc12a.SetLineWeight(lineweight);
poc13a.SetLineWeight(lineweight);
poc14a.SetLineWeight(lineweight);
poc15a.SetLineWeight(lineweight);
poc16a.SetLineWeight(lineweight);
poc17a.SetLineWeight(lineweight);
poc18a.SetLineWeight(lineweight);
poc19a.SetLineWeight(lineweight);
poc20a.SetLineWeight(lineweight);

poc1b.SetLineWeight(lineweight);
poc2b.SetLineWeight(lineweight);
poc3b.SetLineWeight(lineweight);
poc4b.SetLineWeight(lineweight);
poc5b.SetLineWeight(lineweight);
poc6b.SetLineWeight(lineweight);
poc7b.SetLineWeight(lineweight);
poc8b.SetLineWeight(lineweight);
poc9b.SetLineWeight(lineweight);
poc10b.SetLineWeight(lineweight);
poc11b.SetLineWeight(lineweight);
poc12b.SetLineWeight(lineweight);
poc13b.SetLineWeight(lineweight);
poc14b.SetLineWeight(lineweight);
poc15b.SetLineWeight(lineweight);
poc16b.SetLineWeight(lineweight);
poc17b.SetLineWeight(lineweight);
poc18b.SetLineWeight(lineweight);
poc19b.SetLineWeight(lineweight);
poc20b.SetLineWeight(lineweight);

poc1c.SetLineWeight(lineweight);
poc2c.SetLineWeight(lineweight);
poc3c.SetLineWeight(lineweight);
poc4c.SetLineWeight(lineweight);
poc5c.SetLineWeight(lineweight);
poc6c.SetLineWeight(lineweight);
poc7c.SetLineWeight(lineweight);
poc8c.SetLineWeight(lineweight);
poc9c.SetLineWeight(lineweight);
poc10c.SetLineWeight(lineweight);
poc11c.SetLineWeight(lineweight);
poc12c.SetLineWeight(lineweight);
poc13c.SetLineWeight(lineweight);
poc14c.SetLineWeight(lineweight);
poc15c.SetLineWeight(lineweight);
poc16c.SetLineWeight(lineweight);
poc17c.SetLineWeight(lineweight);
poc18c.SetLineWeight(lineweight);
poc19c.SetLineWeight(lineweight);
poc20c.SetLineWeight(lineweight);

poc1d.SetLineWeight(lineweight);
poc2d.SetLineWeight(lineweight);
poc3d.SetLineWeight(lineweight);
poc4d.SetLineWeight(lineweight);
poc5d.SetLineWeight(lineweight);
poc6d.SetLineWeight(lineweight);
poc7d.SetLineWeight(lineweight);
poc8d.SetLineWeight(lineweight);
poc9d.SetLineWeight(lineweight);
poc10d.SetLineWeight(lineweight);

poc1.HideBubble();
poc2.HideBubble();
poc3.HideBubble();
poc4.HideBubble();
poc5.HideBubble();
poc6.HideBubble();
poc7.HideBubble();
poc8.HideBubble();
poc9.HideBubble();
poc10.HideBubble();
poc11.HideBubble();
poc12.HideBubble();
poc13.HideBubble();
poc14.HideBubble();
poc15.HideBubble();
poc16.HideBubble();
poc17.HideBubble();
poc18.HideBubble();
poc19.HideBubble();
poc20.HideBubble();

poc1a.HideBubble();
poc2a.HideBubble();
poc3a.HideBubble();
poc4a.HideBubble();
poc5a.HideBubble();
poc6a.HideBubble();
poc7a.HideBubble();
poc8a.HideBubble();
poc9a.HideBubble();
poc10a.HideBubble();
poc11a.HideBubble();
poc12a.HideBubble();
poc13a.HideBubble();
poc14a.HideBubble();
poc15a.HideBubble();
poc16a.HideBubble();
poc17a.HideBubble();
poc18a.HideBubble();
poc19a.HideBubble();
poc20a.HideBubble();

poc1b.HideBubble();
poc2b.HideBubble();
poc3b.HideBubble();
poc4b.HideBubble();
poc5b.HideBubble();
poc6b.HideBubble();
poc7b.HideBubble();
poc8b.HideBubble();
poc9b.HideBubble();
poc10b.HideBubble();
poc11b.HideBubble();
poc12b.HideBubble();
poc13b.HideBubble();
poc14b.HideBubble();
poc15b.HideBubble();
poc16b.HideBubble();
poc17b.HideBubble();
poc18b.HideBubble();
poc19b.HideBubble();
poc20b.HideBubble();

poc1c.HideBubble();
poc2c.HideBubble();
poc3c.HideBubble();
poc4c.HideBubble();
poc5c.HideBubble();
poc6c.HideBubble();
poc7c.HideBubble();
poc8c.HideBubble();
poc9c.HideBubble();
poc10c.HideBubble();
poc11c.HideBubble();
poc12c.HideBubble();
poc13c.HideBubble();
poc14c.HideBubble();
poc15c.HideBubble();
poc16c.HideBubble();
poc17c.HideBubble();
poc18c.HideBubble();
poc19c.HideBubble();
poc20c.HideBubble();

poc1d.HideBubble();
poc2d.HideBubble();
poc3d.HideBubble();
poc4d.HideBubble();
poc5d.HideBubble();
poc6d.HideBubble();
poc7d.HideBubble();
poc8d.HideBubble();
poc9d.HideBubble();
poc10d.HideBubble();
[/QUOTE]
Could you help with adding half a day or 720 min to the profile?
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
327 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top