Opening Range (ORB) Watchlist Column for ThinkorSwim

Hey all... I love these scripts and thank you for them! I was curious if there was an alert that can be added for when the stocks switch from inside to above?
 

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

Hi All

I had added Opening Range (ORB) Watchlist Column for ThinkorSwim to my TOS. it works perfect but I need a little bit of upgrade help

ORB watchlist showed current price whether it's above, in, or below the ORB.
But is there anyway we can add the ORB Highest/Lowest price to the watchlist? So I will be able to see how far my ticker will breakout/breakdown from the ORB from the Watchlist instead of the chart.
 
@vince92615 Here you go:

Plot value of opening range high:

Code:
# ORB Watch List Column
input StartTime = 0930;
input EndTime = 1000;
def h = high;
def l = low;
def c = close;
def ORActive = if SecondsFromTime(StartTime) > 0 and
                   SecondsTillTime(EndTime) >= 0
                then 1
                else 0;
def ORH = if ORActive and !ORActive[1]
           then h
           else if ORActive and
                   h > ORH[1]
                then h
                else ORH[1];
def ORL = if ORActive and !ORActive[1]
           then l
           else if ORActive and
                   l < ORL[1]
                then l
                else ORL[1];
def ORhigh = if !ORActive
              then ORH
               else Double.NaN;
def ORlow = if !ORActive
              then ORL
              else Double.NaN;
plot OR_high = ORH;

Plot value of opening range low:

Code:
# ORB Watch List Column
input StartTime = 0930;
input EndTime = 1000;
def h = high;
def l = low;
def c = close;
def ORActive = if SecondsFromTime(StartTime) > 0 and
                   SecondsTillTime(EndTime) >= 0
                then 1
                else 0;
def ORH = if ORActive and !ORActive[1]
           then h
           else if ORActive and
                   h > ORH[1]
                then h
                else ORH[1];
def ORL = if ORActive and !ORActive[1]
           then l
           else if ORActive and
                   l < ORL[1]
                then l
                else ORL[1];
def ORhigh = if !ORActive
              then ORH
               else Double.NaN;
def ORlow = if !ORActive
              then ORL
              else Double.NaN;
plot OR_low = ORL;
 
@vince92615 Here you go:

Plot value of opening range high:

Code:
# ORB Watch List Column
input StartTime = 0930;
input EndTime = 1000;
def h = high;
def l = low;
def c = close;
def ORActive = if SecondsFromTime(StartTime) > 0 and
                   SecondsTillTime(EndTime) >= 0
                then 1
                else 0;
def ORH = if ORActive and !ORActive[1]
           then h
           else if ORActive and
                   h > ORH[1]
                then h
                else ORH[1];
def ORL = if ORActive and !ORActive[1]
           then l
           else if ORActive and
                   l < ORL[1]
                then l
                else ORL[1];
def ORhigh = if !ORActive
              then ORH
               else Double.NaN;
def ORlow = if !ORActive
              then ORL
              else Double.NaN;
plot OR_high = ORH;

Plot value of opening range low:

Code:
# ORB Watch List Column
input StartTime = 0930;
input EndTime = 1000;
def h = high;
def l = low;
def c = close;
def ORActive = if SecondsFromTime(StartTime) > 0 and
                   SecondsTillTime(EndTime) >= 0
                then 1
                else 0;
def ORH = if ORActive and !ORActive[1]
           then h
           else if ORActive and
                   h > ORH[1]
                then h
                else ORH[1];
def ORL = if ORActive and !ORActive[1]
           then l
           else if ORActive and
                   l < ORL[1]
                then l
                else ORL[1];
def ORhigh = if !ORActive
              then ORH
               else Double.NaN;
def ORlow = if !ORActive
              then ORL
              else Double.NaN;
plot OR_low = ORL;
Nice ! Thank you so much
On top of this , is there anyway can add alert ? So when price breakdown or breakout from the ORB H/L, we can know them immediately

again, thank you
 
@vince92615 Yes. You need to set up a scanner for your ORB indicator and then save it as a watchlist. From there, you have the option to get alerted when the results in that watchlist changes.
 
I played with some code to get some better OR info into watchlists, thought maybe it'd help someone else. I always seem to be missing OR breaks and am hoping this helps to anticipate them and pull up a chart/ prepare trade.

The first is the % change required to break the OR - either up or down depending on which side of the middle the stock is currently sitting.

The second is how close it is to breaking it on a comparable basis. ie: 0.9 => 90% of the way to breaking the range. These only show up when >50%.

mOtQgBy.png


Code:
    # ORB Watch List Column - % move to B/O
