View Full Version : Cannot use System.Collections?!
dilbert67
12-15-2009, 12:32 PM
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?
NinjaTrader_Josh
12-15-2009, 01:47 PM
dilbert67,
Please provide the full error message. Thank you.
dilbert67
12-15-2009, 01:52 PM
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
}
}
#####################
NinjaTrader_Josh
12-15-2009, 02:05 PM
Please try Hashtable without the capital T.
dilbert67
12-15-2009, 02:09 PM
i guess i qualified as the idiot of the week
:-)
thanks anyway