Opening Range Breakout (ORB) Scanner for ThinkorSwim

markos

markos

Well-known member
VIP
@tomsk @BLT does the "rec" in some off the rows still work as they once did?
 
T

tomsk

Well-known member
VIP
@markos You can now use def in place of rec, although rec is still recognized by the TOS editor. Usually you will find rec being used in legacy studies. It is an easy conversion
 
T

tdao24

New member
Thank you very much for this scanner. one question, this scanner has alert, wondering what type of alert. is there a way i could setup alert to phone via push or text? Thank you very much in advance.
 
BenTen

BenTen

Administrative
Staff
VIP
@tdao24 I believe when you use the "Alert when scan results change..." option it will send push notifications to your phone as well.
 
T

tdao24

New member
@tdao24 I believe when you use the "Alert when scan results change..." option it will send push notifications to your phone as well.
Thank you very much BenTen.
was playing with it and kindda missing something.
i use the following for scanner, and it came back only the above OR, nothing below OR. would you please advise what i am missing? Thank you very much in advance.
Code:
# 30 min opening range
# Robert Payne
# WalkingBallista Watchlist

def OpenRangeMinutes = 30;
def MarketOpenTime = 0930;
input ShowTodayOnly = yes;

def Today = if GetDay() == GetLastDay() then 1 else 0;
def FirstMinute = if SecondsFromTime(MarketOpenTime) < 60 then 1 else 0;
def OpenRangeTime = if SecondsFromTime(MarketOpenTime) < 60 * OpenRangeMinutes then 1 else 0;

def ORHigh =  if FirstMinute then high else if OpenRangeTime and high > ORHigh[1] then high else ORHigh[1];
def ORLow = if FirstMinute then low else if OpenRangeTime and low < ORLow[1] then low else ORLow[1];

def OpenRangeHigh = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORHigh else Double.NaN;
def OpenRangeLow = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORLow else Double.NaN;

def dailyRange = high(period = "day" )[1] - low(period = "day" )[1];
def range = Average(dailyRange, 10);

plot status = if close > OpenRangeHigh then 1 else if close < OpenRangeLow then 0 else -1;
status.AssignValueColor(if status == 1 then Color.Dark_Green else if status == 0 then Color.Dark_Red else Color.Dark_Orange);
AssignBackgroundCOlor(if status == 1 then Color.Dark_Green else if status == 0 then Color.Dark_Red else Color.Dark_Orange);
 
T

tdao24

New member
@tdao24 Did you try the one from this thread?
you meant the thread on page 1 of this thread? if so i will give a shot. BTW, it's pretty long compare the the previous one, or the one i posted. Plus what does it mean when condition is any within 2 bars ORL2 and ORH2?
Thank you very much again.
 
O

OldBallz

New member
2019 Donor
link : ORB V03_B

Can anyone assist in the creation of a scan that feeds of this indicator? Only want those stocks actually breaking out of the range ( i use 20 minutes) . Other parameters are RVOL @1.5 / Range >.30 ... the rest i can find in existing studies. Happy to post the final scan link once done ....
 
Last edited by a moderator:
T

tomsk

Well-known member
VIP
@OldBallz Here is your breakout scan using 20 minutes per your request

Code:
# Opening Range Breakout - UP
# Highest and Best use for this scan is as a Dynamic WatchList
# Scan Resets Every Day
# Set Aggregation Period to 5 minutes or less 
# Mobius
# 4.8.2019
# Scan

def Active = if SecondsFromTime(0930) > 0 and
                SecondsTillTime(0950) >= 0
             then 1
             else 0;
def ActiveHigh = if Active and !Active[1]
                 then high
                 else if Active and
                         high > ActiveHigh[1]
                       then high
                       else ActiveHigh[1];
plot Breakout = if !Active and close > ActiveHigh
                then 1
                else 0;
 
O

OldBallz

New member
2019 Donor
@tomsk thank you - Actually i know how to change time parameters - what i really need to make this a useful scan is only showing stocks where the current Relative Volume is X (i will use 1.5) and the current range is Y (let say $.30) but i dont know how to get to those data sets.

Can anyone help with that?

Thank you !
 
H

HighBredCloud

Well-known member
VIP
@tomsk What would you need to change in post #91 for a bear scan? Like what I put below? Thank you!

Code:
# Opening Range Breakdown - DOWN
# Highest and Best use for this scan is as a Dynamic WatchList
# Scan Resets Every Day
# Set Aggregation Period to 5 minutes or less
# Mobius
# 4.8.2019
# Scan

def Active = if SecondsFromTime(0930) < 0 and
                SecondsTillTime(0950) <= 0
             then 1
             else 0;
def ActiveLow = if Active and !Active[1]
                 then low
                 else if Active and
                         low < ActiveLow[1]
                       then low
                       else ActiveLow[1];
plot Breakdown = if !Active and close < ActiveLow
                then 1
                else 0;
 
Last edited:
H

HighBredCloud

Well-known member
VIP
@tomsk never mind...I just saw your post #81 and it has all the info there...Thanks for creating that for everyone to use.
 
M

maddy

New member
VIP
@dougn hi,

I see following error. Could you please advise?

No such function: BetterORB at 1:1
No such function: BetterORB at 1:1
No such function: BetterORB at 1:1
Invalid statement: Unexpected part of function call at 1:29
No such function: BetterORB at 1:1
No such function: BetterORB at 1:1
No such function: BetterORB at 1:1
Invalid statement: Unexpected part of function call at 1:29
 
R

reallynotrico

New member
@netarchitech

Hey All,

First post on the forums - wanted to start by saying thank you for all the outstanding work. Learning a ton reading everything on this forum. I have been playing around with the ORB indicator to fairly solid success, mostly applied on my own watchlist items. This scanner looks really promising, and I believe I have it working - my breakout and breakdown scans are indeed turning back succinct lists of stocks that have done exactly that. Currently, the stocks I get back have broke out/down quite considerably (approach target prices, if not exceeding). How would I limit my search to stocks that are just breaking out, say within 1% or so? I saw that someone had mentioned this as a request previously, and it is my understanding that the "limiter" should control this. When I change the limiter number from 0.05 to 0.01, however, I still get back most of the same stocks as when its 0.05. Any help is much appreciated!

EDIT: I should also mention - I have the ORB indicator defined by the first 15 minutes of market. I have adjusted the timeframe within the scanner to match this, reducing 30 to 15. That said, I still seem to get the same stocks, just their breakout is far far greater relative to the 15minute time frame I defined.

EDIT 2: I am also running this scanner at 12pm EST. I should note, the scanner when ran today excluded INTC, which should have fulfilled the criteria.

@maddy Rename "BetterORB" to match whatever you named your ORB indicator.
 
Last edited by a moderator:
R

reallynotrico

New member
@BenTen @netarchitech Hey y'all, circling back on this. Hoping you might be able to assist!

Thanks in advance,

H
 
D

Daruka

New member
Hello everybody! Please tell me what needs to be changed in the code to remove the green background?
 
T

tradeking313

Member
@BenTen Hey I need some help. Im trying to duplicate for ORB indicator for the 5 minute breakout candle? I want horiziontal line to highlight the high and low of first 5 minute candle on the 5 minute chart. Please. Thanks....
 

Similar threads

Top