• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw box around high and low...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Draw box around high and low...

    Hello everyone, I am looking fior an indicator that would draw a box around the high and low of the time frame that I select. Basically, it would do exactly what the rectangle properties data options would do, but of course I want the indicator to automatically plot the rectangle around the high and low at the particular time frame everday, for an example between 2-3 pm daily.

    I have no experience or knowledge on how to write the script for this, even though in my mind it seems like it is relatively simple. So if there is a script that can be modified, I would need the "scripting for dummies" insturction on what and how to do it. I imagine the first steps would be "go to tools, select new/edit Ninjascript, select Indicator..."

    Otherwise, if someone doesn't mind writing it, I would greatly appreciate it.

    Thanks in advance & God Bless

    #2
    Hello ProV356,

    Thank you for your post.

    You could use the following:
    Code:
    			if(Bars.FirstBarOfSession)
    				recTag++;
    			
    			DrawRectangle(recTag.ToString(), true, new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 14, 0, 0), Low[Bars.GetBar(new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 14, 0, 0))], new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 15, 0, 0), High[Bars.GetBar(new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 15, 0, 0))], Color.Blue, Color.Blue, 10);
    If you would like to take on learning NinjaScript, we have a fully documented help guide which will help you get started with Ninja Script. You will find language references to all of the methods and functions you will be using. You will also see a tutorial section which will help you create your first indicator and get you started with some of these concepts.
    A link to our Help Guide can be found below: http://www.ninjatrader.com/support/h...stribution.htm

    I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript: http://www.ninjatrader.com/support/h..._resources.htm

    You will find Reference Samples online as well as some Tips and Tricks for both indicators and strategies:
    Click here to see our NinjaScript Reference Samples: http://www.ninjatrader.com/support/f...splay.php?f=30
    Click here to see our NinjaScript Tips: http://www.ninjatrader.com/support/f...ead.php?t=3229

    These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

    There is a also a growing library of user submitted custom indicators (100+) that can be downloaded from our support form. Please look in the NinjaScript File Sharing section of our support forum as you may find what you are looking for there: http://www.ninjatrader.com/support/f...splay.php?f=37

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bomanpbm, Today, 09:27 PM
    0 responses
    1 view
    0 likes
    Last Post bomanpbm  
    Started by tgn55, Today, 08:47 AM
    0 responses
    8 views
    0 likes
    Last Post tgn55
    by tgn55
     
    Started by ballboy11, 05-04-2019, 10:26 AM
    6 responses
    58 views
    0 likes
    Last Post Kermit
    by Kermit
     
    Started by mrlucky1x, Yesterday, 10:01 PM
    0 responses
    15 views
    0 likes
    Last Post mrlucky1x  
    Started by roger556, Yesterday, 09:22 PM
    0 responses
    8 views
    0 likes
    Last Post roger556  
    Working...
    X