Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by BarzTrading, Today, 07:25 AM
    2 responses
    17 views
    1 like
    Last Post BarzTrading  
    Started by devatechnologies, 04-14-2024, 02:58 PM
    3 responses
    20 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by tkaboris, Today, 08:01 AM
    0 responses
    4 views
    0 likes
    Last Post tkaboris  
    Started by EB Worx, 04-04-2023, 02:34 AM
    7 responses
    163 views
    0 likes
    Last Post VFI26
    by VFI26
     
    Started by Mizzouman1, Today, 07:35 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X