![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
|
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.
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
|
Thanks Ray.
Works perfectly. Just adding the second suggestion fixed problem.
Last edited by ATI user; 08-31-2007 at 08:22 PM.
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
|
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 |
|
|
|
|
|
#5 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |