NexusFi: Find Your Edge


Home Menu

 





Weekly Opening Range for TOS


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one greg9 with 4 posts (1 thanks)
    2. looks_two Massive l with 1 posts (1 thanks)
    3. looks_3 blb014 with 1 posts (0 thanks)
    4. looks_4 rmejia with 1 posts (3 thanks)
      Best Posters
    1. looks_one rmejia with 3 thanks per post
    2. looks_two growex with 3 thanks per post
    3. looks_3 Massive l with 1 thanks per post
    4. looks_4 greg9 with 0.3 thanks per post
    1. trending_up 7,869 views
    2. thumb_up 8 thanks given
    3. group 4 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
Search this Thread

Weekly Opening Range for TOS

  #1 (permalink)
 
greg9's Avatar
 greg9 
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

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
How to apply profiles
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #2 (permalink)
 
Massive l's Avatar
 Massive l 
OR/USA
Legendary /NQ Trader
 
Experience: None
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106

I'll look into it but I bet @rmejia knows.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 
rmejia's Avatar
 rmejia 
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!

Reply With Quote
Thanked by:
  #4 (permalink)
 
greg9's Avatar
 greg9 
SLC, UT
 
Experience: Intermediate
Platform: Sierra
Trading: ES CL
Posts: 108 since Mar 2013
Thanks Given: 102
Thanks Received: 67


rmejia View Post
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

Started this thread Reply With Quote
  #5 (permalink)
 growex 
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

Follow me on Twitter Reply With Quote
Thanked by:
  #6 (permalink)
 
greg9's Avatar
 greg9 
SLC, UT
 
Experience: Intermediate
Platform: Sierra
Trading: ES CL
Posts: 108 since Mar 2013
Thanks Given: 102
Thanks Received: 67


growex View Post
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.

Started this thread Reply With Quote
  #7 (permalink)
 blb014 
Dallas, Texas
 
Experience: Intermediate
Platform: TOS
Trading: AAPL, /ES, IWM, SPY Options
Posts: 330 since Oct 2012
Thanks Given: 554
Thanks Received: 187


growex View Post
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

Reply With Quote
  #8 (permalink)
 
greg9's Avatar
 greg9 
SLC, UT
 
Experience: Intermediate
Platform: Sierra
Trading: ES CL
Posts: 108 since Mar 2013
Thanks Given: 102
Thanks Received: 67


blb014 View Post
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.

Started this thread Reply With Quote
Thanked by:




Last Updated on March 5, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts