NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 08-21-2008, 03:02 AM   #1
snaphook
Senior Member
 
Join Date: Apr 2008
Posts: 376
Thanks: 0
Thanked 20 times in 11 posts
Default DrawText font keeps resetting to default

DrawText(CurrentBar.ToString()+"FamirTriggerS",tru e,"F\ne",0,TextAnchorS-SignalLabels.SizeInPoints,FamirColorS,SignalLabels ,StringAlignment.Center,Color.White,Color.White,10 );

I've used the above to draw text on a chart; however, if I change the font from the default, it returns to the default font on the next chart opening. I have tried to save it as a template to capture the font but that doesn't seem to work, either.

Is there a secret I should know to allow the font to be changed and saved with the workspace/template so it doesn't need to be reset each time I open a chart(s)?

Snap

p.s. odd about that space in tru e in the command. It is not there in the NinjaScript and I can't get it to go away in this post. I've even backspaced over the entire word, previewed it w/o the true and reentered the true. The space is still there. Hmmmm
snaphook is offline  
Reply With Quote
Old 08-21-2008, 07:55 AM   #2
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

Not sure I follow.
Please see how to draw text using a font parameter: http://www.ninjatrader-support.com/H.../DrawText.html
NinjaTrader_Dierk is offline  
Reply With Quote
Old 08-21-2008, 08:08 AM   #3
snaphook
Senior Member
 
Join Date: Apr 2008
Posts: 376
Thanks: 0
Thanked 20 times in 11 posts
Default

I declared the variable: private Font signalLabels = new Font("Tahoma", 10);

and serialized it as:
[XmlIgnore()]
[Description("Signal Font to use")]
[Category("Sound and Display")]
[Gui.Design.DisplayName("Signal Font")]
public Font SignalLabels
{
get { return signalLabels; }
set { signalLabels = value; }
}

If I go to the indicator parameters and select a different face, size, style, etc., save the workspace and a template and close the chart, when I reopen the chart or workspace or apply the saved template, the font the text is written in is always the default. I need to go back in and change to a different size, face, style, etc. each and every time.

Snap
snaphook is offline  
Reply With Quote
Old 08-21-2008, 08:14 AM   #4
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

Unfortunately this is beyond what we provide support for. However, here is a hint: please check out the HeikenAshi indicator for ShadowColor/ShadowColorSerialize properties, the same issue is with the "Color" structure.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 08-21-2008, 08:22 AM   #5
snaphook
Senior Member
 
Join Date: Apr 2008
Posts: 376
Thanks: 0
Thanked 20 times in 11 posts
Default

I'll check it out.
Thanks
snaphook is offline  
Reply With Quote
Old 08-21-2008, 08:42 AM   #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

Actually we have a tip on this: http://www.ninjatrader-support.com/v...ead.php?t=4977
NinjaTrader_Dierk 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
Resetting SIM trades gygraham Strategy Analyzer 1 04-14-2008 07:01 PM
Data box Font size latkinso Charting 1 03-10-2008 12:56 PM
DrawText...Font...how do you use the font param? Can't find any examples funk101 General Programming 8 05-29-2007 07:10 AM
Ninjascript editor default indent, tab, font size Folls General Programming 11 05-21-2007 11:40 AM
Font size dragon99999 Miscellaneous Support 1 04-26-2005 03:12 AM


All times are GMT -6. The time now is 05:47 AM.