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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      182 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      334 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      258 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      358 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      187 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X