Average RTH range

RyteSyde

New member
There's all kinds of ATR, ADR ranges but I'd like to have an Average Session Range. So take X days High-Low daily average but use only the regular trading hours. I don't need it to plot or draw anything fancy, I just need that number. Filtering out non-RTH is what's getting me and y'all are way smarter than I. Is this possible?
 
Solution
There's all kinds of ATR, ADR ranges but I'd like to have an Average Session Range. So take X days High-Low daily average but use only the regular trading hours. I don't need it to plot or draw anything fancy, I just need that number. Filtering out non-RTH is what's getting me and y'all are way smarter than I. Is this possible?

Just input lookback for the number of days to include in the Average. You can input debug to yes to see the sums of the highs and lows during RTH for the lookback days.

Ruby:
#Average RTH Range

input lookback = 3;

#RTH defined
def rth = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
          GetTime() <= RegularTradingEnd(GetYYYYMMDD());

#Highest High during RTH
def hrth  = if rth[1] == 0 and...
There's all kinds of ATR, ADR ranges but I'd like to have an Average Session Range. So take X days High-Low daily average but use only the regular trading hours. I don't need it to plot or draw anything fancy, I just need that number. Filtering out non-RTH is what's getting me and y'all are way smarter than I. Is this possible?

Just input lookback for the number of days to include in the Average. You can input debug to yes to see the sums of the highs and lows during RTH for the lookback days.

Ruby:
#Average RTH Range

input lookback = 3;

#RTH defined
def rth = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
          GetTime() <= RegularTradingEnd(GetYYYYMMDD());

#Highest High during RTH
def hrth  = if rth[1] == 0 and rth == 1
            then high
            else if rth[1] == 1
            then Max(high, hrth[1]) else  hrth[1];
def hrth1 = if GetTime() < RegularTradingEnd(GetYYYYMMDD()) and
               GetTime()[-1] >= RegularTradingEnd(GetYYYYMMDD())
            then hrth else 0;

#Lowerst Low durng RTH
def lrth  = if rth[1] == 0 and rth == 1
            then low
            else if rth[1] == 1
            then Min(low, lrth[1]) else  lrth[1];
def lrth1 = if GetTime() < RegularTradingEnd(GetYYYYMMDD()) and
               GetTime()[-1] >= RegularTradingEnd(GetYYYYMMDD())
            then lrth else 0;

#Define Days
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) + 1;

#Sum Highs/Lows during lookback days
def h = if thisDay <= lookback then h[1] + hrth1 else h[1];
def l = if thisDay <= lookback then l[1] + lrth1 else l[1];
input debug = no;
AddLabel (debug, astext(h) + " " + astext(l), Color.WHITE);

#Average Range during RTH
AddLabel(1, "Average RTH Range " + AsText((h - l) / (lookback)) , Color.YELLOW);
 
Solution
I can't get "h" or "l" to return any values therefore the labels all read zero. Suggestions?

I would need more information than just that. I would need to know what type of chart settings, symbol, etc.

Since regular trading hours were defined using gettime(), then you must have extended hours turned ON.
 
I would need more information than just that. I would need to know what type of chart settings, symbol, etc.

Since regular trading hours were defined using gettime(), then you must have extended hours turned ON.
I turned off Ext hours and it still wasn't showing anything, even with the debug mode on. Although, at the close today, it did end up populating.

Really what I'm trying to do (I tried all day and couldn't get the right code to work) is edit this code so that on an Extended hours chart I get the ATR and the Direct range of only the RTH. The issue is I have EMAs on the chart (/ES and /NQ futures) where they need the ETH to work right but then my indicator gets thrown off. Could you take a look at it and see if you could figure out how to code it to where it only pulls data from the RTH session? Here is the code below.

Also, I tried using the code from your thread https://usethinkscript.com/threads/remove-extended-hour-from-indicator.6768/ for the period instead of AggregationPeriod.DAY. I wish there was a default period that was DAY RTH.

Thank you, this has been driving me nuts all day.



#ATR vs DR

declare upper;

input atrLength = 10;
input averageType = AverageType.WILDERS;
input Period = AggregationPeriod.DAY;
input offset = 1;
input showATR = yes;
input showTodayRS = yes; #show strength to today's range

def ATR = MovingAverage(averageType, TrueRange(high(period= Period), close(period = Period), low(period = Period)), ATRlength)[offset];

def todayHigh = high(period = Period);
def todayLow = low(period = Period);
def DR = todayHigh - todayLow;#current range
def a = todayLow + DR * .5; #50% of DR price
def b = close(period=Period) - todayLow; #last close price to DR
def x = b / DR * 100; #current DR range

