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

Are draw object Labels specific to the indicator instance or global Ninja?

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

    Are draw object Labels specific to the indicator instance or global Ninja?

    Are draw object Labels specific to the indicator instance that drew them or global for the entire Ninja run time?

    #2
    Hello llanqui,

    Thanks for your post.

    ​A drawing objects tag can be accessed from any indicator or strategy by looping through the DrawObjects collection.

    See the sample code on this help guide page for more information: https://ninjatrader.com/support/help...ub=DrawObjects
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Ok, then ..... to be more specific.....if I (Ninjascript) draws a horizontal line Label called NQ-01 on Chart 1

      and another indicator on another chart draws a horizontal line with the same Label.....

      what happens in the Drawing Tool

      does it only draw one of them on one of the charts (i.e. overlay the first drawn)?

      Comment


        #4
        sorry, by "Label" I mean "TAG:"

        Comment


          #5
          Hello llanqui,

          Thanks for your notes.

          ​I have tested this on my end by creating an indicator that draws a horizontal line on the chart with the Tag name "tag1" and a Brush color DodgerBlue.

          In a second indicator, I looped through the DrawObjects collection to get the Tag of the horizontal line drawn by the first indicator and assigned that Tag name to a variable that returns the string "tag1". Then, I called Draw.HorizontalLine() and used the variable for the 'Tag' parameter of the method and used a different Brush color of Lime to tell the lines apart.

          The result is that the first indicator will draw a line with Tag name "tag1" and the second indicator will also draw a horizontal line with the name "tag1". Since the Tag name is being used by different indicators, the line drawn by the first indicator is not modified by the second indicator and a second line is drawn instead.

          I attached the indicators used to test this for you to view.​
          Attached Files
          Last edited by NinjaTrader_BrandonH; 06-08-2023, 11:54 AM.
          Brandon H.NinjaTrader Customer Service

          Comment


            #6
            Thank you :-)

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Segwin, 05-07-2018, 02:15 PM
            14 responses
            1,788 views
            0 likes
            Last Post aligator  
            Started by Jimmyk, 01-26-2018, 05:19 AM
            6 responses
            837 views
            0 likes
            Last Post emuns
            by emuns
             
            Started by jxs_xrj, 01-12-2020, 09:49 AM
            6 responses
            3,292 views
            1 like
            Last Post jgualdronc  
            Started by Touch-Ups, Today, 10:36 AM
            0 responses
            12 views
            0 likes
            Last Post Touch-Ups  
            Started by geddyisodin, 04-25-2024, 05:20 AM
            11 responses
            62 views
            0 likes
            Last Post halgo_boulder  
            Working...
            X