Opening Range Breakout (ORB) Scanner for ThinkorSwim

T

tomsk

Well-known member
VIP
Looks like some work will be needed to transform that to a scan. Alternatively you may like to consider using a much simpler ORB scan code that works

 
Last edited:
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

Active member
@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

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

Top