Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dynamic DrawLines().....

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

    Dynamic DrawLines().....

    Support,

    I am converting a TS indicator that used the TS TL_New fuction. Basically this was a object that ploted a trendline. What was nice about this object was that is returned a handle so you can draw it initially and then extend the the end via a member fuction on each barupdate.

    I need to do the same thing in NT. From what I've read I guess I would use the DrawLine() function, but it doesn't appear to be an object with a handle. I suppose I can store the beginning coord. in an array and redraw the whole line on each barupdate, but how would I get rid on the line from the previous barupdate? Also, on an intraday chart would the lines drawn persist from day to day. With the TS line handles once the day was done I was able to just stop using them and the lines drawn would persist forever and that is what I wanted.

    What are lines exactly and what rules to you have to follow to properly manage them in the way I describe above.

    #2
    Hi bienduga,

    Welcome to the NinjaTrader forum!

    Yes, you would use the DrawLine() statement - http://www.ninjatrader-support.com/H.../DrawLine.html

    Also I would highly suggest, you check out our reference sample for drawing objects - http://www.ninjatrader-support2.com/...ead.php?t=3419

    To have persisting trendlines on your chart, simply use a unique tag for those by adding the CurrentBar to the tag name, this way you don't modify the old trendline and therefore it stays on the chart.

    Comment


      #3
      Sorry, don't know how I missed the tag param...

      Thanks for the fast reply. Ok, I see what I have to do now, some major array manipulation and updating. I see I'll have to reference my "Algorithms in C" text book for all the things I'll need to convert..... How many drawing objects can I get on the chart before NT crawls to a stop or locks up?


      BTW, the reference sample didn't really match the question....

      Comment


        #4
        Hi bienduga,

        You are welcome, the reference sample combined with the help guide link should give you a good start on drawing object handling in NinjaScript...

        Performance depends largely on your system, charts and datafeed connections, hard to judge per se.

        You can review our performance tips here - http://www.ninjatrader-support.com/H...rformanceTips1

        Comment


          #5
          you can use DrawRay() if I understend your concept correctly.
          Last edited by roonius; 01-08-2009, 08:42 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          599 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          345 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          558 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          558 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X