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

Line Drawing

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

    Line Drawing

    Hi
    I have an indicator that draws multiple lines, some horizontal and some not. Over 180 lines to be more specific. It works perfectly BUT I can't use it because it just kills my machine. I use drawline as here for the horizontals.

    DrawLine("H1a" + CurrentBar + i, 1, startPrice, 0, startPrice, Color.Yellow);

    and a similar technique to get angled lines. Basically I am drawing multiple line segments on each new bar.

    Is there a more efficient way of doing this ? For example, would using many many PLOTS be a better(more efficient way) ? Or is there another / better way of drawing the lines ?

    This is not a question of simple tuning and looking at Ninja performance tips I believe. I think I am either doing it a very kludgy way or I am asking Ninja to perform beyond what it is capable of right now.

    If I had "write ahead" feature I could do this once at start of day for example and not have to update anything real time - will this feature be in V7 ?

    thanks

    #2
    If you are drawing a line segment on every single bar for sure you will have slow performance if your machine is not powerful enough.

    Plots would be more efficient if you wanted just horizontal lines segments. Select Hash as the plot style.

    Not sure what you mean by "write ahead". You cannot draw objects into the future if that is what you mean.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Another approach is to limit the number of lines drawn. If you only need lines draw on the last 10 bars, then remove the lines on the previous bars to reduce the total number of line objects that need to be internally managed.
      RayNinjaTrader Customer Service

      Comment


        #4
        Reply

        thanks for the quick response.

        Ray unfortunately I need to see them right throught the whole day. But thanks anyway.

        Josh My machine is powerful enough. I know I can't write ahead into the future which is why I asked if V7 would have this feature. Will it ?

        Why couldnt I use plots for the angled lines ?

        thanks

        Comment


          #5
          You will not be able to draw into the future.

          I do not know your specifications for angled lines. You can try and see if it does what you want.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Version 7

            josh
            just to be clear, version 7 will not allow drawing into the future ?

            thx

            Comment


              #7
              Correct, but it is on our list of future considerations.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Drawing into the future is critical....

                My view....drawing into the future is critcal...you want to have the tools to identify potential future events...

                Thanks...

                Comment


                  #9
                  Thanks for the input Alfred!
                  BertrandNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by DJ888, 04-16-2024, 06:09 PM
                  3 responses
                  10 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Started by RookieTrader, Today, 07:41 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post RookieTrader  
                  Started by maybeimnotrader, Yesterday, 05:46 PM
                  1 response
                  18 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by Perr0Grande, Yesterday, 08:16 PM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by f.saeidi, Yesterday, 08:12 AM
                  3 responses
                  26 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X