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 05-12-2007, 01:07 AM   #1
funk101
Senior Member
 
Join Date: Jan 2006
Location: Margate, Florida, USA
Posts: 426
Thanks: 0
Thanked 2 times in 2 posts
Send a message via AIM to funk101
Default DrawText...Font...how do you use the font param? Can't find any examples

I'm using this overloaded DrawText, 'cept, there are no examples on how to call the Font param. I can't find any examples anywhere, msdn site is painful for this info, please just give me a clue.

DrawText("tslope", tSlope, bar, y+60, ???, StringAlignment.Near, Color.Black, Color.Yellow, 5);
funk101 is offline  
Reply With Quote
Old 05-12-2007, 01:17 AM   #2
funk101
Senior Member
 
Join Date: Jan 2006
Location: Margate, Florida, USA
Posts: 426
Thanks: 0
Thanked 2 times in 2 posts
Send a message via AIM to funk101
Default Figured it out, however...

Is there a "canvas" class? Or someway to have more control over where the text can be drawn? like canvasY and canvasX?
funk101 is offline  
Reply With Quote
Old 05-12-2007, 03:19 AM   #3
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

- you would need to create a font object like e.g. here: http://forums.microsoft.com/MSDN/Sho...23860&SiteId=1
this forum should hold more references. I suggest keeping the font in a variable instead of creating a new one with ever Draw...(...) call.
- you can overwrite the Plot method (like in CustomPlotSample.cs). However, we do not provide in depth support for this functionality (which could cover the complete non-public charting API)
NinjaTrader_Dierk is offline  
Reply With Quote
Old 05-12-2007, 12:33 PM   #4
funk101
Senior Member
 
Join Date: Jan 2006
Location: Margate, Florida, USA
Posts: 426
Thanks: 0
Thanked 2 times in 2 posts
Send a message via AIM to funk101
Default ah!

That was it! Thanks.'Zackly what I needed.
funk101 is offline  
Reply With Quote
Old 05-28-2007, 07:36 PM   #5
scjohn
Senior Member
 
Join Date: Dec 2004
Location: , ,
Posts: 224
Thanks: 0
Thanked 11 times in 8 posts
Default

Is the Font that is set in the Chart Properties available. I would like to use that in my DrawText(). Like to use what that is set as the 'default' for all of my DrawText().

Thanks
scjohn is offline  
Reply With Quote
Old 05-28-2007, 11:44 PM   #6
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Just use this signature and the default chart font will be applied:
public void DrawText(string tag, string text, int barsAgo, double y, Color textColor)
NinjaTrader_Dierk is offline  
Reply With Quote
Old 05-29-2007, 06:50 AM   #7
scjohn
Senior Member
 
Join Date: Dec 2004
Location: , ,
Posts: 224
Thanks: 0
Thanked 11 times in 8 posts
Default

That's ,but I need to color the back ground of the text as the background displays information. So I need to use the extended form of the DrawText().
scjohn is offline  
Reply With Quote
Old 05-29-2007, 07:04 AM   #8
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

This is currently outside what we support but you can take a look at the Plot() method of the VolumeCounter indicator.
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-29-2007, 07:10 AM   #9
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

On the sample I referenced, please make sure you check for null reference on ChartControl otherwise you may see an exception when an indicator is running in a strategy where there is no ChartControl object.
NinjaTrader_Ray 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
Can not get DrawText to work (NT6) RedDuke General Programming 7 05-13-2007 06:10 PM
Bug Report on DrawText() richard Indicator Development 6 06-15-2006 03:47 AM
Looking for MS VB examples R Fitch Automated Trading 1 04-24-2006 03:42 AM
NeoTicker Examples Using ATI Command Language whitmark Automated Trading 3 12-12-2005 02:05 AM
Font size dragon99999 Miscellaneous Support 1 04-26-2005 03:12 AM


All times are GMT -6. The time now is 09:48 AM.