Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by gemify, 11-11-2022, 11:52 AM
    6 responses
    803 views
    2 likes
    Last Post ultls
    by ultls
     
    Started by ScottWalsh, Today, 04:52 PM
    0 responses
    3 views
    0 likes
    Last Post ScottWalsh  
    Started by ScottWalsh, Today, 04:29 PM
    0 responses
    6 views
    0 likes
    Last Post ScottWalsh  
    Started by rtwave, 04-12-2024, 09:30 AM
    2 responses
    22 views
    0 likes
    Last Post rtwave
    by rtwave
     
    Started by tsantospinto, 04-12-2024, 07:04 PM
    5 responses
    70 views
    0 likes
    Last Post tsantospinto  
    Working...
    X