Previous Days High, Low, Open, Close, and High/Low of defined timeframe For ThinkOrSwim

I am trying to make this plot during 0930 and 1559 since I mostly chart Futures and this one considers the close of a later candle. I searched but most previous close scripts seems to take entire day instead of 0930-1559. Thank you!

Code:
#
input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLastPeriod = no;
plot PrevDayClose;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) { PrevDayClose = Double.NaN;
} else { PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);
}
 

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

I am trying to make this plot during 0930 and 1559 since I mostly chart Futures and this one considers the close of a later candle. I searched but most previous close scripts seems to take entire day instead of 0930-1559. Thank you!

Code:
#
input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLastPeriod = no;
plot PrevDayClose;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) { PrevDayClose = Double.NaN;
} else { PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);
}

This should limit the plot with input options.

Capture.jpg
Ruby:
#
input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLastPeriod = yes;
input showonlyduringRTH  = yes;
def rth = SecondsFromTime(0930) >= 0 and SecondsFromTime(1559) <= 0;
plot PrevDayClose;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) or
   showonlyduringRTH and !rth {
    PrevDayClose = Double.NaN;
} else if showonlyduringRTH and rth {
    PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);
} else {
    PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);
}
PrevDayClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
 
Thank you for your reply! So I test it out but its still considering the wrong close. Maybe I did not explain it that well. As you can tell from the pic, Previous Day Close I want to be plotted is at 1559. When I was messing with the code, when I changed the "1559" to, lets say, "1259," it only shorten the line instead of moving it to the close of the 12:59 candle.

Screen-Shot-2022-07-30-at-8-14-36-PM.png

upload
 
Thank you for your reply! So I test it out but its still considering the wrong close. Maybe I did not explain it that well. As you can tell from the pic, Previous Day Close I want to be plotted is at 1559. When I was messing with the code, when I changed the "1559" to, lets say, "1259," it only shorten the line instead of moving it to the close of the 12:59 candle.

Screen-Shot-2022-07-30-at-8-14-36-PM.png

upload

This will find the close of the prior day at the time input as rthend (ie: 1559 as you requested).

Capture.jpg
Ruby:
input rthbegin = 0930;
input rthend   = 1559;

def lastclose    = CompoundValue(1,
                   if SecondsTillTime(rthend)[1] > 0 and
                      SecondsTillTime(rthend) <= 0 or
                     (SecondsTillTime(rthend)[1] < SecondsTillTime(rthend) and
                      SecondsTillTime(rthend)[1] > 0)
                  then close
                  else lastclose[1], close);

plot pc = lastclose;
pc.SetPaintingStrategy(PaintingStrategy.DASHES);
pc.SetDefaultColor(Color.yellow);


input showbubbles_Prior_OHLC = yes;
input n = 5;
def  n1 = n + 1;

def StartPlot = if showbubbles_Prior_OHLC == yes
                then (IsNaN(close[n]) and !IsNaN(close[n1]))
                else Double.NaN;

AddChartBubble(StartPlot,  Round(pc[n1], 2), "PC-" + astext(Round(pc[n1], 2)), Color.YELLOW,  yes);
 
This will find the close of the prior day at the time input as rthend (ie: 1559 as you requested).
Ah Perfect! Plotted just where I needed it. Last request. Is there a way to have it just show prior close? I see it extending throughout all prior days on chart. Thank you!
 
Ah Perfect! Plotted just where I needed it. Last request. Is there a way to have it just show prior close? I see it extending throughout all prior days on chart. Thank you!

The input showlastcloseonly set to yes will limit the plot to the last one.

Ruby:
input rthbegin = 0930;
input rthend   = 1559;
input showlastcloseonly = yes;

def lastclose    = CompoundValue(1,
                   if SecondsTillTime(rthend)[1] > 0 and
                      SecondsTillTime(rthend) <= 0 or
                     (SecondsTillTime(rthend)[1] < SecondsTillTime(rthend) and
                      SecondsTillTime(rthend)[1] > 0)
                  then close
                  else lastclose[1], close);
def bn           = barnumber();
def lastclosebn  = CompoundValue(1,
                   if SecondsTillTime(rthend)[1] > 0 and
                      SecondsTillTime(rthend) <= 0 or
                     (SecondsTillTime(rthend)[1] < SecondsTillTime(rthend) and
                      SecondsTillTime(rthend)[1] > 0)
                  then bn
                  else double.nan, bn);