def rangeDiff = roundUp(DR-ATR); #Range Left

#labels
AddLabel(showATR, "ATR: "+Round(ATR,1)+ " vs DR: "+Round(DR), (if DR > ATR then Color.GREEN else if DR < ATR then Color.RED else Color.LIGHT_GRAY));

AddLabel(showATR,"Diff: " +absValue(rangeDiff) ,if rangeDiff < 0 then color.red else color.green);

AddLabel(showTodayRS,"RS: "+round(x,2) + "%",if x >70 then Color.GREEN else if x>60 then color.LIGHT_GREEN else if x>40 then color.orange else color.red);
 
I turned off Ext hours and it still wasn't showing anything, even with the debug mode on. Although, at the close today, it did end up populating.

Really what I'm trying to do (I tried all day and couldn't get the right code to work) is edit this code so that on an Extended hours chart I get the ATR and the Direct range of only the RTH. The issue is I have EMAs on the chart (/ES and /NQ futures) where they need the ETH to work right but then my indicator gets thrown off. Could you take a look at it and see if you could figure out how to code it to where it only pulls data from the RTH session? Here is the code below.

Also, I tried using the code from your thread https://usethinkscript.com/threads/remove-extended-hour-from-indicator.6768/ for the period instead of AggregationPeriod.DAY. I wish there was a default period that was DAY RTH.

Thank you, this has been driving me nuts all day.



#ATR vs DR

declare upper;

input atrLength = 10;
input averageType = AverageType.WILDERS;
input Period = AggregationPeriod.DAY;
input offset = 1;
input showATR = yes;
input showTodayRS = yes; #show strength to today's range

def ATR = MovingAverage(averageType, TrueRange(high(period= Period), close(period = Period), low(period = Period)), ATRlength)[offset];

def todayHigh = high(period = Period);
def todayLow = low(period = Period);
def DR = todayHigh - todayLow;#current range
def a = todayLow + DR * .5; #50% of DR price
def b = close(period=Period) - todayLow; #last close price to DR
def x = b / DR * 100; #current DR range

def rangeDiff = roundUp(DR-ATR); #Range Left

#labels
AddLabel(showATR, "ATR: "+Round(ATR,1)+ " vs DR: "+Round(DR), (if DR > ATR then Color.GREEN else if DR < ATR then Color.RED else Color.LIGHT_GRAY));

AddLabel(showATR,"Diff: " +absValue(rangeDiff) ,if rangeDiff < 0 then color.red else color.green);

AddLabel(showTodayRS,"RS: "+round(x,2) + "%",if x >70 then Color.GREEN else if x>60 then color.LIGHT_GREEN else if x>40 then color.orange else color.red);

This defines today's hrth, crth and lrth. Using the thisday==1 defined 1 days ago ph, pc, and pl to use in the ATR.
There are labels commented (#) out to see those values if needed.

Screenshot-2022-09-29-073510.jpg
Ruby:
#ATR vs DR

declare upper;

input atrLength = 10;
input averageType = AverageType.WILDERS;
#input Period = AggregationPeriod.DAY;
input offset = 1;
input showATR = yes;
input showTodayRS = yes; #show strength to today's range

#RTH defined
def rth = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
          GetTime() <= RegularTradingEnd(GetYYYYMMDD());

#Highest High during RTH
def hrth  = if rth[1] == 0 and rth == 1
            then high
            else if rth[1] == 1
            then Max(high, hrth[1]) else  hrth[1];

#Close during RTH
def crth  = if rth[1] == 0 and rth == 1
            then close 
            else if rth[1] == 1
            then close
            else crth[1];

#Lowerst Low durng RTH
def lrth  = if rth[1] == 0 and rth == 1
            then low
            else if rth[1] == 1
            then Min(low, lrth[1]) else  lrth[1];
def lrth1 = if GetTime() < RegularTradingEnd(GetYYYYMMDD()) and
               GetTime()[-1] >= RegularTradingEnd(GetYYYYMMDD())
            then lrth else 0;

#Define Days
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) ;

#Highs/Lows during lookback days
def ph = if thisDay ==1 then hrth else ph[1];#today==1 is 1 days ago h,c,l
def pc = if thisDay ==1 then crth else pc[1];
def pl = if thisDay ==1 then lrth else pl[1];

#addlabel(1,"Yesterdays" +ph +" " + pc + " " + pl);

def ATR = MovingAverage(averageType, TrueRange(ph, pc, pl), ATRlength);

def todayHigh = hrth;
def todayLow  = lrth;
def DR = todayHigh - todayLow;#current range
def a = todayLow + DR * .5; #50% of DR price
def b = close - todayLow; #last close price to DR
def x = b / DR * 100; #current DR range

