Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Range Calculation

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

    Range Calculation

    Forum Folk,
    • I am using the spread indicator to define an Open Hi and Lo of a session.
    • The O,H & L are subsequently displayed in a data box (if needed)
    I am wanting to use Nina to auto-calculate a range value from the Hi and Lo. Do you have any suggestions or ideas of how to go about this? I attempted to insert the "range" indicator of the spread indicator but cannot get a readout of the spread value... Should I be working with a market analyzer or a different tool inside of Ninja at this point in order to trigger the calculation?


    Thank You!
    Attached Files

    #2
    Hello Blackbull, thanks for writing in.

    It depends on what exactly you want this indicator to do. One indicator that comes to mind is the ATR (average true range) indicator. ATR is available to view from the NinjaScript editor. If you want to calculate a range based on a daily bar when the chart is intraday, you can add a 1 day series to your script to calculate from. See this guide on multi time frame scripts:

    https://ninjatrader.com/support/help...nstruments.htm

    Please let me know if you have any further questions on this material.

    Comment


      #3
      Hi Chris,
      Thank You for your reply.
      I am simply wanting the indicator (or an indicator) (or market analyzer?) to subtract the lo from the hi.

      Comment


        #4
        Hello Blackbull, thanks for your reply.

        Did you try using a print to see what the value of your plot is coming out to? From the screenshot, it looks like whatever calculation is being done, it is coming back as Not a Number or a very very small number. e.g.

        OnBarUpdate()
        {
        Print(High[0] - Low[0]);
        Value[0] = High[0]-Low[0];
        }

        Please let me know if I can assist any further.

        Comment


          #5
          I'm sorry Chris I wish I knew what a print was and how to work with them.

          Comment


            #6
            Hello Blackbull, thanks for your reply.

            The documentation for the Print method can be found here:
            https://ninjatrader.com/support/help...nt7/?print.htm

            This tool will likely be the most used debugging tool for those developing NinjaScripts. It helps us see data from the script while it is running so we can make adjustments to unexpected behavior.

            Please let me know if you have any questions on this material.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            574 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            333 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            553 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X