Plot Highest high and Lowest low of first seven bars

earlyinout

New member
I have been using Kory's code and it is perfect! I want to have the length be static for the first seven bars of the rth session. Hoping it can be done to work on anytime frame, tick or range chart. Thank you in advance. Here is Kory's code;
Code:
 HighLowLookback
#
# Study to show the highest high and lowest low after a given number of bars back.
#
# Author: Kory Gill, @korygill
#
# VERSION HISTORY (sortable date and time (your local time is fine), and your initials
# 20190710-2200-KG    - created
# ...
# ...
#

#
# Inputs
#
input length = 13;

#
# Common Variables that may also reduce calls to server
#
def vClose = close;
def vLow = low;
def vHigh = high;
def nan = double.NaN;

#
# Logic
#
def currentBarNumber = if !IsNaN(vClose) then BarNumber() else nan;
def lastBarNumber = HighestAll(currentBarNumber);
def lookbackBar = lastBarNumber - length + 1;
def doPlot = if currentBarNumber >= lookbackBar then 1 else 0;

def mostRecentHigh = CompoundValue(1, if doPlot && vHigh > mostRecentHigh[1] then vHigh else mostRecentHigh[1],double.NEGATIVE_INFINITY);
def highBarNumber  = CompoundValue(1, if doPlot && vHIgh > mostRecentHigh[1] then currentBarNumber else highBarNumber[1],0);
plot mrh = if currentBarNumber >= HighestAll(highBarNumber) then mostRecentHigh else nan;
mrh.SetDefaultColor(Color.GREEN);

def mostRecentLow = CompoundValue(1, if doPlot && vLow < mostRecentLow[1] then vLow else mostRecentLow[1],double.POSITIVE_INFINITY);
def lowBarNumber  = CompoundValue(1, if doPlot && vLow < mostRecentLow[1] then currentBarNumber else lowBarNumber[1],0);
plot mrl = if currentBarNumber >= HighestAll(lowBarNumber) then mostRecentLow else nan;
mrl.SetDefaultColor(Color.RED);

#
# Visualizations
#
AddChartBubble(
    currentBarNumber == HighestAll(highBarNumber),
    vHigh,
    "HIGH",
    Color.WHITE,
    yes);

AddChartBubble(
    currentBarNumber == HighestAll(lowBarNumber),
    vLow,
    "LOW",
    Color.WHITE,
    no);

AddChartBubble(
    currentBarNumber == lookbackBar,
    (vHigh+vLow)/2,
    length+"\nBar",
    Color.GRAY,
    yes);

plot bbH = if currentBarNumber == lookbackBar then vHigh + TickSize()*1 else nan;
bbH.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbH.SetDefaultColor(Color.MAGENTA);
bbH.SetLineWeight(5);
bbH.HideBubble();

plot bbL = if currentBarNumber == lookbackBar then vLow - TickSize()*1 else nan;
bbL.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbL.SetDefaultColor(Color.MAGENTA);
bbL.SetLineWeight(5);
bbL.HideBubble();

#
# Labels
#
AddLabel(yes,
"mostRecentHigh: " + mostRecentHigh,
Color.Gray);

AddLabel(yes,
"mostRecentLow: " + mostRecentLow,
Color.Gray);
 
Solution
I have been using Kory's code and it is perfect! I want to have the length be static for the first seven bars of the rth session. Hoping it can be done to work on anytime frame, tick or range chart. Thank you in advance. Here is Kory's code;

pick a day and quantity of bars, and find the high and low of the first quantity of bars.

this will ask for,
how many days back from the last day. 1 = last day, 2 = 2nd to last day,..
how many bars after the beginning of the trading day, to look for a high and low.

Ruby:
# hilo_xday_first_xbars_0

input first_x_bars = 7;
def na = double.nan;
def bn = barnumber();

# day count
def istoday = if GetLastDay() == GetDay() then 1 else 0;
def newday = if getday() != getday()[1] then 1 else 0...
I have been using Kory's code and it is perfect! I want to have the length be static for the first seven bars of the rth session. Hoping it can be done to work on anytime frame, tick or range chart. Thank you in advance. Here is Kory's code;
Code:
 HighLowLookback
