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

Create a Drawing Tool to draw a line in all Charts

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

    Create a Drawing Tool to draw a line in all Charts

    Hi,

    I want to create a DrawingTool, which will create some lines.

    I want to draw these lines in all Charts of its instrument.

    Is it possible?

    Thanks!!!

    #2
    Hello artson,

    Yes, please double click the drawing object to open its properties menu. Set "Attach to" to "instrument name (All charts)" and click OK. The drawing object will now show in all charts with the same instrument.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Ok, sorry,
      I want to create programmatically a DrawingTool, wich will do some calculations and draw some lines, and I want, that these lines are shown in all Charts from the instrument.

      Comment


        #4
        Hello artson,
        You can use below syntax:-
        Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, bool isGlobal, string templateName)
        Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, bool isGlobal, string templateName)
        Hope it helps!

        Comment


          #5
          Thanks "s.kinra", but I don't mean creating an indicator, I want it through a DrawingTool:

          RenderTarget.DrawLine(r1Vect, r2Vect, StrokeLineaRechazo.BrushDX, StrokeLine.Width, StrokeLine.StrokeStyle);



          There is no possibility for a "Global".....

          Comment


            #6
            Hello arston,
            If you wish to draw a line similar to existing line tool add on, you can save a default template with <IsGlobalDrawingObjectDefault>true</IsGlobalDrawingObjectDefault>.
            So, every time you draw a new line its global. Hope it helps!

            Comment


              #7
              Thanks again "s.kinra"

              With my drawingtool I will select some points and my tool will draw several lines.
              It is a tedious task to draw later these lines and change their properties to make them global.

              Maybe there is a posibility of making, that my calculated lines will be present on all Charts without having to do it manually.....

              Comment


                #8
                Hi artson, thanks for posting.

                The template will need to be set to globalize the drawing tool. IsGlobalDrawingTool needs to be set through the template because it's not possible to set it programmatically.

                Kind regards
                -ChrisL
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  Ok,

                  Thanks!

                  Comment


                    #10
                    Hello arston,
                    You need to set the template only once, so every time you create a line it will be global. No need to do it again & again, its one time activity.
                    Hope it helps!

                    Comment


                      #11
                      Ok, good tip!, you are right!

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by selu72, Today, 02:01 PM
                      1 response
                      6 views
                      0 likes
                      Last Post NinjaTrader_Zachary  
                      Started by WHICKED, Today, 02:02 PM
                      2 responses
                      11 views
                      0 likes
                      Last Post WHICKED
                      by WHICKED
                       
                      Started by f.saeidi, Today, 12:14 PM
                      8 responses
                      21 views
                      0 likes
                      Last Post f.saeidi  
                      Started by Mikey_, 03-23-2024, 05:59 PM
                      3 responses
                      51 views
                      0 likes
                      Last Post Sam2515
                      by Sam2515
                       
                      Started by Russ Moreland, Today, 12:54 PM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_Erick  
                      Working...
                      X