![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Nov 2011
Posts: 55
Thanks: 18
Thanked 3 times in 3 posts
|
I thought declaring a list is like this:
Code:
List<double> s = new List<double>(); Code:
The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?) Thanks in advance, Sergio |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
Hi Sergio, it looks like you have not added using System.Collections; to your script's declaration section?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Nov 2011
Posts: 55
Thanks: 18
Thanked 3 times in 3 posts
|
How can I do that?
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
In your script directly, go to the top section called 'Using Declarations', expand it and add
Code:
using System.Collections;
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Nov 2011
Posts: 55
Thanks: 18
Thanked 3 times in 3 posts
|
Didn't work. Same error.
EDIT:With Code:
System.Collections.Generic; |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
My bad, you're right for the List it needs System.Collections.Generic, for ArrayList the System.Collections
Glad it compiles now.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Bertrand for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Declaring a Color in Variables | Stopped | General Programming | 2 | 05-11-2012 12:13 PM |
| Declaring and Setting a Public Variable | DenMan | Indicator Development | 6 | 10-14-2011 08:33 AM |
| NT crashes when importing symbol list when symbols already exist in the list | cunparis | Miscellaneous Support | 5 | 03-21-2009 04:09 AM |
| Declaring a default constructor gives NT the hiccups | jbeninga | Strategy Development | 6 | 04-08-2008 01:25 AM |
| If NT crashes after importing symbol list, list is not saved | Pete S | Historical NinjaTrader 6.5 Beta Threads | 4 | 03-16-2008 06:10 AM |