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 > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 01-16-2009, 02:06 PM   #1
Lost Trader
Senior Member
 
Join Date: Oct 2007
Location: Tucson, AZ
Posts: 368
Thanks: 2
Thanked 2 times in 2 posts
Default DrawText etc

I am trying to use DrawText() in an indicator on Volume (so it is in the Volume Pane 2 and not the Price Panel). No output appears.

Do these Draw routines work in other panes??

If not, how can I add a mark to Volume bars? e.g., a single text character just over the volume bar?
Lost Trader is offline  
Reply With Quote
Old 01-16-2009, 03:20 PM   #2
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

Please set DrawOnPricePanel = false.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-16-2009, 03:44 PM   #3
Lost Trader
Senior Member
 
Join Date: Oct 2007
Location: Tucson, AZ
Posts: 368
Thanks: 2
Thanked 2 times in 2 posts
Default

Oddly enough, Josh, I already did that in the Initialize() method.
DrawOnPricePanel = false;
It did not help... :-)

Any other suggestions? What I started with is VERY simple:

if (Volume[0] > Volume[1]) // increasing bar-to-bar
DrawText("V"+CurrentBar, riseMarker, 0, Volume[0], tColor);

even tried the looong version:
DrawText("V"+CurrentBar, true, riseMarker, 0, Volume[0], yPixels, tColor, fp, StringAlignment.Center, Color.Empty, Color.Empty, 10) ;

BTW, the varibles yPixelOffset in the doc says double but generates an error if not int.
Lost Trader is offline  
Reply With Quote
Old 01-16-2009, 03:53 PM   #4
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

yPixelOffset is suppose to be an integer. You cannot offset a decimal pixel value.

Check your Control Center logs for errors. Have you run into this? http://www.ninjatrader-support2.com/...ead.php?t=3170
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-18-2009, 10:09 AM   #5
Lost Trader
Senior Member
 
Join Date: Oct 2007
Location: Tucson, AZ
Posts: 368
Thanks: 2
Thanked 2 times in 2 posts
Default

Ah! I do not know why I forget to check the log when changing an indicator. I had removed the check for CurrentBar < 1 because I added BarsRequired = 2 -- silly me thinking that covered it. Thank you.

BTW, you should update your online help text for DrawText() which says that yPixelOffset is a double. :-)
Lost Trader 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 into Data Box tb2000 General Programming 6 12-10-2009 06:25 PM
DrawText and DrawTextFixed TAJTrades General Programming 8 12-19-2008 10:24 AM
Drawtext spenbm01 Miscellaneous Support 3 06-06-2008 11:23 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


All times are GMT -6. The time now is 05:28 PM.