plot pc = if showlastcloseonly and
             bn < highestall(lastclosebn)
          then double.nan
          else lastclose;
pc.SetPaintingStrategy(PaintingStrategy.DASHES);
pc.SetDefaultColor(Color.yellow);


input showbubbles_Prior_OHLC = yes;
input n = 5;
def  n1 = n + 1;

def StartPlot = if showbubbles_Prior_OHLC == yes
                then (IsNaN(close[n]) and !IsNaN(close[n1]))
                else Double.NaN;

AddChartBubble(StartPlot,  Round(pc[n1], 2), "PC-" + astext(Round(pc[n1], 2)), Color.YELLOW,  yes);
 
@eulin87 ,Could you post all the code for the above script. Thank you for your help.
No problem. I think its pretty good for now. Im pretty OCD so always adjusting but seems to be good for now.

Code:
# Twitter: @Eddie_HigherLow
#
# I created this script to save me time when charting.

# Includes:
# Previous Day High, Low, and Close
# Premarket High and Low
# Opening Price


#
#Show PreMarket
input Show_Bubbles = no;
input Show_PreMarket = yes;
input periodstart = 0400;
input periodend = 0930;
input sPeriod = {default DAY};
def offset = 1;

def Today = if GetDay() == GetLastDay() then 1 else 0;
def varhigh = high(period = sPeriod)[offset];
def varlow = low(period = sPeriod)[offset];
def varopen = open(period = sPeriod)[offset];
def varclose = close(period = sPeriod)[offset];

def activeperiod = if SecondsFromTime(periodstart) >= 0 and SecondsTillTime(periodend) > 0 then yes else Double.NaN;
def acriveperiodstartbar = if SecondsFromTime(periodstart) == 0 then BarNumber() else acriveperiodstartbar[1];
def activeperiodendbar = fold i = 0 to AbsValue(BarNumber()) while !IsNaN(GetValue(activeperiod, -i)) do GetValue(BarNumber(), -i);
def activeperiodlength = 1 + (activeperiodendbar - acriveperiodstartbar);

def activeperiodhigh;
if SecondsFromTime(periodstart) == 0 {
    activeperiodhigh = high;
} else if !IsNaN(activeperiod) and high >= activeperiodhigh[1] {
    activeperiodhigh = high;
} else {
    activeperiodhigh = activeperiodhigh[1];
}

def activeperiodlow;
if SecondsFromTime(periodstart) == 0 {
    activeperiodlow = low;
} else if !IsNaN(activeperiod) and low <= activeperiodlow[1] {
    activeperiodlow = low;
} else {
    activeperiodlow = activeperiodlow[1];
}

def activephigh = fold iah = 0 to AbsValue(activeperiodlength) while !IsNaN(activeperiod) do GetValue(activeperiodhigh, -iah);
def activeplow = fold ial = 0 to AbsValue(activeperiodlength) while !IsNaN(activeperiod) do GetValue(activeperiodlow, -ial);
def aph = fold iaph = 0 to 1 while !IsNaN(close[10]) do activeperiodhigh;
def apl = fold iapl = 0 to 1 while !IsNaN(close[10]) do activeperiodlow;

plot PreHigh = if !IsNaN(activeperiod) and activephigh > 0 then activephigh else Double.NaN;
PreHigh.SetPaintingStrategy(PaintingStrategy.LINE);
PreHigh.SetStyle(Curve.LONG_DASH);
PreHigh.SetLineWeight(2);
PreHigh.SetDefaultColor(Color.GREEN);
PreHigh.SetHiding(!Show_PreMarket);

plot PreLow = if !IsNaN(activeperiod) and activeplow > 0 then activeplow else Double.NaN;
PreLow.SetPaintingStrategy(PaintingStrategy.LINE);
PreLow.SetStyle(Curve.LONG_DASH);
PreLow.SetLineWeight(2);
PreLow.SetDefaultColor(Color.RED);
PreLow.SetHiding(!Show_PreMarket);