#
# Study to show the highest high and lowest low after a given number of bars back.
#
# Author: Kory Gill, @korygill
#
# VERSION HISTORY (sortable date and time (your local time is fine), and your initials
# 20190710-2200-KG    - created
# ...
# ...
#

#
# Inputs
#
input length = 13;

#
# Common Variables that may also reduce calls to server
#
def vClose = close;
def vLow = low;
def vHigh = high;
def nan = double.NaN;

#
# Logic
#
def currentBarNumber = if !IsNaN(vClose) then BarNumber() else nan;
def lastBarNumber = HighestAll(currentBarNumber);
def lookbackBar = lastBarNumber - length + 1;
def doPlot = if currentBarNumber >= lookbackBar then 1 else 0;

def mostRecentHigh = CompoundValue(1, if doPlot && vHigh > mostRecentHigh[1] then vHigh else mostRecentHigh[1],double.NEGATIVE_INFINITY);
def highBarNumber  = CompoundValue(1, if doPlot && vHIgh > mostRecentHigh[1] then currentBarNumber else highBarNumber[1],0);
plot mrh = if currentBarNumber >= HighestAll(highBarNumber) then mostRecentHigh else nan;
mrh.SetDefaultColor(Color.GREEN);

def mostRecentLow = CompoundValue(1, if doPlot && vLow < mostRecentLow[1] then vLow else mostRecentLow[1],double.POSITIVE_INFINITY);
def lowBarNumber  = CompoundValue(1, if doPlot && vLow < mostRecentLow[1] then currentBarNumber else lowBarNumber[1],0);
plot mrl = if currentBarNumber >= HighestAll(lowBarNumber) then mostRecentLow else nan;
mrl.SetDefaultColor(Color.RED);

#
# Visualizations
#
AddChartBubble(
    currentBarNumber == HighestAll(highBarNumber),
    vHigh,
    "HIGH",
    Color.WHITE,
    yes);

AddChartBubble(
    currentBarNumber == HighestAll(lowBarNumber),
    vLow,
    "LOW",
    Color.WHITE,
    no);

AddChartBubble(
    currentBarNumber == lookbackBar,
    (vHigh+vLow)/2,
    length+"\nBar",
    Color.GRAY,
    yes);

plot bbH = if currentBarNumber == lookbackBar then vHigh + TickSize()*1 else nan;
bbH.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbH.SetDefaultColor(Color.MAGENTA);
bbH.SetLineWeight(5);
bbH.HideBubble();

plot bbL = if currentBarNumber == lookbackBar then vLow - TickSize()*1 else nan;
bbL.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbL.SetDefaultColor(Color.MAGENTA);
bbL.SetLineWeight(5);
bbL.HideBubble();

#
# Labels
#
AddLabel(yes,
"mostRecentHigh: " + mostRecentHigh,
Color.Gray);

AddLabel(yes,
"mostRecentLow: " + mostRecentLow,
Color.Gray);

what is the r th session. ?

are you wanting to find a specific day on the chart,
and look at the first 7 bars on that 1 specific day ?

maybe some orb study could be modified to do what you want.
i'll look at what i have and see about changing one
 

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

I have been using Kory's code and it is perfect! I want to have the length be static for the first seven bars of the rth session. Hoping it can be done to work on anytime frame, tick or range chart. Thank you in advance. Here is Kory's code;
Code:
 HighLowLookback
#
# Study to show the highest high and lowest low after a given number of bars back.
#
# Author: Kory Gill, @korygill
#
# VERSION HISTORY (sortable date and time (your local time is fine), and your initials
# 20190710-2200-KG    - created
# ...
# ...
#

#
# Inputs
#
input length = 13;

#
# Common Variables that may also reduce calls to server
#
def vClose = close;
def vLow = low;
def vHigh = high;
def nan = double.NaN;

#
# Logic
#
def currentBarNumber = if !IsNaN(vClose) then BarNumber() else nan;
def lastBarNumber = HighestAll(currentBarNumber);
def lookbackBar = lastBarNumber - length + 1;
def doPlot = if currentBarNumber >= lookbackBar then 1 else 0;

def mostRecentHigh = CompoundValue(1, if doPlot && vHigh > mostRecentHigh[1] then vHigh else mostRecentHigh[1],double.NEGATIVE_INFINITY);
def highBarNumber  = CompoundValue(1, if doPlot && vHIgh > mostRecentHigh[1] then currentBarNumber else highBarNumber[1],0);
plot mrh = if currentBarNumber >= HighestAll(highBarNumber) then mostRecentHigh else nan;
mrh.SetDefaultColor(Color.GREEN);