def rangeDiff = roundUp(DR-ATR); #Range Left
#addlabel(1, todayhigh +" "+ todaylow);

#labels
AddLabel(showATR, "ATR: "+Round(ATR,1)+ " vs DR: "+Round(DR), (if DR > ATR then Color.GREEN else if DR < ATR then Color.RED else Color.LIGHT_GRAY));

AddLabel(showATR,"Diff: " +absValue(rangeDiff) ,if rangeDiff < 0 then color.red else color.green);

AddLabel(showTodayRS,"RS: "+round(x,2) + "%",if x >70 then Color.GREEN else if x>60 then color.LIGHT_GREEN else if x>40 then color.orange else color.red);
 
This defines today's hrth, crth and lrth. Using the thisday==1 defined 1 days ago ph, pc, and pl to use in the ATR.
There are labels commented (#) out to see those values if needed.
Thank you! How would I increase the ATR lookback days?

Edit: If you could put an input on the settings menu for the lookback days that would be sweet! BTW I started commenting on the top line of your code, "SleepyZ is a boss" :p

Thank you so much for the work you do on this forum.
 
Last edited:
Thank you! How would I increase the ATR lookback days?

Edit: If you could put an input on the settings menu for the lookback days that would be sweet! BTW I started commenting on the top line of your code, "SleepyZ is a boss" :p

Thank you so much for the work you do on this forum.

Sure, here you go. Thank you for the kind comments

Ruby:
#ATR vs DR

declare upper;

input atrLength = 10;
input averageType = AverageType.WILDERS;
#input Period = AggregationPeriod.DAY;
input offset = 1;
input showATR = yes;
input showTodayRS = yes; #show strength to today's range

#RTH defined
def rth = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
          GetTime() <= RegularTradingEnd(GetYYYYMMDD());

#Highest High during RTH
def hrth  = if rth[1] == 0 and rth == 1
            then high
            else if rth[1] == 1
            then Max(high, hrth[1]) else  hrth[1];

#Close during RTH
def crth  = if rth[1] == 0 and rth == 1
            then close
            else if rth[1] == 1
            then close
            else crth[1];

#Lowerst Low durng RTH
def lrth  = if rth[1] == 0 and rth == 1
            then low
            else if rth[1] == 1
            then Min(low, lrth[1]) else  lrth[1];
def lrth1 = if GetTime() < RegularTradingEnd(GetYYYYMMDD()) and
               GetTime()[-1] >= RegularTradingEnd(GetYYYYMMDD())
            then lrth else 0;

#Define Days
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) ;

#Highs/Lows during lookback days
input lookback = 1;
def ph = if thisDay == lookback then hrth else ph[1];#today==1 is 1 days ago h,c,l
def pc = if thisDay == lookback then crth else pc[1];
def pl = if thisDay == lookback then lrth else pl[1];

#addlabel(1,"Yesterdays" +ph +" " + pc + " " + pl);

def ATR = MovingAverage(averageType, TrueRange(ph, pc, pl), atrLength);

def todayHigh = hrth;
def todayLow  = lrth;
def DR = todayHigh - todayLow;#current range
def a = todayLow + DR * .5; #50% of DR price
def b = close - todayLow; #last close price to DR
def x = b / DR * 100; #current DR range

def rangeDiff = RoundUp(DR - ATR); #Range Left
#addlabel(1, todayhigh +" "+ todaylow);

#labels
AddLabel(showATR, "ATR: " + Round(ATR, 1) + " vs DR: " + Round(DR), (if DR > ATR then Color.GREEN else if DR < ATR then Color.RED else Color.LIGHT_GRAY));

AddLabel(showATR, "Diff: " + AbsValue(rangeDiff) , if rangeDiff < 0 then Color.RED else Color.GREEN);

AddLabel(showTodayRS, "RS: " + Round(x, 2) + "%", if x > 70 then Color.GREEN else if x > 60 then Color.LIGHT_GREEN else if x > 40 then Color.ORANGE else Color.RED);
 
Sure, here you go. Thank you for the kind comments
Might be a dumb question but in backtesting, the lookback days, does it take an average (ATR) of the lookback days, or does it just take the ATR from that specific lookback day? As I increased the lookback period I was getting odd results. If it's not an average value of lookback days is there a way to do that?
 
Might be a dumb question but in backtesting, the lookback days, does it take an average (ATR) of the lookback days, or does it just take the ATR from that specific lookback day? As I increased the lookback period I was getting odd results. If it's not an average value of lookback days is there a way to do that?

