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 06-17-2009, 10:56 AM   #1
maxpi
Senior Member
 
Join Date: Jun 2007
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
Default Rectangle won't draw

The following code won't draw the rectangle on tick charts.

protected override void OnBarUpdate()
{
DrawRectangle("tag1", 10, Low[10], 5, High[5], Color.PaleGreen, Color.PaleGreen, 2);
}
maxpi is offline  
Reply With Quote
Old 06-17-2009, 10:59 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Please see this tip: http://www.ninjatrader-support2.com/...ead.php?t=3170
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-17-2009, 02:10 PM   #3
maxpi
Senior Member
 
Join Date: Jun 2007
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
Default

I got rectangles to draw in my indicator. I can draw a rectangle on the price pane but it's bad, I have to scale things to fit the price range. I cannot get the same code to draw a rectangle in panel2... I added the line DrawOnPricePanel =false to the initializations but nothing draws on panel2. Panel2 just sits there with a scale of 0 to 1...

I can't get it to overlay on the price either. I assume that would take care of all the scaling work...
Last edited by maxpi; 06-17-2009 at 02:21 PM.
maxpi is offline  
Reply With Quote
Old 06-17-2009, 02:21 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

You actually need something populating panel 2 if you want to draw in there. Please add a plot there and try again.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-17-2009, 03:15 PM   #5
maxpi
Senior Member
 
Join Date: Jun 2007
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
Default

It draws just vertical lines on panel2. They appear to be where the right and left edge of the rectangles are intended to be. They all have a height of 1 and the panel2 scale is 1. I can print the values at the time of generating the draw objects, they are not 1, ever..
maxpi is offline  
Reply With Quote
Old 06-17-2009, 03:20 PM   #6
maxpi
Senior Member
 
Join Date: Jun 2007
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
Default

I added in the plot by copy /paste from another indicator. It does not show up in the indicator properties as applied to the chart.. Can I fix that or is it necessary to step through the wizard and generate a new indicator?
maxpi 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
Draw a rectangle to group 3 bars Winnie Indicator Development 1 03-31-2009 05:57 AM
Fancy Rectangle pdavidow Charting 9 03-16-2009 09:04 AM
Rectangle question 5iver Charting 2 11-01-2008 03:14 PM
Rectangle disappears SteveB Charting 2 07-15-2008 08:51 AM
Draw tools that draw on multiple charts of the same instrument cipher4d Suggestions And Feedback 3 04-19-2008 12:33 AM


All times are GMT -6. The time now is 03:18 AM.