Opening Range Breakout Indicator for ThinkorSwim

O

Orly

New member
Thank You Sir! This is a huge help for me as Im struggling with my entry and exits. Thank you again. Hope to be a vip member in the near future.
 
J

jan_angel

New member
2019 Donor
@BenTen Hi. Thanks for this indicator. I have been using this for sometime with a good success rate. How do I turn off alerts that are received in the main message center window? I dont mind the sound alerts.

Thanks
 
BenTen

BenTen

Administrative
Staff
VIP
@jan_angel It's located under the indicator's settings. Switch Alerts from Yes to No.
 
D

dmillz

New member
@BenTen How do you get rid of the bubbles "2ndt" 3rdT... etc. They were getting in the way of the day trades today
 
J

jan_angel

New member
2019 Donor
@jan_angel It's located under the indicator's settings. Switch Alerts from Yes to No.
I did change the AlertOn feature to no, but i am still seeing alerts. I dont know how to attach picture with URL...is there a way I can just insert picture?
 
BenTen

BenTen

Administrative
Staff
VIP
@jan_angel If you click on the Message Center tab, you will see the specific alert and where it's coming from. See this thread if you need help adding pictures.
 
J

jan_angel

New member
2019 Donor




Hi @BenTen - thanks for the link on uploading pics. Attached are two pics. The first one is where I have set the AlertOn to No, and the second one is example of alert that keeps popping in message center.
 
Last edited by a moderator:
D

dmillz

New member
Show Bubble When unchecked doesnt work. Sucks gets in the way when day trading so i removed AddChartBubble(Bubbleloc1, Htarget5, "5th T", Color.PLUM, if c > Htarget5 then no else yes); Etc. Incase anyone else day trades
 
A

apmerf

New member
VIP
I tried playing SPY today, waited for candlestick to close into breakdown zone on 5min and bought put options... which the chart promptly reversed and marched up all day. An expensive lesson needless to say. Does anyone know the context/intention for the RiskON ORH line? Thanks.
 
BenTen

BenTen

Administrative
Staff
VIP
@apmerf Take a look at this comment here.

From my experience, ORB on the indices barely works. I would use ORB on individual stocks.
 
K

Kingjep12

New member
@apmerf Take a look at this comment here.

From my experience, ORB on the indices barely works. I would use ORB on individual stocks.
hey ben, i tried to dowlaod it to my thinkorswim, but all i see is lines and i can't see my chart. any suggestion? thanks
 
G

Gabrielx77

Member
Hey @BenTen, I cleaned up the script a little bit since I didn't need everything on it personally, but maybe you can help me with something.

1. The script only works and shows the lines on the 1 min and 5 min chart, but not on the 15 min. Is there something I'm missing within the script for it to also work on the 15m chart?

2. I only want the first two "High Profit Targets", but the levels are not actually accurate when it comes to the 1:1 and 2:1 RR (by percentage). So if the range of the first 15 min is 10%, my 1st profit target line shows only 8% and my second line shows 16%. I don't know why it does that. Anyway I can make them plot the exact ratio for the 1:1 and 2:1 RR that I need?

Here's the script I have.

Code:
# Opening_Range_Breakout Strategy with Risk and Target Lines

declare hide_on_daily;
declare once_per_bar;
input OrMeanS  = 0930.0; #hint OrMeanS: Begin Mean Period. Usually Market Open EST.
input OrMeanE  = 0935.0; #hint OrMeanE: End Mean period. Usually End of first bar.
input OrBegin  = 0930.0; #hint OrBegin: Beginning for Period of Opening Range Breakout.
input OrEnd    = 1000.0; #hint OrEnd: End of Period of Opening Range Breakout.
input RthEnd   = 1600;
input CloudOn  = no;     #hint CloudOn: Clouds Opening Range.
input AlertOn  = yes;    #hint AlertOn: Alerts on cross of Opening Range.
input ShowTodayOnly = yes;
input nAtr = 4;          #hint nATR: Lenght for the ATR Risk and Target Lines.
input AtrTargetMult = 2.0;#hint ATRmult: Multiplier for the ATR calculations.
input InitialRisk = 1.00; #hint InitialRisk: Amount of Risk your will to take opening a trade.
input ShowTargetBubbles = yes;

def h = high;
def l = low;
def c = close;
def bar = BarNumber();
def na = Double.NaN;
def TS = TickSize();
def BubbleX = bar == HighestAll(bar);
def s = ShowTodayOnly;
def Agg = GetAggregationPeriod() / 1000 / 60;
def RTH = if SecondsFromTime(0930) >= 0 and
               SecondsFromTime(1600) >= 0
            then 1
            else 0;
def RTHbar1 = if RTH and !RTH[1]
                then bar
                else na;
def ORActive = if SecondsTillTime(OrMeanE) > 0 and
                    SecondsFromTime(OrMeanS) >= 0
                 then 1
                 else 0;
def today = if s == 0
              or GetDay() == GetLastDay() and
                 SecondsFromTime(OrMeanS) >= 0
              then 1
              else 0;
def ORHigh = if ORHigh[1] == 0
               or ORActive[1] == 0 and
                  ORActive == 1
               then h
               else if ORActive and
                       h > ORHigh[1]
               then h
               else ORHigh[1];
def ORLow = if ORLow[1] == 0
              or ORActive[1] == 0 and
                 ORActive == 1
              then l
              else if ORActive and
                      l < ORLow[1]
              then l
              else ORLow[1];