The original was just a specific day. Now this will sum the lookback days h/c/l and provide an average of ATR of the range of those days.

Ruby:
#ATR vs DR

declare upper;

input atrLength = 10;
input averageType = AverageType.WILDERS;
#input Period = AggregationPeriod.DAY;
input offset = 1;
input showATR = yes;
input showTodayRS = yes; #show strength to today's range

#RTH defined
def rth = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
          GetTime() <= RegularTradingEnd(GetYYYYMMDD());

#Highest High during RTH
def hrth  = if rth[1] == 0 and rth == 1
            then high
            else if rth[1] == 1
            then Max(high, hrth[1]) else  hrth[1];

#Close during RTH
def crth  = if rth[1] == 0 and rth == 1
            then close
            else if rth[1] == 1
            then close
            else crth[1];

#Lowerst Low durng RTH
def lrth  = if rth[1] == 0 and rth == 1
            then low
            else if rth[1] == 1
            then Min(low, lrth[1]) else  lrth[1];

#Define Days
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) + 1 ;

#Sum of Highs/Closes/Lows during lookback days
input lookback = 2;
def ph = if thisDay <= lookback  and thisDay != thisDay[1] then ph[1] + hrth else ph[1];#today==1 is 1 days ago h,c,l
def pc = if thisDay <= lookback and thisDay != thisDay[1] then pc[1] + crth else pc[1];
def pl = if thisDay <= lookback and thisDay != thisDay[1] then pl[1] + lrth else pl[1];

#AddLabel(1, (lookback + 1) + "Days H/C/L " + ph + "  " + pc + "  " + pl + "  " );

def ATR = MovingAverage(averageType, TrueRange(ph, pc, pl) / lookback, atrLength);

def todayHigh = hrth;
def todayLow  = lrth;
def DR = todayHigh - todayLow;#current range
def a = todayLow + DR * .5; #50% of DR price
def b = close - todayLow; #last close price to DR
def x = b / DR * 100; #current DR range

def rangeDiff = RoundUp(DR - ATR); #Range Left
#addlabel(1, todayhigh +" "+ todaylow);

#labels
AddLabel(showATR, "ATR: " + Round(ATR, 1) + " vs DR: " + Round(DR), (if DR > ATR then Color.GREEN else if DR < ATR then Color.RED else Color.LIGHT_GRAY));

AddLabel(showATR, "Diff: " + AsText(AbsValue(rangeDiff)) , if rangeDiff < 0 then Color.RED else Color.GREEN);

AddLabel(showTodayRS, "RS: " + Round(x, 2) + "%", if x > 70 then Color.GREEN else if x > 60 then Color.LIGHT_GREEN else if x > 40 then Color.ORANGE else Color.RED);
 
VPOC Question for SleepyZ: I use the below code multiple times on my chart to establish the daily (24hr) VPOC for the last few days. This is simple for me and I can label them independently. I would really like this concise code limited to JUST RTH and have tried to modify based on other RTH/ETH split VPOC codes I have seen but the reference(VolumeProfile) does not seem to like it. Do you think this code can be modified to just RTH without much complexity? I'm not sure where I saw this originally and might even be yours as you are Mr. VPOC.

Kind Thanks as always

Ruby:
input daysback = 2;

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 locate = isNaN(close[-84]) and !isNaN(close[-83]);
def locate2 = isNaN(close[-74]) and !isNaN(close[-73]);

def cond = (SecondsFromTime(0000) crosses 0);

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 vahigh   = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).VAHigh else vahigh[1];
def valow    = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).VALow else valow[1];

plot poc1    = if thisDay > daysback then Double.NaN else poc;
plot vahigh1 = if thisDay > daysback then Double.NaN else vahigh;
def cloudhi = if thisDay > daysback then Double.NaN else if thisDay < daysback then Double.NaN else vahigh;
plot valow1  = if thisDay > daysback then Double.NaN else valow;
def cloudlo = if thisDay > daysback then Double.NaN else if thisDay < daysback then Double.NaN else valow;
addcloud(cloudlo,cloudhi,color2 = createColor(153,153,255));

poc1.setdefaultColor(color.blue);
vahigh1.setdefaultColor(color.blue);
vahigh1.setstyle(curve.SHORT_DASH);
valow1.setdefaultColor(color.blue);
valow1.setstyle(curve.SHORT_DASH);
input bubblemover = 3;
def b  = bubblemover;
def b1 = b + 1;
input showbubbles = yes;
addchartBubble(thisday == daysback and cond, poc1[b], "POC - " + daysback, color.white);
#addchartBubble(locate, vahigh1[b], "VAH - " + daysback, color.white);
#addchartBubble(locate, valow1[b], "VAL - " + daysback, color.white);
 
