Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can I constantly maintain a top and bottom margin?

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

    How can I constantly maintain a top and bottom margin?

    I know that NT 6.5 doesn't allow you to set a top and bottom margin of blank space for a chart, but I am trying to find some way to do it automatically using NinjaScript.

    I had the idea of creating an indicator which draws horizontal lines above and below price, each a set distance away. So I would do the following:

    DrawHorizontalLine("highpricelimit",Close[0] * 1.0035,
    Color.FromArgb(1,1,1),HorizLineStyle,line_Size);

    DrawHorizontalLine("lowpricelimit",Close[0] * 0.9965,
    Color.FromArgb(1,1,1),HorizLineStyle,line_Size);

    This would draw two horizontal lines just above and below the price a set % away from it. (My background is black and the lines are colored to be almost black, so they are invisible.)

    However, this doesn't seem to work as when the price approaches the top or bottom edge, the horizontal lines just disappear off the chart. (I thought that it would maintain them.)

    Am I doing something wrong, or is there another way to do this?

    #2
    JS999,

    Unfortunately it is what it is for now. NT7 will have significant chart scaling/scrolling/etc improvements that will address this.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      JS999,

      Unfortunately it is what it is for now. NT7 will have significant chart scaling/scrolling/etc improvements that will address this.
      So, you are saying there is no way to do this at all with drawing objects? Just want to make sure I'm understanding you here.

      Comment


        #4
        JS999,

        You could try setting AutoScale = true for them. Or you could maybe try doing it from plots.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          JS999,

          You could try setting AutoScale = true for them. Or you could maybe try doing it from plots.
          Thanks - I think plots would work. That's what I will do...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          571 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          331 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
          549 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          549 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X