Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot use System.Collections?!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?

    #2
    dilbert67,

    Please provide the full error message. Thank you.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      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
      }
      }


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

      Comment


        #4
        Please try Hashtable without the capital T.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          i guess i qualified as the idiot of the week

          :-)

          thanks anyway

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          574 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X