# Previous VPOC

#### woulf1004

##### Active member
Could someone create an indicator for TOS that plots the previous day POC/High/Low/Close/DayMid (Middle of the Day) on a tick chart with the option of selecting and plotting it as an expansion on the chart if needed? Thanks in advance.

Solution
Could someone create an indicator for TOS that plots the previous day POC/High/Low/Close/DayMid (Middle of the Day) on a tick chart with the option of selecting and plotting it as an expansion on the chart if needed? Thanks in advance.

You can select the prior day to use, whether to show on expansion only, and optional bubbles you can move sideways.

Ruby:
``````input daysback = 1;
input showonexpansion = no;

def ymd      = GetYYYYMMDD();
def candles  = !IsNaN(close);
def capture  = candles and ymd != ymd[1];
def dayCount = CompoundValue(1, if capture then dayCount[1] + 1 else dayCount[1], 0);
def thisDay  = (HighestAll(dayCount) - dayCount) ;

def poc      = if thisDay == daysback then reference VolumeProfile("price per...``````
Could someone create an indicator for TOS that plots the previous day POC/High/Low/Close/DayMid (Middle of the Day) on a tick chart with the option of selecting and plotting it as an expansion on the chart if needed? Thanks in advance.

You can select the prior day to use, whether to show on expansion only, and optional bubbles you can move sideways.

Ruby:
``````input daysback = 1;
input showonexpansion = no;

def ymd      = GetYYYYMMDD();
def candles  = !IsNaN(close);
def capture  = candles and ymd != ymd[1];
def dayCount = CompoundValue(1, if capture then dayCount[1] + 1 else dayCount[1], 0);
def thisDay  = (HighestAll(dayCount) - dayCount) ;

def poc      = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no) else poc[1];
def phigh   = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).ProfileHigh else phigh[1];
def plow    = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).ProfileLow else plow[1];
def popen   = if thisday == daysback then open(period=aggregationPeriod.DAY) else popen[1];

plot poc1  = if showonexpansion and !isnan(close) or thisDay > daysback then Double.NaN else poc;
plot high1 = if showonexpansion and !isnan(close) or  thisDay > daysback then Double.NaN else phigh;
plot low1  = if showonexpansion and !isnan(close) or  thisDay > daysback then Double.NaN else plow;
plot open1 = if showonexpansion and !isnan(close) or  thisday > daysback then double.nan else popen;
plot mid1  = if showonexpansion and !isnan(close) or  thisDay > daysback then Double.NaN else (phigh + plow) / 2;

poc1.setdefaultColor(color.cyan);
high1.setdefaultColor(color.yellow);
low1.setdefaultColor(color.yellow);
open1.setdefaultColor(color.magenta);
mid1.setdefaultColor(color.yellow);

input bubblemover = 5;
def b  = bubblemover;
def b1 = b + 1;
input showbubbles = yes;
addchartBubble(showbubbles and isnan(close[b]) and !isnan(close[b1]), poc1[b], "POC-" + daysback, poc1.takevalueColor());
addchartBubble(showbubbles and isnan(close[b]) and !isnan(close[b1]), high1[b], "H-" + daysback, high1.takevalueColor());
addchartBubble(showbubbles and isnan(close[b]) and !isnan(close[b1]), low1[b], "L-" + daysback, low1.takevalueColor());
addchartBubble(showbubbles and isnan(close[b]) and !isnan(close[b1]), open1[b], "O-" + daysback, open1.takevalueColor());
addchartBubble(showbubbles and isnan(close[b]) and !isnan(close[b1]), mid1[b], "M-" + daysback, mid1.takevalueColor());``````

Thanks for the quick response. This is awesome! I meant to have the previous day close but I don't mind having the previous day open. One other thing. Can you backtest this indicator and see if the previous day poc plotting and calculation is correct? Because for some reason it's not plotting the correct information on my chart. Maybe I am doing something wrong but as you see on the shared link image, my previous day poc shows price at around 4119.50 but the indicator you have provided shows price at 4149.63. Can this be corrected?

Oh! and this is a trading session for today Thursday June 9th.

Thanks again.

