Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to tell whether a draw object exists?

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

    How to tell whether a draw object exists?

    Let's say I do a DrawRay("ABC"...) on my chart so that I have a draw object created. Is it possible to query to see if that object exists on the chart? I just want a true/false property or method to tell me if it exists or not.

    Thanks!

    #2
    Code:
    [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][COLOR=blue][FONT=Courier New]foreach[/FONT][/COLOR][COLOR=black][FONT=Courier New](IDrawObject drawObject [/FONT][/COLOR][COLOR=blue][FONT=Courier New]in[/FONT][/COLOR][COLOR=black][FONT=Courier New] DrawObjects)[/FONT][/COLOR][/COLOR][/SIZE]
    [COLOR=#0000ff][SIZE=2][COLOR=black][FONT=Courier New]{[/FONT][/COLOR][/SIZE]
    [SIZE=2][COLOR=blue][FONT=Courier New]  if[/FONT][/COLOR][COLOR=black][FONT=Courier New] (drawObject.DrawType == DrawType.Ray && drawObject.Tag == [/FONT][/COLOR][COLOR=maroon][FONT=Courier New]"ABC"[/FONT][/COLOR][COLOR=black][FONT=Courier New])[/FONT][/COLOR][/SIZE]
    [SIZE=2][COLOR=black][FONT=Courier New]  {[/FONT][/COLOR][/SIZE]
    [SIZE=2][COLOR=green][FONT=Courier New]       // Do something here[/FONT][/COLOR][/SIZE]
    [SIZE=2][COLOR=blue][FONT=Courier New]       break[/FONT][/COLOR][COLOR=black][FONT=Courier New];[/FONT][/COLOR][/SIZE]
    [SIZE=2][COLOR=black][FONT=Courier New]  }[/FONT][/COLOR][/SIZE]
    [SIZE=2][COLOR=black][FONT=Courier New]}[/FONT][/COLOR][/SIZE]
    [/COLOR][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
    RayNinjaTrader Customer Service

    Comment


      #3
      Nice... thanks for exposing that object for us. :-)

      Also, you used to be able to click on and manually move or delete draw objects that were created by a Draw...() function. Now you have to remove the whole indicator that drew it. Is this intended functionality?

      Thanks again --

      Comment


        #4
        Originally posted by cassb View Post
        Also, you used to be able to click on and manually move or delete draw objects that were created by a Draw...() function. Now you have to remove the whole indicator that drew it. Is this intended functionality?
        It is default functionality. In Initialize() set:

        AllowRemovalOfDrawObjects = true;
        RayNinjaTrader Customer Service

        Comment


          #5
          The code provided by Ray seems to give access only to the user drawn drawobjects.

          Is there a way to get access to the drawobjects drawn by indicators?

          Is there a way to draw drawobjects programmatically in other panels than the price panel?
          Last edited by WolliWilli; 11-21-2009, 10:33 AM.

          Comment


            #6
            The DrawObjects colllection contains objects that are user drawn and drawn by the host indicator or strategy. There is no access to other objects drawn by other indicators etc...

            To draw in the indicator panel set the the following property to false in Initialize()

            DrawOnPricePanel = false;
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            177 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            332 views
            0 likes
            Last Post CaptainJack  
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            254 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            356 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            184 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Working...
            X