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 geotrades1, Today, 10:02 AM
                      2 responses
                      5 views
                      0 likes
                      Last Post geotrades1  
                      Started by ender_wiggum, Today, 09:50 AM
                      1 response
                      5 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by rajendrasubedi2023, Today, 09:50 AM
                      1 response
                      12 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Started by bmartz, Today, 09:30 AM
                      1 response
                      10 views
                      0 likes
                      Last Post NinjaTrader_Erick  
                      Started by geddyisodin, Today, 05:20 AM
                      3 responses
                      27 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Working...
                      X