def mostRecentLow = CompoundValue(1, if doPlot && vLow < mostRecentLow[1] then vLow else mostRecentLow[1],double.POSITIVE_INFINITY);
def lowBarNumber  = CompoundValue(1, if doPlot && vLow < mostRecentLow[1] then currentBarNumber else lowBarNumber[1],0);
plot mrl = if currentBarNumber >= HighestAll(lowBarNumber) then mostRecentLow else nan;
mrl.SetDefaultColor(Color.RED);

#
# Visualizations
#
AddChartBubble(
    currentBarNumber == HighestAll(highBarNumber),
    vHigh,
    "HIGH",
    Color.WHITE,
    yes);

AddChartBubble(
    currentBarNumber == HighestAll(lowBarNumber),
    vLow,
    "LOW",
    Color.WHITE,
    no);

AddChartBubble(
    currentBarNumber == lookbackBar,
    (vHigh+vLow)/2,
    length+"\nBar",
    Color.GRAY,
    yes);

plot bbH = if currentBarNumber == lookbackBar then vHigh + TickSize()*1 else nan;
bbH.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbH.SetDefaultColor(Color.MAGENTA);
bbH.SetLineWeight(5);
bbH.HideBubble();

plot bbL = if currentBarNumber == lookbackBar then vLow - TickSize()*1 else nan;
bbL.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbL.SetDefaultColor(Color.MAGENTA);
bbL.SetLineWeight(5);
bbL.HideBubble();

#
# Labels
#
AddLabel(yes,
"mostRecentHigh: " + mostRecentHigh,
Color.Gray);

AddLabel(yes,
"mostRecentLow: " + mostRecentLow,
Color.Gray);

you didn't ask for this, but sometimes i look at a study and wonder if i can do it differently.
here is my version of your code in post#1
it doesn't use highestall()

Ruby:
# hilo_lastx_bars_0_myver

def na = double.nan;
def bn = BarNumber();
#-------------------------------------------
# https://usethinkscript.com/threads/current-price-line-indicator-for-thinkorswim.8793/
# Line At Price   Mobius
# Alternative to using the HighestAll() function
# if a chart has more than 1000 bars, increase this number. 1999 max
def barsBack = 1000;
def c2 = if !IsNaN(close) and IsNaN(close[-1])
        then bn
        else c2[1];
def lastbn = if isNaN(close[-barsBack])
            then c2[-barsBack]
            else Double.NaN;

input length = 13;
def rngfirst = ( !isnan(close[-(length-1)]) and isnan(close[-length]) );

def hi = if bn == 1 or bn > lastbn then na
else if rngfirst then highest( high[-(length-1)], length)
else hi[1];
def hibnoff = if bn == 1 or bn > lastbn then na
else if rngfirst then GetMaxValueOffset( high[-(length-1)], length)
else hibnoff[1];
def hibn = lastbn - hibnoff;
plot zhi = hi;
zhi.AssignValueColor( if bn >= (hibn + 1) then color.magenta else color.orange);

def lo = if bn == 1 or bn > lastbn then na
  else if rngfirst then lowest(low[-(length-1)], length)
  else lo[1];
def lobnoff = if bn == 1 or bn > lastbn then na
  else if rngfirst then GetminValueOffset(low[-(length-1)], length)
  else lobnoff[1];
def lobn = lastbn - lobnoff;
plot zlo = lo;
zlo.AssignValueColor( if bn >= (lobn + 1) then color.magenta else color.orange);

AddChartBubble(bn == hibn, hi, "HIGH", Color.WHITE, yes);
AddChartBubble(bn == lobn, lo, "LOW", Color.WHITE, no);

AddChartBubble(
    rngfirst,
    (High+low)/2,
    length+"\nBar",
    Color.GRAY,
    yes);

plot bbH = if rngfirst then High + TickSize()*1 else na;
bbH.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbH.SetDefaultColor(Color.MAGENTA);
bbH.SetLineWeight(5);
bbH.HideBubble();

