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

Identify User-Selected Drawing Object

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

    Identify User-Selected Drawing Object

    (I realize this is likely going in to unsupported territory.)

    Does anyone know how to identify which drawing object is currently selected?

    #2
    Originally posted by drmartell View Post
    (I realize this is likely going in to unsupported territory.)

    Does anyone know how to identify which drawing object is currently selected?

    If there is anything, it should be in the CO object




    Hopefully, loop through all objects, and hopefully there is some sort of a 'selected' property to check.

    Using the auto fill in when typing should list out what is available. (Sorry, I don't have NT up at the moment to check).

    Comment


      #3
      Originally posted by sledge View Post
      If there is anything, it should be in the CO object
      Sorry could you further explain what you mean by the CO object. I know there is no documented 'selected' property.

      Comment


        #4
        Originally posted by drmartell View Post
        Sorry could you further explain what you mean by the CO object. I know there is no documented 'selected' property.
        I'm not sure how far along you are in your research, I've started at the beginning.

        In the link to the other thread, there is a bunch of code that describes how to loop through ChartObjects that are in the chart.

        Look at NT_RyanM sample indicator he wrote for a complete sample.

        Code:
               
        List<ChartObject> ChartObjectArrayList = new List<ChartObject>();                         
        
         foreach (ChartObject CO in this.ChartControl.ChartObjects)
           {                 
                      if ( CO is NinjaTrader.Gui.Chart.ILine )    
                          {                         
                               ChartObjectArrayList.Add(CO);
                         }
        Last edited by sledge; 11-17-2012, 09:29 AM. Reason: fixed formatting

        Comment


          #5
          Originally posted by sledge View Post
          Look at NT_RyanM sample indicator he wrote for a complete sample.
          Hmmm, I can't find the code you referenced in the LineAlert indicator to which you linked. However the snippet you provided might get me somewhere. . .

          Comment


            #6
            Originally posted by drmartell View Post
            Hmmm, I can't find the code you referenced in the LineAlert indicator to which you linked. However the snippet you provided might get me somewhere. . .

            This will probably only tell if the ChartObject is selectable.

            A far cry from selected.
            Attached Files

            Comment


              #7
              Originally posted by drmartell View Post
              Hmmm, I can't find the code you referenced in the LineAlert indicator to which you linked. However the snippet you provided might get me somewhere. . .
              I could only find this:

              if (this.ChartControl.ContainsFocus)

              This works for the whole chart, but not objects.

              I'm not sure it is possible.

              Hopefully someone else might have an idea.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Brevo, Today, 01:45 AM
              0 responses
              3 views
              0 likes
              Last Post Brevo
              by Brevo
               
              Started by aussugardefender, Today, 01:07 AM
              0 responses
              3 views
              0 likes
              Last Post aussugardefender  
              Started by pvincent, 06-23-2022, 12:53 PM
              14 responses
              239 views
              0 likes
              Last Post Nyman
              by Nyman
               
              Started by TraderG23, 12-08-2023, 07:56 AM
              9 responses
              384 views
              1 like
              Last Post Gavini
              by Gavini
               
              Started by oviejo, Today, 12:28 AM
              0 responses
              6 views
              0 likes
              Last Post oviejo
              by oviejo
               
              Working...
              X