NinjaTrader Support Forum  

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 05-31-2009, 09:18 AM   #1
TAJTrades
Senior Member
 
Join Date: Dec 2007
Location: Atlanta
Posts: 281
Thanks: 0
Thanked 4 times in 3 posts
Default DrawText() and Autoscale

I am having an issue when using DrawText and setting the AutoScale to false. Could you folks test this on your end to determine if it is a "Me" issue or NT issue. The image included shows the issue. This is the code that I am using:

#region Variables
// Wizard generated variables
private int myInput0 = 1; // Default setting for MyInput0
private System.Drawing.Font textFont;
#endregion

protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
CalculateOnBarClose = true;
Overlay = true;
PriceTypeSupported = false;
textFont = new Font("Arial", 16 );
}

protected override void OnBarUpdate()
{

if (ToTime(Time[0]) == 151500 )
DrawText( "test" + CurrentBar.ToString(),
false,
"Test Something",
0,
High[0] + 100 * TickSize,
0,
Color.Black,
textFont,
StringAlignment.Center,
Color.Transparent,
Color.Transparent,
0);

}



Thanks. You guys are great.
Attached Images
File Type: png Ninja001.png (84.1 KB, 45 views)
TAJTrades is offline  
Reply With Quote
Old 05-31-2009, 10:55 AM   #2
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

What is it you are trying to accomplish? The issue is not apparent to me from your screen shot.
NinjaTrader_Ben is offline  
Reply With Quote
Old 05-31-2009, 01:18 PM   #3
TAJTrades
Senior Member
 
Join Date: Dec 2007
Location: Atlanta
Posts: 281
Thanks: 0
Thanked 4 times in 3 posts
Default

Quote:
Originally Posted by NinjaTrader_Ben View Post
Hello,

What is it you are trying to accomplish? The issue is not apparent to me from your screen shot.
The DrawText(....) command has the Autoscale variable set to false (see the Arrow Line in the image) yet when I open the Text Properties it is set to true (see the Arrow Line in the image). Also the text "Test Something" should not be visible as it is above the highest price bar .

When I open the Text Properties and UnCheck the "Auto scale" it performs as expected. I don't have this issue with DrawLine, DrawArrowUp, DrawArrowDown, DrawRectangle when setting the AutoScale variable to true or false.

That leads me to believe that POSSIBLY the DrawText command is not handling the AutoScale correctly or something is not working correctly on my computer. One or the other. That is the reason I ask if it could be confirmed as a "Me" issue or NT issue. I have tried everything that I can think of and have not found a solution to the problem.
TAJTrades is offline  
Reply With Quote
Old 05-31-2009, 07:21 PM   #4
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

I will have someone take a look at this on Monday. Thank you for your patience.
NinjaTrader_Ben is offline  
Reply With Quote
Old 06-01-2009, 04:04 AM   #5
TAJTrades
Senior Member
 
Join Date: Dec 2007
Location: Atlanta
Posts: 281
Thanks: 0
Thanked 4 times in 3 posts
Default

Now I am confused. Monday morning and I just started NT and the AutoScale is working as expected for the DrawText(...) command. Will watch and report. Maybe I was doing something wrong or it is an issue with my computer. Clueless at the moment.
TAJTrades is offline  
Reply With Quote
Old 06-01-2009, 05:18 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Ok, thanks for reporting back - did you try this in a brand new chart and workspace? Do you see any errors in the logs if this happens? If it happends again, please reference this thread and send us your log and trace through the Help > Mail to Support feature - thanks!
NinjaTrader_Bertrand 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
AutoScale hegh2000 Indicator Development 4 05-18-2009 01:42 PM
DrawHorizontalLine/Autoscale hemlock Charting 6 05-05-2009 08:26 AM
Turning off AutoScale using a custom indicator Newton Charting 1 01-14-2009 01:10 PM
Autoscale on Horizontal Line chantj General Programming 6 03-26-2008 10:15 AM
DrawText AutoScale property no longer works Rollins Historical NinjaTrader 6.5 Beta Threads 4 02-25-2008 05:36 AM


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