Opening Range

Posted by on Feb 14, 2009 in Indicator, Support and Resistance | 23 comments

UPDATE: 14 Feb 09 – Added the option to only display the current day’s opening range for a cleaner appearance on charts.

This script will plot the opening range high and low for the specified time period. A great video on opening range trading can be found at MarketGauge.com

Opening Range

Opening Range

23 Comments

  1. Great Scripts! This one doesn’t work for me though. It just plots both lines at 0. From what I can tell it copied over fine, but doesn’t seem to work.

  2. Check to make sure you have set your local market opening time in the panel. The default is 0930 for EST, but if you live in another time zone, you’ll need to put in your local times.

    • So it be 8:30 – 15:00 for Dallas, correct? Just making sure I’m understanding, thks!

  3. Great blog! You have some good scripting techniques that I never thought of before. We could be long lost twin brothers–Mastering the Trade, Pivots, TICK, Thinkscript code… Spooky. ;-)

    Good to find another Swimmer out in the blogonets!

  4. Hi Thinkscripter,
    You have programmed some awesome indicators from J. Carter and the opening range from Market Gauge. Is it possible for you to do the 3 DAY PIVOT HIGH AND LOW indicator. I will be glad to give you the definitions if you don’t have it…it is also from MG for swing trading.
    Thanks, Randy

  5. from the graph, the range is from 9:30-10:00 AM.
    The definition of input openingRangeMinutes = 60;
    will set the range to 9:300 – 10:300 AM as it plots on my chart – please advise

  6. I have a wordpress tip: if you don’t like your script codes to be full justified (I don’t) just put this HTML around your code:

    <p align=left > thinkscript </p>

  7. Thanks!

  8. I was hoping TOS or someone would code this. Great job. Thanks. Flex market hours are great for things like bonds and such that have their own hours.

  9. Thanks.
    -TS

  10. Ok, I still like it, but. I can’t figure out why from the script but it appears that 15 is the minimum opening range period. I would like a 5 minute opening range. But I notice there is no change in the plot once you get to 15. Further reductions don’t change anything.
    So that is true with a 5 minute bar. When I go to a 1 minute bar it appears to set the opening range using the 1st 6 bars.
    So I changed the line to
    def pastOpeningRange = if(secondsFromOpen >= (openingRangeMinutes * 60), 1, 0); when it used to add 1 to the opening range in seconds and now it behaves like I think it should behave. It gives me a 5 minute opening range even using 5 minute candles.
    I am very pleased with myself for troubleshooting this and I remain grateful to you for being able to organize it and code it in the first place.

    Good Trading, and keep coding. Thanks again.

  11. Eric,

    I think I found a bug in the OR code. When I set this up to give me a 5 min OR and set the value to 5, it actually gives me the OR of the first 2 five minute bars instead of just the first. Same thing happens with the 30. However — a workaround that I found is just to set the value 1 minute less than you want, i.e. 4 for the 5 min OR and 29 for the 30 min OR.

    Also — for other uses. I am sure you know this, but you can actually set up more than one study if you like to trade with more than one OR on your charts. I personally use the 5 min and 30 min ORs.

    Thanks for all that you do TS!

    John

    • Yep…thanks. I have it on my to-do list to fix. I appreciate the help.
      Eric

  12. i had this when it was free how long ago did you start charging for this? mine got deleted today

  13. yes, keith, michele, and geoff at marketgauge are experts at the opening range. made it easy for me to use with stocks

  14. I imported the study to my TOS platform. When I add it to my 5 minute chart it the lines don’t get plotted. My settings are 630-1300 time (PST), 15 Minute OR, Plot all days. Any help would be greatly appreciated. – Jonathan

    • The times must be entered in EST not PST.
      -Eric

  15. Eric

    with either of the opening range scripts (settings 730-1400, 60 min, I am in MDT) on a 24 hr 1600tick chart I get a plot that starts during the Globex overnight session, and ends at the wrong spot. what am I doing wrong here?

    • All times must be entered in EST.

  16. Eric,

    I put the Opening Range study up on my /CL or crude chart and nothing happens. I have the settings at yes,45 nimutes 830 and 915 and it is on a 1 day 1 minute chart and the time is set to EST . I am looking for the 45 minute period from 8:30 am to 9:15 am. I have changed it to a 5 min and other times and nothing happens at all. It does show up on the headings at the top. What am i doing wrong?

    Thanks

    Eric

    • The market close time is not the end of the OR time. It should be 1600 EST in most cases. The market open time should also be entered in EST and not your local time zone.
      -Eric

  17. Eric

    Thanks for doing such a great job with your site. How can I get this script to do this on a weekly basis instead of a daily? I would like to have a weekly opening range run for the week and then set to the new one next week.

    Thanks in advance

  18. You can make the opening range minutes anything you like in the control panel. Some strategies use 30 some use 60 some use 15….whatever works for you.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>