plot PMHigh = if IsNaN(activeperiod) and aph > 0 then aph else Double.NaN;
PMHigh.SetPaintingStrategy(PaintingStrategy.LINE);
PMHigh.SetStyle(Curve.LONG_DASH);
PMHigh.SetLineWeight(2);
PMHigh.SetDefaultColor(Color.GREEN);
PMHigh.SetHiding(!Show_PreMarket);

plot PMLow = if IsNaN(activeperiod) and apl > 0 then apl else Double.NaN;
PMLow.SetPaintingStrategy(PaintingStrategy.LINE);
PMLow.SetStyle(Curve.LONG_DASH);
PMLow.SetLineWeight(2);
PMLow.SetDefaultColor(Color.RED);
PMLow.SetHiding(!Show_PreMarket);


AddChartBubble(Show_Bubbles and IsNaN(PreHigh[1]) and !IsNaN(PreHigh) and Show_PreMarket, PreHigh, "PMH", Color.WHITE, yes);
AddChartBubble(Show_Bubbles and IsNaN(PreLow[1]) and !IsNaN(PreLow) and Show_PreMarket, PreLow, "PML", Color.WHITE, no);
#
#
#Show Previous Day High and Low
input RTHbegin = 0930;
input RTHend   = 1559;
input Show_PreviousDay_High_and_Low = yes;
def pastOpen   = If((SecondsTillTime(RTHbegin) > 0), 0, 1);
def pastClose  = If((SecondsTillTime(RTHend) > 0), 0, 1);
def marketOpen = If(pastOpen and !pastClose, 1, 0);
def date       = GetYYYYMMDD();
def c = close;
def h = high;
def l = low;
def o = open;

#Highest High during RTH from Previous Day Determined
def begin      = CompoundValue(1, if GetDay() == GetDay()[1]
                 then if SecondsFromTime(RTHbegin) == 0
                 then h
                 else if h > begin[1] and marketOpen
                 then h
                 else begin[1]
                 else 0, begin[1]);
def beginbn    = if GetDay() == GetLastDay()
                 then 0
                 else if GetDay() == GetDay()[1]
                 then if h == begin and marketOpen
                 then BarNumber()
                 else beginbn[1]
                 else 0;
def beginprice = if GetDay() == GetDay()[1]
                 then if BarNumber() == HighestAll(beginbn)
                 then h
                 else beginprice[1]
                 else beginprice[1];

#Lowest Low During RTH from Previous Day Determined
def begin1      = CompoundValue(1, if GetDay() == GetDay()[1]
                 then if SecondsFromTime(RTHbegin) == 0
                 then l
                 else if l < begin1[1] and marketOpen
                 then l
                 else begin1[1]
                 else 0, l);
def beginbn1    = if GetDay() == GetLastDay()
                 then 0
                 else if l == begin1
                 then BarNumber()
                 else beginbn1[1];
def beginprice1 = if date == date[1]
                 then if BarNumber() == HighestAll(beginbn1)
                 then l
                 else beginprice1[1]
                 else beginprice1[1];


plot PDH = if GetDay() != GetLastDay() then Double.NaN else beginprice;
PDH.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PDH.SetLineWeight(2);
PDH.SetDefaultColor(Color.GREEN);
PDH.SetHiding(!Show_PreviousDay_High_and_Low);

plot PDL = if GetDay() != GetLastDay() then Double.NaN else beginprice1;
PDL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PDL.SetLineWeight(2);
PDL.SetDefaultColor(Color.RED);
PDL.SetHiding(!Show_PreviousDay_High_and_Low);

AddChartBubble(Show_Bubbles and IsNaN(PDH[1]) and !IsNaN(PDH) and Show_PreviousDay_High_and_Low, PDH, "PDH", Color.WHITE, yes);
AddChartBubble(Show_Bubbles and IsNaN(PDL[1]) and !IsNaN(PDL) and Show_PreviousDay_High_and_Low, PDL, "PDL", Color.WHITE, yes);
#
#
#Previous Close
input Show_Previous_Day_Close=yes;


def lastclose    = CompoundValue(1,
                   if SecondsTillTime(rthend)[1] > 0 and
                      SecondsTillTime(rthend) <= 0 or
                     (SecondsTillTime(rthend)[1] < SecondsTillTime(rthend) and
                      SecondsTillTime(rthend)[1] > 0)
                  then close
                  else lastclose[1], close);

