NinjaTrader Support Forum  
X

Attention!

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


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

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 12-15-2009, 12:32 PM   #1
dilbert67
Junior Member
 
Join Date: Nov 2009
Location: Frankfurt, Germany
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default Cannot use System.Collections?!

Hi,

I created a new strategy with the wizard and added

using System.Collections;
...
HashTable foo=new HashTable();

Intellisense knows HashTable but I get CS0246. According to Google System.Collections is part of System.dll which is listed in my references (rightclick, refs). Whats wrong?
dilbert67 is offline  
Reply With Quote
Old 12-15-2009, 01:47 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

dilbert67,

Please provide the full error message. Thank you.
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-15-2009, 01:52 PM   #3
dilbert67
Junior Member
 
Join Date: Nov 2009
Location: Frankfurt, Germany
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default

hi,

the localized msg is

"Strategy\MyCustomStrategy2.cs Der Typ- oder Namespacename HashTable konnte nicht gefunden werden. (Fehlt eine using-Direktive oder ein Assemblyverweis?) CS0246 - click for info 30 3"

eg "type or namespacename hashtable cannot be found (Missing using directive or assembly ref?)

#####################

#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
using System.Collections;

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class MyCustomStrategy2 : Strategy
{
#region Variables
// Wizard generated variables
private int myInput0 = 1; // Default setting for MyInput0
// User defined variables (add any user defined variables below)
#endregion
HashTable foo;

/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
}

#region Properties
[Description("")]
[Category("Parameters")]
public int MyInput0
{
get { return myInput0; }
set { myInput0 = Math.Max(1, value); }
}
#endregion
}
}


#####################
dilbert67 is offline  
Reply With Quote
Old 12-15-2009, 02:05 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Please try Hashtable without the capital T.
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-15-2009, 02:09 PM   #5
dilbert67
Junior Member
 
Join Date: Nov 2009
Location: Frankfurt, Germany
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default

i guess i qualified as the idiot of the week

:-)

thanks anyway
dilbert67 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
System parameters. Davizito General Programming 4 10-22-2009 12:07 PM
My System peterdias77 Strategy Development 5 02-02-2009 07:22 AM
Bar price collections in GetMinMaxValues() windcatcher Indicator Development 2 08-02-2008 12:50 PM
Editor Bug - Intellisence doesn't work properly with Generics Collections shawnj General Programming 2 05-26-2008 10:16 PM
windows collections cls71 General Programming 1 03-26-2008 04:20 AM


All times are GMT -6. The time now is 07:08 AM.