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 andrewtrades, Today, 04:57 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            6 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            9 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            20 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X