Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot access class SynchronizedKeyedCollection in NinjaTrader Editor

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

    Cannot access class SynchronizedKeyedCollection in NinjaTrader Editor

    It is my understanding that NinjaTrader 8 is based on .NET Framework 4.5.

    I am trying to create a SynchronizedKeyedCollection object within my indicator, but I am unable to access this class, even though the directive "using System.Collections.Generic" is present in my source code.

    According to https://docs.microsoft.com/en-us/dot...tframework-4.5 this class should have been accessible.
    Does NinjaTrader Editor limit the number of classes which can be used even though the entire namespace is referenced?

    Thanks!

    #2
    Hello MarianApalaghiei,

    Thank you for the post.

    One note about the MSDN documents is the Assembly it lists at the top.

    SynchronizedKeyedCollection<K,T> Class
    Definition
    Namespace:
    System.Collections.Generic
    Assembly:
    System.ServiceModel.dll
    In this case it uses an assembly which is not referenced yet. While this is part of .net, you need to let NinjaTrader know you want to use that part.

    For system references I generally suggest editing the config file. This allows you to use the same standard formatting that is used with the other .net references to acquire them from the GAC (global assembly cache). Other references you would generally use the Right click -> References menu from the NinjaScript editor and place the .dll in the bin/custom folder.

    To do this you would do the following:
    • Exit NT8
    • Open the folder: Documents\NinjaTrader 8
    • Make a copy of your Config.xml file before editing it
    • Open the Config.xml in notepad or a basic text editor, not MSword.
    • You will see lines like the following:
    <string>System.Xaml.dll</string>
    <string>System.Xml.dll</string>
    <string>System.Xml.Linq.dll</string>
    • Add the reference you want to the list so it looks the same as the other entries:
    <string>System.Xml.Linq.dll</string>
    <string>System.ServiceModel.dll</string>
    • Make sure not to add anything extra to the file, just one line of text below the other references like above.
    • Start NT8 and recompile.
    If you don't feel comfortable editing the config file, please reach out to our platformsupport[at]ninjatrader.com email.


    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

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