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 > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 06-27-2008, 09:08 AM   #1
tb2000
Member
 
Join Date: May 2008
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
Default DrawText into Data Box

At (Bars.DayBreak) I have a computed value I need to display

It seems the data box is not "API available" - unless something has changed?

I tried to plot it adjacent to e.g. the lower chart boundry as a unique object using DrawText - but I'm not sure how to reference the y position. Is there a way to determine the lower chart y-scale boundry to use as y-value?

It seems if I use DrawFixed I can only keep a single value displayed - which would be ok if there was a way to make that dependent on the cursor position.

Any thoughts welcome!

thanx
tb
tb2000 is offline  
Reply With Quote
Old 06-27-2008, 09:13 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

Likely would need to override the Plot() method. Check out the CustomPlotSample indicator.
NinjaTrader_Ray is offline  
Reply With Quote
Old 06-27-2008, 09:23 AM   #3
tb2000
Member
 
Join Date: May 2008
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
Default

Ray, thanks - that was quick!

Is there a way to have a user defined data series display in the data box?

On some occasion I had an empty colored field showing up in the databox, not sure when that happened though...
tb2000 is offline  
Reply With Quote
Old 06-27-2008, 09:26 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

Only DataSeries objects that are part of the Values collection will show up in the DataBox. Calling Add() to add a plot will add a DataSeries object to this collection. Thus, only DataSeries objects that are used to store values that are plotted will display.
NinjaTrader_Ray is offline  
Reply With Quote
Old 06-28-2008, 04:52 AM   #5
tb2000
Member
 
Join Date: May 2008
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
Default

One idea - for the "wishlist" - would be if you could just "nail" the y position to Top or Bottom (relative to the chart window at time of drawing) and have the x position selectable, kind of a crossing between DrawText or DrawTextFixed

Maybe extending the TextPosition enumeration for DrawTextFixed to "BottomCurrentBar" or "BottomFloating" (etc.) would help.
tb2000 is offline  
Reply With Quote
Old 06-28-2008, 12:08 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Thank you for the suggestion. We will put it on the list of future considerations.
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-10-2009, 06:25 PM   #7
David Lean
Senior Member
 
Join Date: Oct 2009
Location: Australia
Posts: 108
Thanks: 2
Thanked 14 times in 7 posts
Default

Quote:
Originally Posted by tb2000 View Post
One idea - for the "wishlist" - would be if you could just "nail" the y position to Top or Bottom (relative to the chart window at time of drawing) and have the x position selectable, kind of a crossing between DrawText or DrawTextFixed

Maybe extending the TextPosition enumeration for DrawTextFixed to "BottomCurrentBar" or "BottomFloating" (etc.) would help.
This is possible.
Override the Plot method.
Use the bounds parameter for your Y offset. It has a variety of properties like bounds.Top, bounds.Bottom that you can use to accurately place your text or symbols on the chart regardless of where the Price bars change the Y Axis
David Lean is offline  
Reply With Quote
Reply

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
Drawtext spenbm01 Miscellaneous Support 3 06-06-2008 11:23 PM
DrawText API doc? mazachan General Programming 1 03-04-2008 03:12 PM
DrawText Mike Winfrey General Programming 1 12-21-2007 04:57 PM
DrawText, DrawLine, etc... funk101 Indicator Development 2 05-27-2007 01:13 PM
Can not get DrawText to work (NT6) RedDuke General Programming 7 05-13-2007 06:10 PM


All times are GMT -6. The time now is 06:55 AM.