NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


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-12-2011, 02:46 PM   #1
tulanch
Member
 
Join Date: Jul 2009
Posts: 85
Thanks: 2
Thanked 4 times in 3 posts
Default What controls default Z order using Plot in indicator

I two indicators that I have created.

One draws lines over candle bodies, the other draws lines behind the bodies.

What is controlling this behavior?
tulanch is offline  
Reply With Quote
Old 06-12-2011, 03:28 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,794
Thanks: 160
Thanked 568 times in 559 posts
Default

Hello tulanch,

Thank you for your post.

The order is determined by the order in which the plots were added to the chart. This cannot be changed programmatically, other than the order in which you are adding it.

You can also change the Z-order manually from the chart itself

New Chart Object Paint Ordering (z-order)
As you select any object on a chart, hold down the SHIFT key and scroll with your mouse wheel, you can change the paint layer of the selected object in order to move it in front of or behind other drawn objects. In the image below, the rectangle is selected and is currently on "Level 5 of 5" meaning, it is at the very bottom of the paint order. You could scroll your mouse wheel to "Level 1 of 5" which would put the rectangle on top of all others objects.
NinjaTrader_Matthew is offline  
Reply With Quote
Old 06-12-2011, 06:31 PM   #3
koganam
Senior Member
 
Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,219
Thanks: 24
Thanked 1,231 times in 1,002 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by tulanch View Post
I two indicators that I have created.

One draws lines over candle bodies, the other draws lines behind the bodies.

What is controlling this behavior?
If you want to force the indicator to plot behind the price bars, give the whole indicator a negative z-order. Conversely to plot on top of the price bars, give the indicator a high z-order.

Code:
Initialize()
{
// ...
Z-Order = -10; // forces a plot behind the price bars
}
koganam is offline  
Reply With Quote
Old 06-13-2011, 07:16 AM   #4
tulanch
Member
 
Join Date: Jul 2009
Posts: 85
Thanks: 2
Thanked 4 times in 3 posts
Default

As I mentioned I have 2 indicators I am comparing. When I first started this thread, neither of them had any Z order work done, yet one plotted infront and the other plotted behind.

In the one which is behind, I've attempted to use both methods, but neither seem to affect this display. I will mucking around with it... and report back.... I need to make the indicator selectable.

Also in the one that does have the drawline in front, it has a region draw behind where as the other does not, perhaps that has some impact...
tulanch is offline  
Reply With Quote
Old 06-13-2011, 10:55 AM   #5
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

To change z order on your own select one of the data series or indicators and then hold down shift and then scroll with your mouse wheel will allow you to push an indicator's z order below the other if you needed this done.

Let me know if I can be of further assistance.
NinjaTrader_Brett is offline  
Reply With Quote
Old 06-13-2011, 07:02 PM   #6
tulanch
Member
 
Join Date: Jul 2009
Posts: 85
Thanks: 2
Thanked 4 times in 3 posts
Default

I belive I found an issue....

At one point in the past I changed the chart property
"Allow the selection or drag/drop of a chart series " from True to False as I do a lot of trading on the chart and don't want to pick things...just a person preference...

this is why I could not select it and change the Z order per prior instructions...

Once I did set this back to True, I was able to change the Z order...

Also, once I did this I could change the Z order value in the Indicator initiate method

again, all working fine...

But, if the chart I put the indicator in was created/initiated with
"Allow the selection or drag/drop of a chart series " set to False.... (ie using a chart template) then
the Z order value set within the initiate method seems to do nothing....and the drawn items are behind the candle bars.... I can repeat this... perhaps this is just be design...

to me weirdness explained and I can managed....

maybe this thread will help others in future...
tulanch 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
Z Order controls Light Version 7 Beta General Questions & Bug Reports 5 08-16-2010 09:50 AM
plot dash as default velocity General Programming 2 02-04-2010 04:05 PM
Single plot Price Panel Display with multiple plot indicator cclsys Indicator Development 5 11-19-2009 12:41 PM
Changing default plot display behavior question redviking121 Charting 1 03-19-2009 09:05 AM
Default Plot Width and Location.. nmussa General Programming 5 10-16-2007 07:00 AM


All times are GMT -6. The time now is 02:37 PM.