Thanks for the quick response. This is awesome! I meant to have the previous day close but I don't mind having the previous day open. One other thing. Can you backtest this indicator and see if the previous day poc plotting and calculation is correct? Because for some reason it's not plotting the correct information on my chart. Maybe I am doing something wrong but as you see on the shared link image, my previous day poc shows price at around 4119.50 but the indicator you have provided shows price at 4149.63. Can this be corrected?

Oh! and this is a trading session for today Thursday June 9th.

Thanks again.

Here is the volumeprofile indicator added to the chart. It shows the poc for 1 day ago at the level the code produced. It shows that the 4119.50 level was from 2 days ago.

My apologies. You are absolutely right. I was looking at the 30mns chart which is plotting a different value. Will it be possible to add time sessions so the indicator can plot the previous poc based on the 30mns as well?

My apologies. You are absolutely right. I was looking at the 30mns chart which is plotting a different value. Will it be possible to add time sessions so the indicator can plot the previous poc based on the 30mns as well?

What type of chart/indicator are you using to show the poc at the level that the volume profile indicator is two days ago and yours shows one day ago? The chart in the above image I posted above was a 30min chart, so I would think they would match.

A quick fix you can test is just to set a new input for the poc to 1 day more than the rest of the data. Test that and if it does not work, give me an example.

The code was updated to change open to close.

Ruby:
``````input daysback = 1;
input daysback_poc = 2;
input showonexpansion = no;

def ymd      = GetYYYYMMDD();
def candles  = !IsNaN(close);
def capture  = candles and ymd != ymd[1];
def dayCount = CompoundValue(1, if capture then dayCount[1] + 1 else dayCount[1], 0);
def thisDay  = (HighestAll(dayCount) - dayCount) ;

def poc      = if thisDay == daysback_poc then reference VolumeProfile("time per profile" = "DAY", "on expansion" = no, "price per row height mode" = "TICKSIZE") else poc[1];
def phigh   = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).ProfileHigh else phigh[1];
def plow    = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).ProfileLow else plow[1];
def pclose  = if thisDay == daysback then close(period = AggregationPeriod.DAY) else pclose[1];

plot poc1  = if showonexpansion and !IsNaN(close) or thisDay > daysback_poc then Double.NaN else poc;
plot high1 = if showonexpansion and !IsNaN(close) or  thisDay > daysback then Double.NaN else phigh;
plot low1  = if showonexpansion and !IsNaN(close) or  thisDay > daysback then Double.NaN else plow;
plot close1 = if showonexpansion and !IsNaN(close) or  thisDay > daysback then Double.NaN else pclose;
plot mid1  = if showonexpansion and !IsNaN(close) or  thisDay > daysback then Double.NaN else (phigh + plow) / 2;

poc1.SetDefaultColor(Color.CYAN);
high1.SetDefaultColor(Color.YELLOW);
low1.SetDefaultColor(Color.YELLOW);
close1.SetDefaultColor(Color.MAGENTA);
mid1.SetDefaultColor(Color.YELLOW);

input bubblemover = 5;
def b  = bubblemover;
def b1 = b + 1;
input showbubbles = yes;
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), poc1[b], "POC-" + daysback, poc1.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), high1[b], "H-" + daysback, high1.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), low1[b], "L-" + daysback, low1.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), close1[b], "C-" + daysback, close1.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), mid1[b], "M-" + daysback, mid1.TakeValueColor());``````

Thank you for clarifying this by explaining you're using the 30mns chart. I am clear on that, and I need these exact results to be plotted and work to a 2000 tick chart that I use for trading. Do you think this a possible scenario?

Thank you for clarifying this by explaining you're using the 30mns chart. I am clear on that, and I need these exact results to be plotted and work to a 2000 tick chart that I use for trading. Do you think this a possible scenario?

Should work. Here is /MES 2000 tick with the code. I added the TOS volumeprofile indicator so you can see the POC is coming from 2 days ago, The rest are from 1 day ago. If you need the POC to be from 1 day ago, then change the input for that from 2 to 1.