def showlastcloseonly=no;
def bn           = barnumber();
def lastclosebn  = CompoundValue(1,
                   if SecondsTillTime(rthend)[1] > 0 and
                      SecondsTillTime(rthend) <= 0 or
                     (SecondsTillTime(rthend)[1] < SecondsTillTime(rthend) and
                      SecondsTillTime(rthend)[1] > 0)
                  then bn
                  else double.nan, bn);

plot PreviousDayClose = if showlastcloseonly and
             bn < highestall(lastclosebn)
          then double.nan
          else lastclose;
PreviousDayClose.SetPaintingStrategy(PaintingStrategy.line);
PreviousDayClose.SetStyle(Curve.SHORT_DASH);
PreviousDayClose.SetDefaultColor(Color.lIGHT_GRAY);
PreviousDayClose.SetLineWeight(2);
PreviousDayClose.SetHiding(!Show_Previous_Day_Close);

AddChartBubble(Show_Bubbles and IsNaN(PreviousDayClose[1]) and !IsNaN(PreviousDayClose) and Show_Previous_Day_Close, PreviousDayClose, "PDC", Color.WHITE, yes);
#
#
#Opening Price
input Show_Opening_Price = yes;
def MarketOpenPrice = if SecondsFromTime (0930) == 0 && SecondsTillTime(0930) == 0 then open else MarketOpenPrice[1];

plot Opening_Price = if SecondsFromTime (0930) >= 0 and SecondsFromTime(1559) <= 0 then MarketOpenPrice else Double.NaN;

Opening_Price.SetPaintingStrategy(PaintingStrategy.LINE);
Opening_Price.SetDefaultColor(ColOr.MAGENTA);
Opening_Price.SetStyle(Curve.MEDIUM_DASH);
Opening_Price.SetLineWeight(1);
Opening_Price.SetHiding(!Show_Opening_Price);

AddChartBubble(Show_Bubbles and IsNaN(Opening_Price[1]) and !IsNaN(Opening_Price) and Show_Opening_Price, Opening_Price, "Open", Color.WHITE, yes);
 
Might it be possible for someone to write a study that plotted a previous days time range (hi, lo, mid) as defined by the user, that would display on the current day from open to close? For example, the user defines a range from 1:00 to 2:00, and the hi, lo, and mid of that time range from the previous day displays throughout the current day? Thanks, Steven
 
Might it be possible for someone to write a study that plotted a previous days time range (hi, lo, mid) as defined by the user, that would display on the current day from open to close? For example, the user defines a range from 1:00 to 2:00, and the hi, lo, and mid of that time range from the previous day displays throughout the current day? Thanks, Steven
There’s already a script on here for that, use the search function, it’s only missing the mid. Search for “high/low” something like that
 
There’s already a script on here for that, use the search function, it’s only missing the mid. Search for “high/low” something like that
Thanks for your reply. I am looking for one that displays yesterdays levels throughout today. Instead of stopping the display of yesterday's range when today's range starts, I would like a script to display yesterday's range throughout the entire current day.
 
Thanks again. I have been using the plot in the link and it works nicely. The plot of the previous day ends when the script begins calculating the present day time frame. It would be great if the previous day time frame displayed throughout the current day, in addition to the current day's plot. So, a 9-10 AM plot would from both days would display throughout the day. It would be wonderful if a midpoint were included.
 
That was weird! restarted and now it's working correctly.

DayOpen and Day close are the previous day open/close.

PreHigh/Low actually controls the Timeframe High/Low lines (rather than being a separate PM indicator), and PreHigh/Low controls the extension of the Timeframe high/low lines. How are they dynamically set?

Sick code otherwise, thanks for sharing it!
 
Last edited:
Code works good would like to add code for show today only yes/no

#plots high and low of defined timeframe.
#Inputs for periodstart and periodend have to be start times for bars of the aggregation period used on chart.

input periodstart = 1515;
input periodend = 1600;
def activeperiod = If secondsFromTime(periodstart)>=0 and secondsTillTime(periodend)>0 then yes else Double.NaN;
def acriveperiodstartbar = if secondsFromTime(periodstart)==0 then barnumber() else acriveperiodstartbar[1];
def activeperiodendbar = fold i=0 to AbsValue(BarNumber()) while !IsNaN(GetValue(activeperiod,-i)) do GetValue(BarNumber(),-i);
def activeperiodlength = 1+(activeperiodendbar-acriveperiodstartbar);

