![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
|
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); |
|
|
|
|
|
#2 |
|
Senior Member
|
Is there a "canvas" class? Or someway to have more control over where the text can be drawn? like canvasY and canvasX?
|
|
|
|
|
|
#3 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
- 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)
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#4 |
|
Senior Member
|
That was it! Thanks.'Zackly what I needed.
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Dec 2004
Location: , ,
Posts: 224
Thanks: 0
Thanked 11 times in 8 posts
|
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 |
|
|
|
|
|
#6 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
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)
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Dec 2004
Location: , ,
Posts: 224
Thanks: 0
Thanked 11 times in 8 posts
|
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().
|
|
|
|
|
|
#8 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
This is currently outside what we support but you can take a look at the Plot() method of the VolumeCounter indicator.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |