NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Charting

Charting Support for NinjaTrader Advanced Charting.

Reply
 
Thread Tools Display Modes
Old 05-04-2009, 11:53 AM   #1
hemlock
Senior Member
 
Join Date: Nov 2007
Location: Michigan, USA
Posts: 116
Thanks: 1
Thanked 0 times in 0 posts
Default DrawHorizontalLine/Autoscale

It appears that autoscale is always set to true when drawing a horizontal line even if false is specified...

Code:
protectedoverridevoid Initialize()
{
CalculateOnBarClose = true;
Overlay = true;
PriceTypeSupported = false;
}
protectedoverridevoid OnBarUpdate()
{
DrawHorizontalLine("line1", false, Close[0], Color.Blue, DashStyle.Solid, 2);
}
Last edited by hemlock; 05-04-2009 at 11:59 AM.
hemlock is offline  
Reply With Quote
Old 05-04-2009, 12:02 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

I am not getting the behavior you described. I get a line drawn at Close[0] which is expected. As I scroll back the line does not stay in view because AutoScale = false.
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-04-2009, 12:13 PM   #3
hemlock
Senior Member
 
Join Date: Nov 2007
Location: Michigan, USA
Posts: 116
Thanks: 1
Thanked 0 times in 0 posts
Default

That's odd. It may have something to do with the 'default' for manually drawn lines. Try setting the default to autoscale=true for a manually drawn horz line and then try the script again.
Last edited by hemlock; 05-04-2009 at 12:19 PM.
hemlock is offline  
Reply With Quote
Old 05-04-2009, 12:57 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

hemlock,

No difference. Manually draw lines should not influence your code. Please ensure you have no other indicators/draw objects on the chart that may give the illusion your line is on AutoScale = true when set to false.
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-04-2009, 01:20 PM   #5
hemlock
Senior Member
 
Join Date: Nov 2007
Location: Michigan, USA
Posts: 116
Thanks: 1
Thanked 0 times in 0 posts
Default

Josh,

Hmmm, not true here.

Preparation:
1. Close and restart NinjaTrader version 6.5.1000.9.
2. Close all NT windows except Control Center.
3. Connect to Interactive Brokers.

Test #1:
1. Open ES 5 minute chart using default template (price bars and VOL only)
2. Press F6 to manually draw horizontal line.
3. Double click on horizontal line to edit properties.
4. Turn autoscale ON, click apply, click "set default".
5. Delete manually drawn line.
6. Add indicator kpTest3 (see attached).
7. Double click on script generated horizontal line. Autoscale is set to true (should not be).
8. Close chart.

Test #2:
1. Open ES 5 minute chart using default template (price bars and VOL only)
2. Press F6 to manually draw horizontal line.
3. Double click on horizontal line to edit properties.
4. Turn autoscale OFF, click "apply", click "set default".
5. Delete manually drawn line.
6. Add indicator kpTest3 (see attached).
7. Double click on script generated horizontal line. Autoscale is set to false (correct).
8. Close chart.
Attached Files
File Type: zip kpTest3.zip (1.3 KB, 7 views)
hemlock is offline  
Reply With Quote
Old 05-04-2009, 01:39 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

We will look into it. Thank you.
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-05-2009, 08:26 AM   #7
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Thank you for bringing this up. It will be addressed in a future version.
NinjaTrader_Josh 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
DrawHorizontalLine xewoox General Programming 1 01-29-2009 08:33 AM
Turning off AutoScale using a custom indicator Newton Charting 1 01-14-2009 01:10 PM
DrawHorizontalLine bobmike General Programming 4 09-09-2008 05:02 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 04:25 PM.