Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Turning off autoscale

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

    Turning off autoscale

    I have an indicator whose sole purpose is to draw lines on a chart. I have "AutoScale= false" set in the Initialize method. There are no other indicators on the chart.
    When I press "Apply" in the Indicator set-up area, it correctly shows the chart, not including all of the distant indicator lines in determining the height of the y axis; however, once I press "OK," the chart is autoscaled to include all of the lines.
    I've attached a picture of the chart, which show an extreme of what happens.
    Is there anything that I can do to NOT have all of the lines included in the autoscaling?
    Attached Files

    #2
    sgordet, is the Autoscale parameter being set to true in the indicator window somehow?
    Attached Files
    AustinNinjaTrader Customer Service

    Comment


      #3
      No, the Auto scaled stays false. As I mentioned, what's strange is that it works properly when I hit Apply. I can see that the whole chart isn't being auto-scaled to the horizontal lines my indicator has added, but as soon as I hit OK, it autoscales. If I go back to the indicator, the Auto scale is still set to false.

      Comment


        #4
        sgordet, what AutoScale setting have you hardcoded in for your DrawLines call?

        Comment


          #5
          AutoScale = false;

          Comment


            #6
            sgordet,

            It's the drawing-level autoscale parameter that determines whether drawn lines are included in the scale. These should be set by default as false, but can be overwritten if you choose true for the autoscale parameter in your drawing statements. I would check your draw statements to make sure you haven't set this as true. Here is an example line with this parameter set to true:

            DrawHorizontalLine("tag2", true, Low[0] - 700, Color.Black, DashStyle.Solid, 3);

            You can also use the snippet below to set this property as false for all drawing objects:
            Code:
            foreach (IDrawObject draw in DrawObjects)
            	{
                   draw.AutoScale = false;
            	}
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Thanks, Ryan.
              I inserted the code snipped and that did it!
              Why didn't I think of that (lol).

              Stephen

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              602 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              347 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              559 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              558 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X