Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Weekly Opening Range for TOS
Updated March 5, 2014
Top Posters
looks_one
greg9
with 4 posts (1 thanks)
looks_two
Massive l
with 1 posts (1 thanks)
looks_3
blb014
with 1 posts (0 thanks)
looks_4
rmejia
with 1 posts (3 thanks)
Best Posters
looks_one
rmejia
with 3 thanks per post
looks_two
growex
with 3 thanks per post
looks_3
Massive l
with 1 thanks per post
looks_4
greg9
with 0.3 thanks per post
trending_up
7,869 views
thumb_up
8 thanks given
group
4 followers
forum
7 posts
attach_file
0 attachments
Weekly Opening Range for TOS
February 4th, 2014, 03:12 PM
SLC, UT
Experience: Intermediate
Platform: Sierra
Trading: ES CL
Posts: 108 since Mar 2013
Thanks Given: 102
Thanks Received: 67
I have a script from thinkscripter that gives the Opening Range on a Daily chart. This script plots the high and low for the morning and shows the lines going forward until the end of the day. One can change the times it records for plotting lines for each day.
What I need is an Opening Range script that plots the opening range for the Week. This would record monday morning's high/low and plot it for the entire week going forward.
Anyone have this script for TOS or know how to make it?
Thanks
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
February 4th, 2014, 05:33 PM
OR/USA
Legendary /NQ Trader
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106
I'll look into it but I bet @rmejia knows.
February 4th, 2014, 10:53 PM
Puerto Rico
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: Options
Posts: 379 since Oct 2010
Thanks Given: 3,614
Thanks Received: 441
I do it manually drawing a rectangle and inputing the dates.
This code is as far as I got; don't know how to push the start of the lines forward.
Code
def TheWeek = getWeek();
def WeekBeg = if TheWeek != TheWeek[1] then 1 else 0;
rec displayedHigh = if IsNan(high > displayedHigh[1]) then 0 else if weekBeg then high else displayedHigh[1];
REC displayedLow = if IsNan(low > displayedLow[1]) then 0 else if WeekBeg == 1 then low else displayedLow[1];
rec ORHigh = if IsNan(ORHigh[1]) then 0 else if WeekBeg == 1 then displayedHigh else ORHigh[1];
rec ORLow = if IsNan(ORLow[1]) then 0 else if WeekBeg == 1 then displayedLow else ORLow[1];
plot Opening_Range_High = ORHIgh;
plot Opening_Range_Low = ORLow;
Perhaps @growex can figure it out!
February 5th, 2014, 10:20 AM
SLC, UT
Experience: Intermediate
Platform: Sierra
Trading: ES CL
Posts: 108 since Mar 2013
Thanks Given: 102
Thanks Received: 67
rmejia
I do it manually drawing a rectangle and inputing the dates.
This code is as far as I got; don't know how to push the start of the lines forward.
Code
def TheWeek = getWeek();
def WeekBeg = if TheWeek != TheWeek[1] then 1 else 0;
rec displayedHigh = if IsNan(high > displayedHigh[1]) then 0 else if weekBeg then high else displayedHigh[1];
REC displayedLow = if IsNan(low > displayedLow[1]) then 0 else if WeekBeg == 1 then low else displayedLow[1];
rec ORHigh = if IsNan(ORHigh[1]) then 0 else if WeekBeg == 1 then displayedHigh else ORHigh[1];
rec ORLow = if IsNan(ORLow[1]) then 0 else if WeekBeg == 1 then displayedLow else ORLow[1];
plot Opening_Range_High = ORHIgh;
plot Opening_Range_Low = ORLow;
Perhaps
@
growex can figure it out!
This is a good start! I wish I knew more about coding in tos . This is plotting a range and holding it for the week like I need. Somehow I need the code to plot it from sunday high/low to Monday market open high/low and then hold that going forward for the week.
Thanks for your start on this. I think its a good starting point for what it needs to be. Maybe someone else knows how to complete it.
Thanks for looking into it
February 5th, 2014, 01:31 PM
Trubchevsk
Experience: Beginner
Platform: tos
Trading: stocks
Posts: 61 since May 2011
Thanks Given: 40
Thanks Received: 79
rmejia, thank you.
gsl8r, open the TS_OpeningRange study in thinkscript editor and add these lines to the end of the script.
Code
def date = GetYYYYMMDD (); def MondayORHigh = if getdayOfWeek ( date ) == 1 then orHigh else MondayORHigh [ 1 ]; def MondayORLow = if getdayOfWeek ( date ) == 1 then orLow else MondayORLow [ 1 ]; plot hline = MondayORHigh ; plot lline = MondayORLow ;
It will hold your choosen Monday morning open range levels for entire week until next Monday
February 5th, 2014, 01:58 PM
SLC, UT
Experience: Intermediate
Platform: Sierra
Trading: ES CL
Posts: 108 since Mar 2013
Thanks Given: 102
Thanks Received: 67
growex
rmejia, thank you.
gsl8r, open the TS_OpeningRange study in thinkscript editor and add these lines to the end of the script.
Code
def date = GetYYYYMMDD ();
def MondayORHigh = if getdayOfWeek ( date ) == 1 then orHigh else MondayORHigh [ 1 ];
def MondayORLow = if getdayOfWeek ( date ) == 1 then orLow else MondayORLow [ 1 ];
plot hline = MondayORHigh ;
plot lline = MondayORLow ;
It will hold your choosen Monday morning open
range levels for entire week until next Monday
Awesome! It works!
Thank you for this and everyone else that helped me out.
March 5th, 2014, 05:34 PM
Dallas, Texas
Experience: Intermediate
Platform: TOS
Trading: AAPL, /ES, IWM, SPY Options
Posts: 330 since Oct 2012
Thanks Given: 554
Thanks Received: 187
growex
rmejia, thank you.
gsl8r, open the TS_OpeningRange study in thinkscript editor and add these lines to the end of the script.
Code
def date = GetYYYYMMDD ();
def MondayORHigh = if getdayOfWeek ( date ) == 1 then orHigh else MondayORHigh [ 1 ];
def MondayORLow = if getdayOfWeek ( date ) == 1 then orLow else MondayORLow [ 1 ];
plot hline = MondayORHigh ;
plot lline = MondayORLow ;
It will hold your
choosen Monday morning open range levels for entire week until next Monday
Where do enter in the times (somewhere in the code)? I'm a total noob when comes to code
Thanks
March 5th, 2014, 06:02 PM
SLC, UT
Experience: Intermediate
Platform: Sierra
Trading: ES CL
Posts: 108 since Mar 2013
Thanks Given: 102
Thanks Received: 67
blb014
Where do enter in the times (somewhere in the code)? I'm a total noob when comes to code
Thanks
@blb014 you won't enter in any times into this code. The script automatically plots the weekly opening range for every week on the chart.
One thing you will need is to buy this script: Opening [AUTOLINK]Range[/AUTOLINK] | ThinkScripter and then make the addition provided here to it.
I don't feel right about posting it it here since its a paid script and owned by Eric.
Last Updated on March 5, 2014