I believe I did not explain my self correctly but this time I have attached and image for your reference. I am using a 30mns chart on the left and a 2000 tick chart on the right. What I would like to have is.. the poc value result shown on the 30mns chart to be plotted on the 2000 tick chart. In other words, I need the previous day poc shown on the 30mns chart as "4119.53" to be plotted on the 2000 tick chart which is currently showing "4149.63".

I believe I did not explain my self correctly but this time I have attached and image for your reference. I am using a 30mns chart on the left and a 2000 tick chart on the right. What I would like to have is.. the poc value result shown on the 30mns chart to be plotted on the 2000 tick chart. In other words, I need the previous day poc shown on the 30mns chart as "4119.53" to be plotted on the 2000 tick chart which is currently showing "4149.63".

It is showing 4149.63 as it is set to 2 days back instead of 1 to allow you to test where the poc value was coming from yesterdday. Reset the input daysback_poc to 1. There is not a setting in the volumeprofile indicator to set a profile based upon another chart timeframe.

Make sure that your tick chart has enough chart days to lookback, as I saw it seems to want to default to a 'today' chart until you set it for longer days. The volumeprofile will only read data that is displayed on the chart.

So no chart timeframe combination is available. Understood. Thank you so much for your support! I am more than happy with this indicator. You are a genius! Thank you.

One last favor. Could you add the daily open (not the previous day open) with the expansion feature to this script? Thanks in advance!

One last favor. Could you add the daily open (not the previous day open) with the expansion feature to this script? Thanks in advance!
Ruby:
``````input daysback = 1;
input daysback_poc = 1;
input showonexpansion = no;

def ymd      = GetYYYYMMDD();
def candles  = !IsNaN(close);
def capture  = candles and ymd != ymd[1];
def dayCount = CompoundValue(1, if capture then dayCount[1] + 1 else dayCount[1], 0);
def thisDay  = (HighestAll(dayCount) - dayCount) ;

def poc      = if thisDay == daysback_poc then reference VolumeProfile("time per profile" = "DAY", "on expansion" = no, "price per row height mode" = "TICKSIZE") else poc[1];
def phigh   = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).ProfileHigh else phigh[1];
def plow    = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).ProfileLow else plow[1];
def pclose  = if thisDay == daysback then close(period = AggregationPeriod.DAY) else pclose[1];
def dopen  = if thisDay == 0 then open(period = AggregationPeriod.DAY) else dopen[1];

plot poc1  = if showonexpansion and !IsNaN(close) or thisDay > daysback_poc then Double.NaN else poc;
plot high1 = if showonexpansion and !IsNaN(close) or  thisDay > daysback then Double.NaN else phigh;
plot low1  = if showonexpansion and !IsNaN(close) or  thisDay > daysback then Double.NaN else plow;
plot close1 = if showonexpansion and !IsNaN(close) or  thisDay > daysback then Double.NaN else pclose;
plot mid1  = if showonexpansion and !IsNaN(close) or  thisDay > daysback then Double.NaN else (phigh + plow) / 2;
plot open0 = if showonexpansion and !IsNaN(close) or  thisDay > 0 then Double.NaN else dopen;

poc1.SetDefaultColor(Color.CYAN);
high1.SetDefaultColor(Color.YELLOW);
low1.SetDefaultColor(Color.YELLOW);
close1.SetDefaultColor(Color.MAGENTA);
mid1.SetDefaultColor(Color.YELLOW);
open0.SetDefaultColor(Color.WHITE);

input bubblemover = 5;
def b  = bubblemover;
def b1 = b + 1;
input showbubbles = yes;
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), poc1[b], "POC-" + daysback_poc, poc1.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), high1[b], "H-" + daysback, high1.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), low1[b], "L-" + daysback, low1.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), close1[b], "C-" + daysback, close1.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), mid1[b], "M-" + daysback, mid1.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), open0[b], "O-" + 0, open0.TakeValueColor());
#
#``````

Hi Team,

Is there anyway possible the price line for this indicator could plot a boolean point@closed only for the current last bar? In other words, no other boolean price@close is plotted as past history on the chart.

input DaysBack = 1;
input DaysBack2 = 2;
input DaysBack3= 3;
input DaysBack_Y1_POC = 1;
input DaysBack_Y2_POC = 2;
input DaysBack_Y3_POC = 3;
input ShowonExpansion = yes;

