![]() |
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 |
|
Junior Member
Join Date: Jun 2006
Location: , ,
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
|
This simple ColorBar indicator is not working. Can someone help?
Here is the code: ==================== protected override void OnBarUpdate() { //Are there enough bars //if (CurrentBar < Period) return; // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. if (Close[0] > Open[0] && Close[0] > High[1]) { BarColor = Color.Blue; } else if (Close[0] < Open[0] && Close[0] < Low[1]) { BarColor = Color.Red; } else if (Close[0] >= Low[1] && Close[0] <= High[1]) { BarColor = Color.Black; } } =============== end thanks!!! |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Hello,
Please put this at the top of your OnBarUpdate() block and see if it helps: if(CurrentBar < 1) return; (Or just delete the "//" marks from left of the CurrentBar condition you already have.) This link will help: http://www.ninjatrader-support.com/v...ead.php?t=3170 What is probably happening is you are referring to an index of 1 before it exists.
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2007
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
|
Hello,
If you have the paint bar indicator or have ben able to get one do you mind sharing? I use only bars when trading, I see there are lots of heikin ashi indicators in this forum but nothing for strickly bars? Please let me know, if I have to pay I will. thanks, Colin |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CCI (or any indicator) with changing color | Jibu V | Indicator Development | 10 | 09-24-2010 07:07 AM |
| Select Color from Indicator Dialogue? | tazatek | Indicator Development | 1 | 07-28-2008 03:36 PM |
| Color Stochastic/2-line Indicator | jeremymgp | NinjaScript File Sharing Discussion | 11 | 01-05-2008 12:27 PM |
| Changing color of indicator and save it | ceesvh | Charting | 1 | 08-02-2007 02:47 PM |
| Use Indicator plot color in DrawLine() | MJT | Indicator Development | 1 | 06-01-2007 03:13 PM |