input StartTime = 0930;
input EndTime = 0945;
def h = high;
def l = low;
def c = close;
def ORActive = if SecondsFromTime(StartTime) > 0 and
                   SecondsTillTime(EndTime) >= 0
                then 1
                else 0;
def ORH = if ORActive and !ORActive[1]
           then h
           else if ORActive and
                   h > ORH[1]
                then h
                else ORH[1];
def ORL = if ORActive and !ORActive[1]
           then l
           else if ORActive and
                   l < ORL[1]
                then l
                else ORL[1];
def ORhigh = if !ORActive
              then ORH
               else Double.NaN;
def ORlow = if !ORActive
              then ORL
              else Double.NaN;

def ORMid = if !ORActive
               then (ORHigh + ORLow) / 2
               else Double.NaN;

def ORRange = if !ORActive
                then ORHigh - ORLow
                else Double.NaN;

AddLabel(1, 
if (close < ORMid) and (close > ORLow) then "-" + astext(round((close - ORLow) / close * 100,2))+"%"
    else if (close >= ORMid) and (close < ORHigh) then "+" + astext(round((ORHigh - close) / close * 100,2)) + "%"
    else "-",

if close > ORHigh or close < ORLow then color.white
    else if (close >= ORMid) and (close < ORHigh) then color.green
    else if (close < ORMid) and (close > ORLow) < ORlow then color.red
    else color.white
);


Code:
# ORB Watch List Column - near B/O
input StartTime = 0930;
input EndTime = 0945;
def h = high;
def l = low;
def c = close;
def ORActive = if SecondsFromTime(StartTime) > 0 and
                   SecondsTillTime(EndTime) >= 0
                then 1
                else 0;
def ORH = if ORActive and !ORActive[1]
           then h
           else if ORActive and
                   h > ORH[1]
                then h
                else ORH[1];
def ORL = if ORActive and !ORActive[1]
           then l
           else if ORActive and
                   l < ORL[1]
                then l
                else ORL[1];
def ORhigh = if !ORActive
              then ORH
               else Double.NaN;
def ORlow = if !ORActive
              then ORL
              else Double.NaN;

def ORMid = if !ORActive
               then (ORHigh + ORLow) / 2
               else Double.NaN;

def ORRange = if !ORActive
                then ORHigh - ORLow
                else Double.NaN;

AddLabel(1,

    if close >= ORMid and close <ORHigh and 1 - round((ORHigh - close) / (ORHigh - ORMid),1) >= 0.6 then astext(1 - round((ORHigh - close) / (ORHigh - ORMid),1))
    else if close < ORMid and close >ORLow and round((ORMid - close) / (ORMid - ORLow),1) >= 0.5 then astext(round((ORMid - close) / (ORMid - ORLow),1))
    else "-"
);
 
Last edited:
I played with some code to get some better OR info into watchlists, thought maybe it'd help someone else. I always seem to be missing OR breaks and am hoping this helps to anticipate them and pull up a chart/ prepare trade.
...
This is only for long. I like to play for long from mid opening range or from second try, I have noticed if it hits the first T-1 and then does not reach it again, it's a good chance it will go to T2 or T3 to the upside. Then you also have the down side.
 
This is only for long. I like to play for long from mid opening range or from second try, I have noticed if it hits the first T-1 and then does not reach it again, it's a good chance it will go to T2 or T3 to the upside. Then you also have the down side.

Interesting - so you wait for a mid break with stop at opening low? Similar idea to high break with stop at mid. From my limited experience most will hit a 2:1 RR but I'll have to keep yours in mind.
 
Greetings, Unfortunately I have used my all available Custom quotes in TOS. Now unable to add any new watch list columns due to it. Would appreciate any input about fixing.
 
@Falconaimc You can still import someone's else column and use it. You can find the ORB watchlist columns on the first page of this thread.
 
I played with some code to get some better OR info into watchlists, thought maybe it'd help someone else. I always seem to be missing OR breaks and am hoping this helps to anticipate them and pull up a chart/ prepare trade.

The first is the % change required to break the OR - either up or down depending on which side of the middle the stock is currently sitting.

The second is how close it is to breaking it on a comparable basis. ie: 0.9 => 90% of the way to breaking the range. These only show up when >50%.

mOtQgBy.png


Code:
    # ORB Watch List Column - % move to B/O
input StartTime = 0930;
input EndTime = 0945;
def h = high;
def l = low;
def c = close;
def ORActive = if SecondsFromTime(StartTime) > 0 and
                   SecondsTillTime(EndTime) >= 0
                then 1
                else 0;