plot bbL = if rngfirst then Low - TickSize()*1 else na;
bbL.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbL.SetDefaultColor(Color.MAGENTA);
bbL.SetLineWeight(5);
bbL.HideBubble();

AddLabel(yes,
"mostRecentHigh: " + hi,
Color.Gray);

AddLabel(yes,
"mostRecentLow: " + lo,
Color.Gray);
#

db0kOJG.jpg
 
I have been using Kory's code and it is perfect! I want to have the length be static for the first seven bars of the rth session. Hoping it can be done to work on anytime frame, tick or range chart. Thank you in advance. Here is Kory's code;

pick a day and quantity of bars, and find the high and low of the first quantity of bars.

this will ask for,
how many days back from the last day. 1 = last day, 2 = 2nd to last day,..
how many bars after the beginning of the trading day, to look for a high and low.

Ruby:
# hilo_xday_first_xbars_0

input first_x_bars = 7;
def na = double.nan;
def bn = barnumber();

# day count
def istoday = if GetLastDay() == GetDay() then 1 else 0;
def newday = if getday() != getday()[1] then 1 else 0;
def daycnt = if bn == 1 then 1 else if (!isnan(close) and newday) then daycnt[1] + 1 else daycnt[1];
def maxdays = highestall(daycnt);
def revdaycnt = maxdays - daycnt + 1;

addlabel(1, maxdays + " days on chart", color.yellow);

input days_back = 2;
def days_back2 = if days_back < 0 then 0 else if days_back > maxdays then maxdays else days_back;
def isday = (revdaycnt == days_back2);

def start = 0930;
#def end = 1600;
#def daytime = if secondsfromTime(start) >= 0 and secondstillTime(end) > 0 then 1 else 0;
def daystart = if secondsfromTime(start) == 0 then 1 else 0;

#-------------------------------------------
# https://usethinkscript.com/threads/current-price-line-indicator-for-thinkorswim.8793/
# Line At Price   Mobius
# Alternative to using the HighestAll() function
# if a chart has more than 1000 bars, increase this number. 1999 max
def barsBack = 1000;
def c2 = if !IsNaN(close) and IsNaN(close[-1])
        then bn
        else c2[1];
def lastbn = if isNaN(close[-barsBack])
            then c2[-barsBack]
            else Double.NaN;

def length = first_x_bars;
def rngfirst = daystart and isday;
def rngfirstbn = if rngfirst then bn else rngfirstbn[1];
def rnglastbn = (rngfirstbn + length - 1);

def hi = if bn == 1 or bn > rnglastbn or !isday then na
  else if rngfirst then highest( high[-(length-1)], length)
  else hi[1];
def hibnoff = if bn == 1 or bn > rnglastbn then na
  else if rngfirst then GetMaxValueOffset( high[-(length-1)], length)
  else hibnoff[1];
def hibn = rnglastbn - hibnoff;
plot zhi = hi;
zhi.AssignValueColor( if bn >= (hibn + 1) then color.magenta else color.orange);

def lo = if bn == 1 or bn > rnglastbn or !isday then na
  else if rngfirst then lowest(low[-(length-1)], length)
  else lo[1];
def lobnoff = if bn == 1 or bn > rnglastbn then na
  else if rngfirst then GetminValueOffset(low[-(length-1)], length)
  else lobnoff[1];
def lobn = rnglastbn - lobnoff;
plot zlo = lo;
zlo.AssignValueColor( if bn >= (lobn + 1) then color.magenta else color.orange);

AddChartBubble(bn == hibn, hi, "HIGH", Color.WHITE, yes);
AddChartBubble(bn == lobn, lo, "LOW", Color.WHITE, no);

AddChartBubble(
# first bar
#    rngfirst,
# last bar
   bn == rnglastbn,
    (High+low)/2,
    length+"\nBar",
    Color.GRAY,
    yes);

#plot bbH = if isday and rngfirst then High + TickSize()*1 else na;
plot bbH = if bn == rnglastbn then High + TickSize()*1 else na;
bbH.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbH.SetDefaultColor(Color.MAGENTA);
bbH.SetLineWeight(5);
bbH.HideBubble();

#plot bbL = if isday and rngfirst then Low - TickSize()*1 else na;
plot bbL = if bn == rnglastbn then Low - TickSize()*1 else na;
bbL.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbL.SetDefaultColor(Color.MAGENTA);
bbL.SetLineWeight(5);
bbL.HideBubble();
#
#