def activeperiodhigh;
if secondsFromTime(periodstart)==0 {
activeperiodhigh = high;
}else if !IsNaN(activeperiod) and high>=activeperiodhigh[1]{
activeperiodhigh = high;
}else{
activeperiodhigh = activeperiodhigh[1];}

def activeperiodlow;
if secondsFromTime(periodstart)==0 {
activeperiodlow = low;
}else if !IsNaN(activeperiod) and low<=activeperiodlow[1]{
activeperiodlow = low;
}else{
activeperiodlow = activeperiodlow[1];}

def activephigh = fold iah=0 to AbsValue(activeperiodlength) while !IsNaN(activeperiod) do GetValue(activeperiodhigh,-iah);
def activeplow = fold ial=0 to AbsValue(activeperiodlength) while !IsNaN(activeperiod) do GetValue(activeperiodlow,-ial);
def aph = fold iaph = 0 to 1 while !IsNaN(close[10]) do activeperiodhigh;
def apl = fold iapl = 0 to 1 while !IsNaN(close[10]) do activeperiodlow;

plot ActiveHigh = if !IsNaN(activeperiod) and activephigh>0 then activephigh else Double.NaN;
ActiveHigh.SetPaintingStrategy(PaintingStrategy.LINE);
ActiveHigh.SetDefaultColor(Color.LIME);

plot ActiveLow = if !IsNaN(activeperiod) and activeplow>0 then activeplow else Double.NaN;
ActiveLow.SetPaintingStrategy(PaintingStrategy.LINE);
ActiveLow.SetDefaultColor(Color.PINK);

plot APHigh = if IsNaN(activeperiod) and aph>0 then aph else Double.NaN;
APHigh.SetPaintingStrategy(PaintingStrategy.DASHES);
APHigh.SetDefaultColor(Color.LIME);

plot APLow = if IsNaN(activeperiod) and apl>0 then apl else Double.NaN;
APLow.SetPaintingStrategy(PaintingStrategy.DASHES);
APLow.SetDefaultColor(Color.PINK);

AddCloud(ActiveHigh,ActiveLow,color.LIGHT_GRAY,color.LIGHT_GRAY);
 
Can anyone help to make a change to the below code to make labels optional, because when I go to different time frames the labels cover the candles.


#Shows previous days High, Low, Open, Close, and High/Low of defined timeframe defaulted to premarket hours.
#Code by Svanoy

input Show_High = No;
input Show_Low = No;
input Show_Open = No;
input Show_Close = Yes;
input Show_Premarket_High_and_Low = No;

input sPeriod = {default DAY};
def offset = 1;

def Today = if GetDay()==GetLastDay() then 1 else 0;
def varhigh = high(period = sPeriod)[offset];
def varlow = low(period = sPeriod)[offset];
def varopen = open(period = sPeriod)[offset];
def varclose = close(period = sPeriod)[offset];
def periodstart = 0400;
def periodend = 0930;
def activeperiod = If secondsFromTime(periodstart)>=0 and secondsTillTime(periodend)>0 then yes else Double.NaN;
def acriveperiodstartbar = if secondsFromTime(periodstart)==0 then barnumber() else acriveperiodstartbar[1];
def activeperiodendbar = fold i=0 to AbsValue(BarNumber()) while !IsNaN(GetValue(activeperiod,-i)) do GetValue(BarNumber(),-i);
def activeperiodlength = 1+(activeperiodendbar-acriveperiodstartbar);

def activeperiodhigh;
if secondsFromTime(periodstart)==0 {
activeperiodhigh = high;
}else if !IsNaN(activeperiod) and high>=activeperiodhigh[1]{
activeperiodhigh = high;
}else{
activeperiodhigh = activeperiodhigh[1];}

def activeperiodlow;
if secondsFromTime(periodstart)==0 {
activeperiodlow = low;
}else if !IsNaN(activeperiod) and low<=activeperiodlow[1]{
activeperiodlow = low;
}else{
activeperiodlow = activeperiodlow[1];}

