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

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 GLFX005, Today, 03:23 AM
          0 responses
          2 views
          0 likes
          Last Post GLFX005
          by GLFX005
           
          Started by XXtrader, Yesterday, 11:30 PM
          2 responses
          11 views
          0 likes
          Last Post XXtrader  
          Started by Waxavi, Today, 02:10 AM
          0 responses
          6 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by TradeForge, Today, 02:09 AM
          0 responses
          14 views
          0 likes
          Last Post TradeForge  
          Started by Waxavi, Today, 02:00 AM
          0 responses
          3 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Working...
          X