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 Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            602 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            347 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            559 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            558 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X