Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reading and setting Chart time and Price axis from Ninja Script

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

    Reading and setting Chart time and Price axis from Ninja Script

    Hi,
    I want to make a helper app for some charts where I want to be able to read the chart time and price axes and then after deciding from my other indicators want to be able to display a part of the time and price axes. So I want to be able to read the information and then set the chart axes from Ninja Script.
    I have some C# and other programming experience but don't know here to start to figure that out for ninja trader 8 Ninja script.
    TIA

    #2
    Hello TIA,

    There are no supported properties or methods to adjust the horizontal range or scale or the vertical range or scale.

    With an indicator that has AutoScale enabled, the OnCalculateMinMax() method can be overridden to be used to send autoscale information to the chart which can adjust the chart's price scale.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,
      Thanks for your response. Is it possible to determine how many bars are displayed (i.e. visible) on the chart and what the Price minimum and Maximum are?

      thanks

      Comment


        #4
        Hello suraj,

        The ChartBars.FromIndex and .ToIndex are the indexes of the visible bars on the chart.



        If your indicator is the only object with auto scale enabled, the price minimum and maximum are whatever you have set these to or will be the MAX() or MIN() of the plot.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          637 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          366 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          107 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          569 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          571 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X