Whereas the original 0.06 limited the range that was added/subtracted to the OpenRangeHigh/OpenRangeLow, the result sets could be rather large, so I added the "Limiter" to reduce the size of the result sets
@BenTen I've retooled Robert Payne's scan above to further refine results. Just plug in the desired percentage amount in the "Limiter" input and scan. Also, make sure to specify whether you're looking for Breakouts or Breakdowns by positioning the Hashtag (#) in front of the plot statement you want to exclude...
Rich (BB code):
# Filename: 30_min_Opening_Range_SCAN
# source: 30 min opening range
# original author: Robert Payne
def OpenRangeMinutes = 30;
def MarketOpenTime = 0930;
input ShowTodayOnly = yes;
input Limiter = 0.05;
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 PreviousRange = high[1] - low[1];
def range = Average(PreviousRange, 10);
def entryLine1 = OpenRangeHigh + (range * 0.06);
def entryLine2 = OpenRangeLow - (range * 0.06);
# Scan currently set to find Breakouts
# Move Hashtag to Breakout plot to scan for Breakdowns
# Limiter set by user (currently 5 percent)
plot breakout = close > (entryline1 + (entryline1 * Limiter));
#plot breakdown = close < (entryline2 - (entryline2 * Limiter));
When I ran this without the "Limiter" I got 233 results...After plugging in the Limiter, the scan returned 3 results...
In order to take advantage of the "Limiter", you should follow @BenTen's initial instructions then copy/paste this scan code into the "thinkScript Editor" and delete any code currently in the "Condition Wizard"...
In order to take advantage of the "Limiter", you should follow @BenTen's initial instructions then copy/paste this scan code into the "thinkScript Editor" and delete any code currently in the "Condition Wizard"...
thank you for trying to help. I know where to paste it but still not clear as to if I have to create the condition first and then paste the code in the editor or not. I tried not creating the condition and going to the editor and it does not work. Nothing scans. It is very confusion...
Hi All, Love the idea of ORB as a trading idea. Is anyone using this strategy finding that the stock is trading within the opening range all day as of recent? I'm getting lots of false breaks of the OR, but nothing that really runs without pulling back.
@netarchitech, thankyou for the awesome orb scanner. I have been playing with the source code a bit and i have an issue if you can help i will greatly appreciate it.
If i do a 10 min scan as below--
# Filename: 10_min_Opening_Range_SCAN
# source: 10 min opening range
# original author: Robert Payne
The scan results start coming in usually around 10.15ish but the stocks(in the scanner) have been moving(upward or downward) as soon as the market opens. Is there a setting in the code that can help the results pop up around 9:40 to 9:50?
Now if i change the market opening time to 9:20(using extended hrs) the scans are updated even around 9:35.
@ajmann You are certainly welcome...I'm glad to hear that the ORB Scanner is proving useful Credit, of course, goes to @RobertPayne for the scripting of the scanner...I only added a small mod to it...
The scan results start coming in usually around 10.15ish but the stocks(in the scanner) have been moving(upward or downward) as soon as the market opens.
As for the stocks moving upwards and downwards in your scanner, I believe that might be a column in the scanner that you have set to order, either ascending or descending, and the results are refreshing rapidly as the opening market data flows in...
Frankly, I have not messed around with this scanner since the "Limiter" modification...I don't know if you can pinpoint the opening range like that, but maybe another member of the uTS community might be able to help...
@BenTen I am getting an error that says "exactly one plot expected".. any idea? I am copying and pasting right from page one. This is the study I have downloaded from the thread http://tos.mx/3tKKDCf
@BenTen I am getting an error that says "exactly one plot expected".. any idea? I am copying and pasting right from page one. This is the study I have downloaded from the thread http://tos.mx/3tKKDCf
I just copied and pasted the first script posted on the first page and it works as expected, without errors... I prefer the Copy & Paste method over using the shared links as it requires less steps in the long run...
@rad14733 Right, I am copying and pasting. I was just sharing the indicator I have loaded. I copy and paste the code directly to the scanner and get the same error. Not sure where I am messing this up. Does the scanner tie in with the indicator?
@TheNameIsBond You need to save the code as an indicator and then load that indicator into your scanner. Don't copy/paste the code directly into your scanner. Not going to work.
@TheNameIsBond Take a look at the video below. The entire process won't be the same as demonstrated in the video but it should be a good starting place for you to learn more about the scanner.
@BenTen I apologize if we are confusing each other. I am trying to create the scanner for a break of the ORH or ORL. I am creating a scanner that has the conditions "Close "crosses" (study) ORH2ext within 2 bars" and inverse for ORL2ext.. when I do that I get the too complex error..
The "code" that it switches to in the thinkscript editor says "close crosses OpeningRangeBreakout()."ORH2ext" within 2 bars and close crosses OpeningRangeBreakout()."ORL2ext" within 2 bars"
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.
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.