![]() |
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: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
I'm trying to code a Fibonacci Bollinger indicator. I'm getting an "index outside the bounds of the array" error in the log. I do not know what this means exactly, so I'm at a bit of a loss to correct it...the code is a modification of the Bollinger Bands code: privatedouble numStdDev = 2; privateint period = 14; double factor1 = 1.618; protectedoverridevoid Initialize() { Add(new Plot(Color.Cyan, "Upper band")); Add(new Plot(Color.Green, "Middle band")); Add(new Plot(Color.Orange, "Lower band")); } protectedoverridevoid OnBarUpdate() { Upper.Set(SMA(Close, Period)[0] + NumStdDev * (factor1 * ATR(Period)[0])); Middle.Set(SMA(Close, Period)[0]); Lower.Set(SMA(Close, Period)[0] - NumStdDev * (factor1 * ATR(Period)[0])); } Any clues on the cause and/or meaning of the error? |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Session times/bar calc | nicko9 | Market Analyzer | 5 | 05-25-2009 12:55 AM |
| Calc an angle? | Burga1 | Indicator Development | 1 | 01-29-2008 09:52 AM |
| CCT Bollinger & CCT Keltner | mav8rick | NinjaScript File Sharing Discussion | 2 | 12-22-2007 04:30 AM |
| Bollinger Bands & RSI | garciaal | Indicator Development | 1 | 10-29-2007 02:06 PM |
| Bollinger Bands setting | Quicktrader10 | Charting | 1 | 10-04-2006 03:59 PM |