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