VPOC Question for SleepyZ: I use the below code multiple times on my chart to establish the daily (24hr) VPOC for the last few days. This is simple for me and I can label them independently. I would really like this concise code limited to JUST RTH and have tried to modify based on other RTH/ETH split VPOC codes I have seen but the reference(VolumeProfile) does not seem to like it. Do you think this code can be modified to just RTH without much complexity? I'm not sure where I saw this originally and might even be yours as you are Mr. VPOC.

Kind Thanks as always

Ruby:
input daysback = 2;

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 locate = isNaN(close[-84]) and !isNaN(close[-83]);
def locate2 = isNaN(close[-74]) and !isNaN(close[-73]);

def cond = (SecondsFromTime(0000) crosses 0);

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 vahigh   = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).VAHigh else vahigh[1];
def valow    = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).VALow else valow[1];

plot poc1    = if thisDay > daysback then Double.NaN else poc;
plot vahigh1 = if thisDay > daysback then Double.NaN else vahigh;
def cloudhi = if thisDay > daysback then Double.NaN else if thisDay < daysback then Double.NaN else vahigh;
plot valow1  = if thisDay > daysback then Double.NaN else valow;
def cloudlo = if thisDay > daysback then Double.NaN else if thisDay < daysback then Double.NaN else valow;
addcloud(cloudlo,cloudhi,color2 = createColor(153,153,255));

poc1.setdefaultColor(color.blue);
vahigh1.setdefaultColor(color.blue);
vahigh1.setstyle(curve.SHORT_DASH);
valow1.setdefaultColor(color.blue);
valow1.setstyle(curve.SHORT_DASH);
input bubblemover = 3;
def b  = bubblemover;
def b1 = b + 1;
input showbubbles = yes;
addchartBubble(thisday == daysback and cond, poc1[b], "POC - " + daysback, color.white);
#addchartBubble(locate, vahigh1[b], "VAH - " + daysback, color.white);
#addchartBubble(locate, valow1[b], "VAL - " + daysback, color.white);

Try this

Snip.png
Ruby:
input daysback = 0;

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 locate = IsNaN(close[-84]) and !IsNaN(close[-83]);
def locate2 = IsNaN(close[-74]) and !IsNaN(close[-73]);

def cond = (SecondsFromTime(0930) crosses 0);
def rth  = SecondsFromTime(0930) >= 0 and SecondsTillTime(1600) >= 0;
def cond1 = rth != rth[1];

profile vol = VolumeProfile("startNewProfile" = cond1 and SecondsTillTime(1600) >= 0, "onExpansion" = no, "numberOfProfiles" = 1000, pricePerRow = PricePerRow.TICKSIZE);

def pc      = if thisDay == daysback then if IsNaN(vol.GetpointOfControl()) then pc[1] else vol.GetpointOfControl() else pc[1];
def vhigh   = if thisDay == daysback then if IsNaN(vol.GethighestValueArea()) then vhigh[1] else vol.GethighestvalueArea() else vhigh[1];
def vlow    = if thisDay == daysback then if IsNaN(vol.GetlowestvalueArea()) then vlow[1] else vol.GetlowestValueArea() else vlow[1];

plot poc    = if thisDay > daysback or secondsfromTime(0930)<0 then Double.NaN else pc;
plot vahigh = if thisDay > daysback or secondsfromTime(0930)<0 then Double.NaN else vhigh;
def cloudhi = if thisDay > daysback or secondsfromTime(0930)<0 then Double.NaN else if thisDay < daysback then Double.NaN else vahigh;
plot valow  = if thisDay > daysback then Double.NaN else vlow;
def cloudlo = if thisDay > daysback then Double.NaN else if thisDay < daysback then Double.NaN else valow;
AddCloud(cloudlo, cloudhi, color2 = CreateColor(153, 153, 255));

poc.SetDefaultColor(Color.BLUE);
vahigh.SetDefaultColor(Color.BLUE);
vahigh.SetStyle(Curve.SHORT_DASH);
valow.SetDefaultColor(Color.BLUE);
valow.SetStyle(Curve.SHORT_DASH);
input bubblemover = 3;
def b  = bubblemover;
def b1 = b + 1;
input showbubbles = yes;
AddChartBubble(thisDay == daysback and cond1, poc[b], "POC - " + daysback, Color.WHITE);
#addchartBubble(locate, vahigh1[b], "VAH - " + daysback, color.white);
#addchartBubble(locate, valow1[b], "VAL - " + daysback, color.white);
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
495 Online
Create Post

Similar threads

Similar threads

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