Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PlotStyle.Line Across UnSet Values

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

    PlotStyle.Line Across UnSet Values

    I am trying to plot a line whereby I set a "valid" value onthe currentbar, then the next three bars, for example, are "invalid" so I do not setvalues to the plot. Thefifth bar is "valid" so I set a value to the plot again. I am finding that the line plot style does not connect theset plot values across the invalid value bars as I would expect it to given how otherplatforms work. Do I correctly understand the line plot functionality in this context? Is there a possible workaround? I am using Version 6.

    Regards,

    Whitmark
    whitmark
    NinjaTrader Ecosystem Vendor - Whitmark Development

    #2
    imported post

    The problem is that NT only connects valid data points. As there in an invalid plot no line (segment) would be drawn.

    a) bar 100 valid, bar 101 invalid, bar 102 valid, bar 103 invalid -> no line segment drawn
    b) bar 100 valid, bar 101 valid, bar 102 invalid, bar 103 valid, bar 104 valid -> segments 100-101 and 103-104 drawn

    If we changed the logic then there would be no way to render a line with gaps (which is desired behaviour).

    Comment


      #3
      imported post

      Dierk Droth wrote:
      The problem is that NT only connects valid data points. As there in an invalid plot no line (segment) would be drawn.

      a) bar 100 valid, bar 101 invalid, bar 102 valid, bar 103 invalid -> no line segment drawn
      b) bar 100 valid, bar 101 valid, bar 102 invalid, bar 103 valid, bar 104 valid -> segments 100-101 and 103-104 drawn

      If we changed the logic then there would be no way to render a line with gaps (which is desired behaviour).
      Thanks Dierk, for the clarification. I could make a case for why you would want to interpolate your line indicator in the event you get an invalid input bar so I would assert thateither method isdesireable. Be that as it may, is there a convenient way to know the x , y coordinate ofa given plot valuesuch that I could use a drawing object to "connect the dots" across invalid (unSet) bars? Thanks!

      Regards,

      Whitmark
      whitmark
      NinjaTrader Ecosystem Vendor - Whitmark Development

      Comment


        #4
        imported post

        Hmm not entirely sure what your are looking for, but how about this: You use the DrawLine method in your NinjaScript to draw a line (or a few lines). You should limit the # of lines to a few (if possible), since managing thousands of custom painted lines for sure would have undesirable impact on performance.

        Comment


          #5
          imported post

          Thanks Dierk, you make a great point. I'll need to rethink the necessity of that requirement.
          whitmark
          NinjaTrader Ecosystem Vendor - Whitmark Development

          Comment

          Latest Posts

          Collapse

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