WFC 15min 10day
days back = 2
pnbj2lQ.jpg
 
Solution
pick a day and quantity of bars, and find the high and low of the first quantity of bars.

this will ask for,
how many days back from the last day. 1 = last day, 2 = 2nd to last day,..
how many bars after the beginning of the trading day, to look for a high and low.

Ruby:
# hilo_xday_first_xbars_0

input first_x_bars = 7;
def na = double.nan;
def bn = barnumber();

# day count
def istoday = if GetLastDay() == GetDay() then 1 else 0;
def newday = if getday() != getday()[1] then 1 else 0;
def daycnt = if bn == 1 then 1 else if (!isnan(close) and newday) then daycnt[1] + 1 else daycnt[1];
def maxdays = highestall(daycnt);
def revdaycnt = maxdays - daycnt + 1;

addlabel(1, maxdays + " days on chart", color.yellow);

input days_back = 2;
def days_back2 = if days_back < 0 then 0 else if days_back > maxdays then maxdays else days_back;
def isday = (revdaycnt == days_back2);

def start = 0930;
#def end = 1600;
#def daytime = if secondsfromTime(start) >= 0 and secondstillTime(end) > 0 then 1 else 0;
def daystart = if secondsfromTime(start) == 0 then 1 else 0;

#-------------------------------------------
# https://usethinkscript.com/threads/current-price-line-indicator-for-thinkorswim.8793/
# Line At Price   Mobius
# Alternative to using the HighestAll() function
# if a chart has more than 1000 bars, increase this number. 1999 max
def barsBack = 1000;
def c2 = if !IsNaN(close) and IsNaN(close[-1])
        then bn
        else c2[1];
def lastbn = if isNaN(close[-barsBack])
            then c2[-barsBack]
            else Double.NaN;

def length = first_x_bars;
def rngfirst = daystart and isday;
def rngfirstbn = if rngfirst then bn else rngfirstbn[1];
def rnglastbn = (rngfirstbn + length - 1);

def hi = if bn == 1 or bn > rnglastbn or !isday then na
  else if rngfirst then highest( high[-(length-1)], length)
  else hi[1];
def hibnoff = if bn == 1 or bn > rnglastbn then na
  else if rngfirst then GetMaxValueOffset( high[-(length-1)], length)
  else hibnoff[1];
def hibn = rnglastbn - hibnoff;
plot zhi = hi;
zhi.AssignValueColor( if bn >= (hibn + 1) then color.magenta else color.orange);

def lo = if bn == 1 or bn > rnglastbn or !isday then na
  else if rngfirst then lowest(low[-(length-1)], length)
  else lo[1];
def lobnoff = if bn == 1 or bn > rnglastbn then na
  else if rngfirst then GetminValueOffset(low[-(length-1)], length)
  else lobnoff[1];
def lobn = rnglastbn - lobnoff;
plot zlo = lo;
zlo.AssignValueColor( if bn >= (lobn + 1) then color.magenta else color.orange);

AddChartBubble(bn == hibn, hi, "HIGH", Color.WHITE, yes);
AddChartBubble(bn == lobn, lo, "LOW", Color.WHITE, no);

AddChartBubble(
# first bar
#    rngfirst,
# last bar
   bn == rnglastbn,
    (High+low)/2,
    length+"\nBar",
    Color.GRAY,
    yes);

#plot bbH = if isday and rngfirst then High + TickSize()*1 else na;
plot bbH = if bn == rnglastbn then High + TickSize()*1 else na;
bbH.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbH.SetDefaultColor(Color.MAGENTA);
bbH.SetLineWeight(5);
bbH.HideBubble();

#plot bbL = if isday and rngfirst then Low - TickSize()*1 else na;
plot bbL = if bn == rnglastbn then Low - TickSize()*1 else na;
bbL.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbL.SetDefaultColor(Color.MAGENTA);
bbL.SetLineWeight(5);
bbL.HideBubble();
#
#

WFC 15min 10day
days back = 2
View attachment 14552
could you please help me with getting highest close and lowest close within the last n bars (instead of the highest high and lowest low). thanks.
 
could you please help me with getting highest close and lowest close within the last n bars (instead of the highest high and lowest low). thanks.