def activephigh = fold iah=0 to AbsValue(activeperiodlength) while !IsNaN(activeperiod) do GetValue(activeperiodhigh,-iah);
def activeplow = fold ial=0 to AbsValue(activeperiodlength) while !IsNaN(activeperiod) do GetValue(activeperiodlow,-ial);
def aph = fold iaph = 0 to 1 while !IsNaN(close[10]) do activeperiodhigh;
def apl = fold iapl = 0 to 1 while !IsNaN(close[10]) do activeperiodlow;
def h = fold ih = 0 to 1 while !IsNaN(close[10]) do varhigh;
def l = fold il = 0 to 1 while !IsNaN(close[10]) do varlow;
def o = fold io = 0 to 1 while !IsNaN(close[10]) do varopen;
def c = fold ic = 0 to 1 while !IsNaN(close[10]) do varclose;

plot PreHigh = if !IsNaN(activeperiod) and activephigh>0 then activephigh else Double.NaN;
PreHigh.SetPaintingStrategy(PaintingStrategy.LINE);
PreHigh.SetDefaultColor(Color.LIME);
PreHigh.SetHiding(!Show_Premarket_High_and_Low);

plot PreLow = if !IsNaN(activeperiod) and activeplow>0 then activeplow else Double.NaN;
PreLow.SetPaintingStrategy(PaintingStrategy.LINE);
PreLow.SetDefaultColor(Color.PINK);
PreLow.SetHiding(!Show_Premarket_High_and_Low);

plot PMHigh = if IsNaN(activeperiod) and aph>0 then aph else Double.NaN;
PMHigh.SetPaintingStrategy(PaintingStrategy.DASHES);
PMHigh.SetDefaultColor(Color.LIME);
PMHigh.SetHiding(!Show_Premarket_High_and_Low);

plot PMLow = if IsNaN(activeperiod) and apl>0 then apl else Double.NaN;
PMLow.SetPaintingStrategy(PaintingStrategy.DASHES);
PMLow.SetDefaultColor(Color.PINK);
PreLow.SetHiding(!Show_Premarket_High_and_Low);

plot DayHigh = if h > 1 then h else Double.NaN;
DayHigh.SetPaintingStrategy(PaintingStrategy.DASHES);
DayHigh.SetDefaultColor(Color.LIGHT_GREEN);
DayHigh.SetHiding(!Show_High);

plot DayLow = if l > 1 then l else Double.NaN;
DayLow.SetPaintingStrategy(PaintingStrategy.DASHES);
DayLow.SetDefaultColor(Color.LIGHT_RED);
DayLow.SetHiding(!Show_Low);

plot DayOpen = if o > 1 then o else Double.NaN;
DayOpen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DayOpen.AssignValueColor(if varopen >= varclose then Color.GREEN else Color.RED);
DayOpen.SetHiding(!Show_Open);

plot DayClose = if c > 1 then c else Double.NaN;
DayClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DayClose.AssignValueColor(if varopen >= varclose then Color.RED else Color.GREEN);
DayClose.SetHiding(!Show_Close);

AddChartBubble(IsNaN(PreHigh[1]) and !IsNaN(PreHigh) and Show_Premarket_High_and_Low,PreHigh,"PreMarket High",Color.WHITE,yes);
AddChartBubble(IsNaN(PreLow[1]) and !IsNaN(PreLow) and Show_Premarket_High_and_Low,PreLow,"PreMarketLow",Color.WHITE,no);
AddChartBubble(DayHigh!=DayHigh[1] and !IsNaN(close) and Show_High,h,"PrevDayHigh",Color.WHITE,yes);
AddChartBubble(DayLow!=DayLow[1] and !IsNaN(close)and Show_Low,l,"PrevDayLow",Color.WHITE,no);
AddChartBubble(DayOpen!=DayOpen[1] and !IsNaN(close) and Show_Open,o,"PrevDayOpen",Color.WHITE,if o>=c then yes else no);
AddChartBubble(DayClose!=DayClose[1] and !IsNaN(close) and Show_Close,c,"PrevDayClose",Color.WHITE, if o>=c then no else yes);

AddCloud(if Show_Premarket_High_and_Low then PreHigh else Double.NEGATIVE_INFINITY,if Show_Premarket_High_and_Low then PreLow else Double.NEGATIVE_INFINITY,color.LIGHT_GRAY,color.LIGHT_GRAY);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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