NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Miscellaneous Support > Historical Version 7 Beta Threads > Version 7 Beta General Questions & Bug Reports

Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports.

 
 
Thread Tools Display Modes
Old 11-18-2009, 08:12 AM   #1
cassb
Senior Member
 
Join Date: Nov 2007
Location: Victor, NY
Posts: 577
Thanks: 5
Thanked 4 times in 4 posts
Send a message via Yahoo to cassb Send a message via Skype™ to cassb
Default 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!
Price-Dynamics.com
A NinjaTrader Official Partner

Visit http://www.price-dynamics.com to learn more about the Rhythm Relay trading system. Yes, you can discretionary or auto-trade with 75%+ accuracy!

Use our Contact Us page to request free access to our daily Trader's Lounge where you can see the system in action in a live account!
cassb is offline  
Old 11-18-2009, 08:56 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Code:
foreach(IDrawObject drawObject in DrawObjects)
{
  if (drawObject.DrawType == DrawType.Ray && drawObject.Tag == "ABC")
  {
       // Do something here
       break;
  }
}

NinjaTrader_Ray is offline  
Old 11-18-2009, 09:08 AM   #3
cassb
Senior Member
 
Join Date: Nov 2007
Location: Victor, NY
Posts: 577
Thanks: 5
Thanked 4 times in 4 posts
Send a message via Yahoo to cassb Send a message via Skype™ to cassb
Default

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 --
Price-Dynamics.com
A NinjaTrader Official Partner

Visit http://www.price-dynamics.com to learn more about the Rhythm Relay trading system. Yes, you can discretionary or auto-trade with 75%+ accuracy!

Use our Contact Us page to request free access to our daily Trader's Lounge where you can see the system in action in a live account!
cassb is offline  
Old 11-18-2009, 09:12 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Quote:
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;
NinjaTrader_Ray is offline  
Old 11-21-2009, 09:19 AM   #5
WolliWilli
Member
 
Join Date: Mar 2009
Posts: 33
Thanks: 0
Thanked 0 times in 0 posts
Default

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 at 09:33 AM.
WolliWilli is offline  
Old 11-22-2009, 01:35 PM   #6
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

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;
NinjaTrader_Ray is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to tell whether a draw object exists? cassb General Programming 9 04-02-2012 01:04 PM
Deleting Draw Object Programatically TAJTrades General Programming 1 05-18-2009 09:35 AM
Get price for a draw object binwang2 General Programming 1 01-30-2009 11:47 AM
Draw Object-Hash dwalls Indicator Development 1 11-10-2008 10:46 AM
Getting draw object information SuzyG Strategy Development 3 05-22-2008 01:37 PM


All times are GMT -6. The time now is 06:43 PM.