NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM 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 08-31-2007, 05:40 AM   #1
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default BackColor in panel 2

Hi

I want to set the backcolor in panel 2 based on difference between Volume[0] and Volume[1].

The indicator does not work with the code:
if ( Volume[0] < Volume[1] )....

Do I need to refer to the volume array differently?...or collect the data in a different array?

Thanks
Last edited by ATI user; 08-31-2007 at 06:23 AM.
ATI user is offline  
Reply With Quote
Old 08-31-2007, 06:46 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Likely two issues.

1) Set DrawOnPricePanel = false in the Initialize() method. Additional information located here - http://www.ninjatrader-support.com/H...ceOnPanel.html

2) Make sure you add as the first statement in OnBarUpdate()

if (CurrentBar < 1)
return;

When you check Volume[1] on the first bar of a chart, 1 bar ago does not yet exist thus the indicator will not work.
NinjaTrader_Ray is offline  
Reply With Quote
Old 08-31-2007, 06:52 AM   #3
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default

Thanks Ray.

Works perfectly.

Just adding the second suggestion fixed problem.
Last edited by ATI user; 08-31-2007 at 08:22 PM.
ATI user is offline  
Reply With Quote
Old 08-31-2007, 08:22 PM   #4
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default

Ray

Now I want to DrawDot above the volume bar. Does not accept that for some reason. It drew the dot above the price bar until I put in your suggestion #1. Now no dot anywhere.

Thanks
ATI user is offline  
Reply With Quote
Old 09-01-2007, 09:39 AM   #5
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

You have to do this by setting the indicator to the same panel as the Volume indicator when adding the indicator to a chart and setting in the indicator itself, set the DrawOnPricePanel property to false.

http://www.ninjatrader-support.com/H...ceOnPanel.html
NinjaTrader_Ray 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
Woodie CCI Panel PrTester Indicator Development 1 03-29-2012 09:37 PM
BackColor in Strategy NinjaTrader_Josh Strategy Development 11 05-31-2007 02:17 PM
Chart Data off of panel BradB Charting 1 04-09-2007 06:56 AM
How to select the next available chart panel zoltran Indicator Development 5 03-28-2007 06:26 AM
bravo on the new order control panel! bearwatch Suggestions And Feedback 1 01-20-2006 10:55 AM


All times are GMT -6. The time now is 08:25 AM.