def ymd = GetYYYYMMDD();
def candles = !IsNaN(close);
def capture = candles and ymd != ymd[1];
def dayCount = CompoundValue(1, if capture then dayCount[1] + 1 else dayCount[1], 0);
def thisDay = (HighestAll(dayCount) - dayCount) ;
def thisDay2 = (HighestAll(dayCount) - dayCount) ;
def thisDay3 = (HighestAll(dayCount) - dayCount) ;

#def MBPOC = if thisDay == DaysBack_Y1_POC then reference MonkeyBars("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no) else MBPOC[1];
def POC = if thisDay == DaysBack_Y1_POC then reference VolumeProfile("time per profile" = "DAY", "on expansion" = no, "price per row height mode" = "TICKSIZE") else POC[1];
def POC2 = if thisDay2 == DaysBack_Y2_POC then reference VolumeProfile("time per profile" = "DAY", "on expansion" = no, "price per row height mode" = "TICKSIZE") else POC2[2];
def POC3 = if thisDay3 == DaysBack_Y3_POC then reference VolumeProfile("time per profile" = "DAY", "on expansion" = no, "price per row height mode" = "TICKSIZE") else POC3[3];
def phigh = if thisDay == DaysBack then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).ProfileHigh else phigh[1];
def plow = if thisDay == DaysBack then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).ProfileLow else plow[1];
def dopen = if thisDay == 0 then open(period = AggregationPeriod.DAY) else dopen[1];
def popen = if thisday == DaysBack then open(period=aggregationPeriod.DAY) else popen[1];
def pclose = if thisDay == DaysBack then close(period = AggregationPeriod.DAY) else pclose[1];

#plot Y1_MBPOC = if ShowonExpansion and !IsNaN(close) or thisDay > DaysBack_Y1_POC then Double.NaN else MBPOC;
plot Y1_POC = if ShowonExpansion and !IsNaN(close) or thisDay > DaysBack_Y1_POC then Double.NaN else poc;
plot Y2_POC = if ShowonExpansion and !IsNaN(close) or thisDay2 > DaysBack_Y2_POC then Double.NaN else poc2;
plot Y3_POC = if ShowonExpansion and !IsNaN(close) or thisDay3 > DaysBack_Y3_POC then Double.NaN else poc3;
plot Y_High = if ShowonExpansion and !IsNaN(close) or thisDay > DaysBack then Double.NaN else phigh;
plot Y_Low = if ShowonExpansion and !IsNaN(close) or thisDay > DaysBack then Double.NaN else plow;
plot D_Open = if ShowonExpansion and !IsNaN(close) or thisDay > 0 then Double.NaN else dopen;
plot Y_Open = if ShowonExpansion and !isnan(close) or thisday > DaysBack then double.nan else popen;
plot Y_Close = if ShowonExpansion and !IsNaN(close) or thisDay > DaysBack then Double.NaN else pclose;
plot Y_Mid = if ShowonExpansion and !IsNaN(close) or thisDay > DaysBack then Double.NaN else (phigh + plow) / 2;

Y1_POC.SetDefaultColor(Color.CYAN);
Y2_POC.SetDefaultColor(Color.CYAN);
Y3_POC.SetDefaultColor(Color.CYAN);
Y_High.SetDefaultColor(Color.YELLOW);
Y_Low.SetDefaultColor(Color.BLUE);
D_Open.SetDefaultColor(Color.RED);
Y_Open.setdefaultColor(color.RED);
Y_Close.SetDefaultColor(Color.YELLOW);
Y_Mid.SetDefaultColor(Color.BLUE);

###BubbleLabels

input bubblemover = 23;
input bubblemover2 = 1;
input showbubbles = yes;
input showbubbles2 = yes;

def b = bubblemover;
def b1 = b + 1;

def ba = bubblemover2;
def bb = ba + 1;