add inputs, to choose which price parameter to use, for highest and lowest
default is close

Code:
# hilo_xday_first_xbars_01

# chg to pick price,  high, low, close,..
# orb , but x bars, not time
# hilo_lastx_bars_0_myver
# https://usethinkscript.com/threads/plot-highest-high-and-lowest-low-of-first-seven-bars.11222/

input first_x_bars = 7;

def na = double.nan;
def bn = barnumber();

# day count
def istoday = if GetLastDay() == GetDay() then 1 else 0;
def newday = if getday() != getday()[1] then 1 else 0;
def daycnt = if bn == 1 then 1 else if (!isnan(close) and newday) then daycnt[1] + 1 else daycnt[1];
def maxdays = highestall(daycnt);
def revdaycnt = maxdays - daycnt + 1;

addlabel(1, maxdays + " days on chart", color.yellow);

input days_back = 2;
def days_back2 = if days_back < 0 then 0 else if days_back > maxdays then maxdays else days_back;
def isday = (revdaycnt == days_back2);

def start = 0930;
#def end = 1600;
#def daytime = if secondsfromTime(start) >= 0 and secondstillTime(end) > 0 then 1 else 0;
def daystart = if secondsfromTime(start) == 0 then 1 else 0;

#-------------------------------------------
# https://usethinkscript.com/threads/current-price-line-indicator-for-thinkorswim.8793/
# Line At Price   Mobius
# Alternative to using the HighestAll() function
# if a chart has more than 1000 bars, increase this number. 1999 max
def barsBack = 1000;
def c2 = if !IsNaN(close) and IsNaN(close[-1])
        then bn
        else c2[1];
def lastbn = if isNaN(close[-barsBack])
            then c2[-barsBack]
            else Double.NaN;

def length = first_x_bars;
def rngfirst = daystart and isday;
def rngfirstbn = if rngfirst then bn else rngfirstbn[1];
def rnglastbn = (rngfirstbn + length - 1);

input hi_price = close;
input lo_price = close;

def hi = if bn == 1 or bn > rnglastbn or !isday then na
  else if rngfirst then highest( hi_price[-(length-1)], length)
  else hi[1];
def hibnoff = if bn == 1 or bn > rnglastbn then na
  else if rngfirst then GetMaxValueOffset( hi_price[-(length-1)], length)
  else hibnoff[1];
def hibn = rnglastbn - hibnoff;
plot zhi = hi;
zhi.AssignValueColor( if bn >= (hibn + 1) then color.magenta else color.orange);

def lo = if bn == 1 or bn > rnglastbn or !isday then na
  else if rngfirst then lowest( lo_price[-(length-1)], length)
  else lo[1];
def lobnoff = if bn == 1 or bn > rnglastbn then na
  else if rngfirst then GetminValueOffset( lo_price[-(length-1)], length)
  else lobnoff[1];
def lobn = rnglastbn - lobnoff;
plot zlo = lo;
zlo.AssignValueColor( if bn >= (lobn + 1) then color.magenta else color.orange);

AddChartBubble(bn == hibn, hi, "HIGH", Color.WHITE, yes);
AddChartBubble(bn == lobn, lo, "LOW", Color.WHITE, no);


#plot bbH = if isday and rngfirst then High + TickSize()*1 else na;
plot bbH = if bn == rnglastbn then High + TickSize()*1 else na;
bbH.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbH.SetDefaultColor(Color.MAGENTA);
bbH.SetLineWeight(5);
bbH.HideBubble();

#plot bbL = if isday and rngfirst then Low - TickSize()*1 else na;
plot bbL = if bn == rnglastbn then Low - TickSize()*1 else na;
bbL.SetPaintingStrategy(PaintingStrategy.SQUARES);
bbL.SetDefaultColor(Color.MAGENTA);
bbL.SetLineWeight(5);
bbL.HideBubble();

#
#---------------------------

addchartbubble( 0 and isday, low*0.99,
newday + " new\n" +
daycnt + " cnt\n" +
revdaycnt + " rev\n" +
maxdays + " max\n" +
days_back2 + "\n" +
isday
, color.yellow, no);


addchartbubble(0, low,
 bn + "\n" +
 lastbn + "\n" +
 hi + "\n" +
 hibnoff + "\n" +
 hibn
, color.cyan, no);
#
#
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
248 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