NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 04-05-2008, 12:59 PM   #1
lgarcia3
Senior Member
 
Join Date: Apr 2008
Posts: 105
Thanks: 0
Thanked 1 time in 1 post
Default Index out of range error

I am programming an indicator and I was not seeing the plot. I started a debug session with Visual Studio and got an "Index out of range error" exception when trying to get the value of Close[1]. If I understand well, if I want the current value of Close, I get the value at 0 like Close[0], correct? If I want the previous value, I have to do Close[1], right? So? What is going on? Why do I get this error?
Thanks!
lgarcia3 is offline  
Reply With Quote
Old 04-05-2008, 01:09 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

The following tip will provide some guidance.

http://www.ninjatrader-support.com/v...ead.php?t=3170
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-06-2008, 08:42 AM   #3
lgarcia3
Senior Member
 
Join Date: Apr 2008
Posts: 105
Thanks: 0
Thanked 1 time in 1 post
Default

Ok, yes, that did it. Thanks!
lgarcia3 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
NT 6.5.9 DrawLine out of range error astrolobe General Programming 5 02-19-2008 04:16 AM
CurrentDayOHL error in Range Bar charts GerhardS Historical NinjaTrader 6.5 Beta Threads 1 02-15-2008 03:56 PM
Range Bar Charts Error in Historical Data Laenxin Charting 1 01-28-2008 01:52 PM
Index out of bounds error... funk101 Indicator Development 5 05-23-2007 03:20 PM
Symbol Mapping - stock index to futures index contract tmd Automated Trading 9 12-07-2006 09:53 AM


All times are GMT -6. The time now is 07:27 PM.