#AddChartBubble(showbubbles and IsNaN(close) and !IsNaN(close[b1]), Y1_MBPOC, "MB-" + daysback, Y1_MBPOC.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close) and !IsNaN(close[b1]), Y1_POC, "POC-" + daysback, Y1_POC.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close) and !IsNaN(close[b1]), Y2_POC, "POC-" + daysback2, Y2_POC.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close) and !IsNaN(close[b1]), Y3_POC, "POC-" + daysback3, Y3_POC.TakeValueColor());
AddChartBubble(showbubbles2 and IsNaN(close) and !IsNaN(close[b1]), Y_Close, "C-" + daysback, Y_Close.TakeValueColor());
AddChartBubble(showbubbles2 and IsNaN(close) and !IsNaN(close[b1]), Y_High, "H-" + daysback, Y_High.TakeValueColor());
AddChartBubble(showbubbles2 and IsNaN(close) and !IsNaN(close[b1]), Y_Low, "L-" + daysback,Y_Low.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(close[ba]) and !IsNaN(close[bb]), D_Open[ba], "D-" + 0, D_Open.TakeValueColor());
AddchartBubble(showbubbles2 and isnan(close[ba]) and !isnan(close[bb]), Y_Open[ba], "O-" + daysback, Y_Open.takevalueColor());
AddChartBubble(showbubbles2 and IsNaN(close[ba]) and !IsNaN(close[bb]), Y_Mid[ba], "M-" + daysback, Y_Mid.TakeValueColor());

###PriceLine

def vClose = close;
def nan = double.NaN;

def highestClose = HighestAll(if IsNaN(vClose[-1]) then vClose else nan);
plot PriceLine = highestClose;
PriceLine.SetPaintingStrategy(PaintingStrategy.DASHES);
PriceLine.SetDefaultColor(Color.Orange);
PriceLine.HideBubble();
PriceLine.HideTitle();

Last edited:
Hi,

Can someone help and adjust the price line script so the indicator can plot the close@price only for the last candle? Thank you.

Hi,

Can someone help and adjust the price line script so the indicator can plot the close@price only for the last candle? Thank you.

I think this is what you want

Ruby:
``````plot Data = if IsNaN(close[-1]) then close else Double.NaN;
Data.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);``````

Hi SleepeZ!

I actually need this indicator to plot the value as boolean and draw as close@price that reflects only on the last candle (white dots in image) and none on the previous candles so I can keep a clean chart. Will this be possible?

Hi SleepeZ!

I actually need this indicator to plot the value as boolean and draw as close@price that reflects only on the last candle (white dots in image) and none on the previous candles so I can keep a clean chart. Will this be possible?

Here is the last bar with 2 versions of close. The white dot (standard points) seems to follow the 'priceline' close whether with regular candles or heikin ashi candles. The magenta dot (boolean points @ close) only seems to follow the close when regular candles are being used.

Ruby:
``````plot Data = if IsNaN(close[-1]) then close else Double.NaN;
data.setPaintingStrategy(paintingStrategy.POINTS);
data.setdefaultColor(color.white);
data.setlineWeight(5);

plot Data1 = if IsNaN(close[-1]) then close else Double.NaN;
data1.setpaintingStrategy(paintingStrategy.BOOLEAN_POINTS);
data1.setdefaultColor(color.magenta);
data1.setlineWeight(5);``````

The first option works perfect! Thanks for the amazing support once again.

Hi Team,

Is it possible to plot a cloud in light_grey or color of preference between the close from previous day and the current day pivot indicators?
I'll appreciate the support.

input DaysBack = 1;
input DaysBack2 = 2;
input DaysBack3 = 3;
input DaysBack_Y1_POC = 1;
input DaysBack_Y2_POC = 2;
input DaysBack_Y3_POC = 3;
input ShowonExpansion = yes;
input AddCloud = yes;

def ymd = GetYYYYMMDD();
def candles = !IsNaN(close);
def capture = candles and ymd != ymd[1];
def dayCount = CompoundValue(1, if capture then dayCount[1] + 1 else dayCount[1], 0);
def thisDay = (HighestAll(dayCount) - dayCount) ;
def thisDay2 = (HighestAll(dayCount) - dayCount) ;
def thisDay3 = (HighestAll(dayCount) - dayCount) ;

