Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Array List in NT 6.5 -- Generates Error

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

    Using Array List in NT 6.5 -- Generates Error

    I am trying to use an ArrayList in Ninja similar to the reference sample shown in this link
    http://www.ninjatrader.com/support/forum/showthread.php?t=5790

    Unfortunately, NT is displaying the following error when I try to compile:
    The type or namespace name 'ArrayList' could not be found (are you missing a using directive or an assembly reference?)

    I have included the ArrayList in variables as follows:
    private ArrayList myDataPoints = new ArrayList();

    which is essentially the same as in the reference sample:
    private ArrayList stopLossTokens = new ArrayList();

    The help code CS0246 is displayed which links to CS0234 which talks about an error that occurs when an imported dll no longer exists or has been removed.

    Any ideas on what is wrong?

    When I was entering the code, the only Array-type classes that show in the auto-complete dropdown are ArrayConverter, ArraySegment<> and ArrayTypeMismatchException. Do I need somehow to extend NT's coding capacities to use an ArrayList?

    #2
    h1000, unfortunately we could really support coding in this area as this is a more general C# topic, but for the error you report trying to use it: can you please ensure using System.Collections is added as well in the declarations section of your custom script?

    Comment


      #3
      Thanks Bertrand, adding System.Collections has cleared the error.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      580 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      336 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      102 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X