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 sjsj2732, 03-23-2026, 04:31 AM
          0 responses
          69 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          312 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          305 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          146 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          105 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X