def POC = if thisDay == DaysBack_Y1_POC then reference VolumeProfile("time per profile" = "DAY", "on expansion" = no, "price per row height mode" = "TICKSIZE") else POC[1];
def POC2 = if thisDay2 == DaysBack_Y2_POC then reference VolumeProfile("time per profile" = "DAY", "on expansion" = no, "price per row height mode" = "TICKSIZE") else POC2[2];
def POC3 = if thisDay3 == DaysBack_Y3_POC then reference VolumeProfile("time per profile" = "DAY", "on expansion" = no, "price per row height mode" = "TICKSIZE") else POC3[3];
def phigh = if thisDay == DaysBack then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).ProfileHigh else phigh[1];
def plow = if thisDay == DaysBack then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).ProfileLow else plow[1];
def dopen = if thisDay == 0 then open(period = AggregationPeriod.DAY) else dopen[1];
def popen = if thisDay == DaysBack then open(period = AggregationPeriod.DAY) else popen[1];
def pclose = if thisDay == DaysBack then close(period = AggregationPeriod.DAY) else pclose[1];

plot Y_High = if ShowonExpansion and !IsNaN(close) or thisDay > DaysBack then Double.NaN else phigh;
plot Y_Low = if ShowonExpansion and !IsNaN(close) or thisDay > DaysBack then Double.NaN else plow;
plot D_Open = if ShowonExpansion and !IsNaN(close) or thisDay > 0 then Double.NaN else dopen;
#plot Y_Open = if ShowonExpansion and !isnan(close) or thisday > DaysBack then double.nan else popen;
plot Y_Close = if ShowonExpansion and !IsNaN(close) or thisDay > DaysBack then Double.NaN else pclose;
plot Y_Mid = if ShowonExpansion and !IsNaN(close) or thisDay > DaysBack then Double.NaN else (phigh + plow) / 2;

Y_High.SetDefaultColor(Color.YELLOW);
Y_Low.SetDefaultColor(Color.BLUE);
D_Open.SetDefaultColor(Color.RED);
Y_Mid.SetDefaultColor(Color.BLUE);

###BubbleLabels

input bubblemover = 23;
input bubblemover2 = 1;
input showbubbles = yes;
input showbubbles2 = yes;

def b = bubblemover;
def b1 = b + 1;

def ba = bubblemover2;
def bb = ba + 1;

AddChartBubble(showbubbles2 and IsNaN(close) and !IsNaN(close[b1]), Y_Close, "PD (C" + ")", Y_Close.TakeValueColor());
AddChartBubble(showbubbles2 and IsNaN(close) and !IsNaN(close[b1]), Y_High, "PD (H" + ")", Color.CYAN);
AddChartBubble(showbubbles2 and IsNaN(close[ba]) and !IsNaN(close[b1]), Y_Mid, "PD (M" + ")", Color.CYAN);
AddChartBubble(showbubbles2 and IsNaN(close) and !IsNaN(close[b1]), Y_Low, "PD (L" + ")", Color.CYAN);
AddChartBubble(showbubbles and IsNaN(close[ba]) and !IsNaN(close[bb]), D_Open[ba], "CD (O" + ")", D_Open.TakeValueColor());

###PriceLine

def vClose = close;
def nan = Double.NaN;

def highestClose = HighestAll(if IsNaN(vClose[-1]) then vClose else nan);

plot PriceLine = highestClose;
PriceLine.SetPaintingStrategy(PaintingStrategy.DASHES);
PriceLine.SetDefaultColor(Color.ORANGE);
PriceLine.HideBubble();
PriceLine.HideTitle();

plot PriceValue = if IsNaN(close[-1]) then close else Double.NaN;
PriceValue.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);

plot PriceData = if IsNaN(close[-1]) then close else Double.NaN;
PriceData.SetPaintingStrategy(PaintingStrategy.POINTS);
PriceData.SetDefaultColor(Color.WHITE);
PriceData.SetLineWeight(5);

plot PriceData1 = if IsNaN(close[-1]) then close else Double.NaN;
PriceData1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
PriceData1.SetDefaultColor(Color.MAGENTA);
PriceData1.SetLineWeight(5);

Last edited:

### Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
356 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• 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?