def ORH = if ORActive and !ORActive[1]
           then h
           else if ORActive and
                   h > ORH[1]
                then h
                else ORH[1];
def ORL = if ORActive and !ORActive[1]
           then l
           else if ORActive and
                   l < ORL[1]
                then l
                else ORL[1];
def ORhigh = if !ORActive
              then ORH
               else Double.NaN;
def ORlow = if !ORActive
              then ORL
              else Double.NaN;

def ORMid = if !ORActive
               then (ORHigh + ORLow) / 2
               else Double.NaN;

def ORRange = if !ORActive
                then ORHigh - ORLow
                else Double.NaN;

AddLabel(1,
if (close < ORMid) and (close > ORLow) then "-" + astext(round((close - ORLow) / close * 100,2))+"%"
    else if (close >= ORMid) and (close < ORHigh) then "+" + astext(round((ORHigh - close) / close * 100,2)) + "%"
    else "-",

if close > ORHigh or close < ORLow then color.white
    else if (close >= ORMid) and (close < ORHigh) then color.green
    else if (close < ORMid) and (close > ORLow) < ORlow then color.red
    else color.white
);


Code:
# ORB Watch List Column - near B/O
input StartTime = 0930;
input EndTime = 0945;
def h = high;
def l = low;
def c = close;
def ORActive = if SecondsFromTime(StartTime) > 0 and
                   SecondsTillTime(EndTime) >= 0
                then 1
                else 0;
def ORH = if ORActive and !ORActive[1]
           then h
           else if ORActive and
                   h > ORH[1]
                then h
                else ORH[1];
def ORL = if ORActive and !ORActive[1]
           then l
           else if ORActive and
                   l < ORL[1]
                then l
                else ORL[1];
def ORhigh = if !ORActive
              then ORH
               else Double.NaN;
def ORlow = if !ORActive
              then ORL
              else Double.NaN;

def ORMid = if !ORActive
               then (ORHigh + ORLow) / 2
               else Double.NaN;

def ORRange = if !ORActive
                then ORHigh - ORLow
                else Double.NaN;

AddLabel(1,

    if close >= ORMid and close <ORHigh and 1 - round((ORHigh - close) / (ORHigh - ORMid),1) >= 0.6 then astext(1 - round((ORHigh - close) / (ORHigh - ORMid),1))
    else if close < ORMid and close >ORLow and round((ORMid - close) / (ORMid - ORLow),1) >= 0.5 then astext(round((ORMid - close) / (ORMid - ORLow),1))
    else "-"
);
I tried to add these script to my watchlist column but they are both blank. Any help would be appreciated.
 
I used @fredcolclough idea to add an "upper range" to the breakout zone. Here is the study and scanner. I'm not getting many results on my scanner, is this due to TOS limitations on it's scanning power? Does anyone have recommendations on simplifying either my study or scanner so TOS finds more results?

Code:
# ORB Watch List Column - near B/O
input StartTime = 0929;
input EndTime = 1000;
input CloudOn  = yes;     #hint CloudOn: Clouds Opening Range.
def h = high;
def l = low;
def c = close;
def ORActive = if SecondsFromTime(StartTime) > 0 and
                   SecondsTillTime(EndTime) >= 0
                then 1
                else 0;
def ORH = if ORActive and !ORActive[1]
           then h
           else if ORActive and
                   h > ORH[1]
                then h
                else ORH[1];
def ORL = if ORActive and !ORActive[1]
           then l
           else if ORActive and
                   l < ORL[1]
                then l
                else ORL[1];
def ORhigh = if !ORActive
              then ORH
               else Double.NaN;
def ORlow = if !ORActive
              then ORL
              else Double.NaN;

def ORMid = if !ORActive
               then (ORhigh + ORlow) / 2
               else Double.NaN;

def ORRange = if !ORActive
                then ORhigh - ORlow
                else Double.NaN;

def ORL3 = if !ORActive
              then ORL
              else Double.NaN;



plot ORh2 = ORhigh;
plot ORl2 = ORlow;
plot ORm1 = (ORhigh + ORlow) / 2;
plot ORU = (ORhigh + ORmid) / 2;

addCloud(if CloudOn == yes
         then ORu
         else double.nan
        , orm1,createColor(66,244,131), createColor(66,244,131));
addCloud(if CloudOn == yes
         then orh2
         else double.nan
        , ORu,createColor(238,130,238), createColor(238,130,238));
addCloud(if CloudOn == yes
         then orl3
         else double.nan
,orm1,createColor(244,83,66), createColor(244,83,66));

Scanner
https://tos.mx/sTKfsby
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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