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

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?
        BertrandNinjaTrader Customer Service

        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 ZenCortexCLICK, Today, 04:58 AM
              0 responses
              5 views
              0 likes
              Last Post ZenCortexCLICK  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              172 responses
              2,281 views
              0 likes
              Last Post sidlercom80  
              Started by Irukandji, Yesterday, 02:53 AM
              2 responses
              18 views
              0 likes
              Last Post Irukandji  
              Started by adeelshahzad, Today, 03:54 AM
              0 responses
              8 views
              0 likes
              Last Post adeelshahzad  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X