def ORWidth = ORHigh - ORLow;
def ORHA = if ORActive
             or today < 1
             then na
             else ORHigh;
def ORLA = if ORActive
             or today < 1
             then na
             else ORLow;
def O = ORHA - Round(((ORHA - ORLA) / 2) / TS, 0) * TS;
def ORActive2 = if SecondsTillTime(OrEnd) > 0 and
                     SecondsFromTime(OrBegin) >= 0
                  then 1
                  else 0;
def ORHigh2 = if ORHigh2[1] == 0
                  or ORActive2[1] == 0 and
                     ORActive2 == 1
                then h
                else if ORActive2 and
                        h > ORHigh2[1]
                then h
                else ORHigh2[1];
def ORLow2 = if ORLow2[1] == 0
                or ORActive2[1] == 0 and
                   ORActive2 == 1
               then l
               else if ORActive2 and
                       l < ORLow2[1]
               then l
               else ORLow2[1];
def ORWidth2 = ORHigh2 - ORLow2;
def TimeLine = if SecondsTillTime(OrEnd) == 0
                 then 1
                 else 0;
def ORmeanBar = if !ORActive and ORActive[1]
                  then bar
                  else ORmeanBar[1];
def ORendBar = if !ORActive2 and ORActive2[1]
                 then bar
                 else ORendBar[1];

def ORH2 = if ORActive2
             or today < 1
             then na
             else ORHigh2;
plot ORH2ext = if ShowTodayOnly and bar >= HighestAll(ORendBar)
               then HighestAll(if IsNaN(c[-1])
                               then ORH2[1]
                               else na)
               else if !ShowTodayOnly
                    then ORH2
               else na;
ORH2ext.SetDefaultColor(Color.GREEN);
ORH2ext.SetStyle(Curve.LONG_DASH);
ORH2ext.SetLineWeight(3);
ORH2ext.HideTitle();


def ORL2 = if ORActive2
               or today < 1
             then na
             else ORLow2;
plot ORL2ext = if BarNumber() >= HighestAll(ORendBar)
               then HighestAll(if IsNaN(c[-1])
                               then ORL2[1]
                               else Double.NaN)
               else Double.NaN;
ORL2ext.SetDefaultColor(Color.RED);
ORL2ext.SetStyle(Curve.LONG_DASH);
ORL2ext.SetLineWeight(3);
ORL2ext.HideTitle();

def Bubbleloc1 = isNaN(close[-1]);
  def BreakoutBar = if ORActive
                    then double.nan
                    else if !ORActive and c crosses above ORH2
                         then bar
                         else if !isNaN(BreakoutBar[1]) and c crosses ORH2
                              then BreakoutBar[1]
                    else BreakoutBar[1];
  def ATR = if ORActive2
  then Round((Average(TrueRange(h, c, l), nATR)) / TickSize(), 0) * TickSize()
  else ATR[1];
  def cond1 =  if h > ORH2 and
                  h[1] <= ORH2
               then Round((ORH2  + (ATR * AtrTargetMult)) / TickSize(), 0) * TickSize()
               else cond1[1];
  def crossUpBar = if close crosses above ORH2
                   then bar
                   else double.nan;


# High Targets
plot Htarget = if bar >= HighestAll(ORendBar)
               then HighestAll(cond1)
               else na;
Htarget.SetLineWeight(1);
Htarget.SetDefaultColor(Color.WHITE);
Htarget.HideTitle();
AddChartBubble(ShowTargetBubbles and BubbleLoc1, cond1, "1:1", Color.WHITE, if c > Htarget then no else yes);
def condHtarget2 = if h crosses above cond1
  then Round((cond1 + (ATR * AtrTargetMult)) / TS, 0) * TS
  else condHtarget2[1];
plot Htarget2 = if bar >= HighestAll(ORendBar) #BreakoutBar
                then  HighestAll(if IsNaN(c[-1])
                                 then condHtarget2
                                 else na)
                else na;
Htarget2.SetLineWeight(1);
Htarget2.SetDefaultColor(Color.WHITE);
Htarget2.HideTitle();
AddChartBubble(ShowTargetBubbles and BubbleLoc1, condHtarget2, "2:1", Color.WHITE, if c > Htarget2
                                                          then no
                                                          else yes);

# End Code ORB VO3(B)
 
BenTen

BenTen

Administrative
Staff
VIP
@Gabrielx77 The script from this post is fairly enhanced. If you just want the ORB to be displayed, I would use the version from here.
 
K

Kingjep12

New member
hi ben, i am trying to download this but im having a hard time. all i see is thick lines and can't see my chart. any suggestion?
 
G

Gabrielx77

Member
@Gabrielx77 The script from this post is fairly enhanced. If you just want the ORB to be displayed, I would use the version from here.
I do, but I'd also like to see a 1:1 profit target high line along with plotting the 15 min. Opening Range. In the link you sent, it doesn't have that.
 
BenTen

BenTen

Administrative
Staff
VIP
@Kingjep12 Look at the simplified version in post #355
 
P

Pensar

Member
VIP
@Kingjep12 Also, you might try unchecking "Fit Studies" in the Chart Settings. The ORB I use does not plot correctly if "Fit Studies" is checked.
 
N

Newbie_1

New member
I am new here and love this indicator. Could you guys tell me how does it take to scan? it's been 20 mins and keep running.
 
Top