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

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.
    BertrandNinjaTrader Customer Service

    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
        BertrandNinjaTrader Customer Service

        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 trilliantrader, 04-18-2024, 08:16 AM
          4 responses
          18 views
          0 likes
          Last Post trilliantrader  
          Started by mgco4you, Today, 09:46 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by wzgy0920, Today, 09:53 PM
          0 responses
          9 views
          0 likes
          Last Post wzgy0920  
          Started by Rapine Heihei, Today, 08:19 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by Rapine Heihei, Today, 08:25 PM
          0 responses
          10 views
          0 likes
          Last Post Rapine Heihei  
          Working...
          X