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

ClassLibrary .DLL

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

    ClassLibrary .DLL

    If i have a ClassLibrary

    Code:
    namespace ClassLibrary1
    {
        public static class Class1
        {
            public static string Hello()
            {
                return "hello";
            }
        }
    }


    then I reference it in my Ninjascript, It seems like I can't do this at all

    Code:
            /// <summary>
            /// This method is used to configure the indicator and is called once before any bar data is loaded.
            /// </summary>
            protected override void Initialize()
            {    //    
                
                
                Class1.Hello();
                
                Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                Overlay                = false;
            }

    ofcourse i have the Using Directives and what not. Is this not supported or Am i doing something wrong?

    #2
    Hello Sherif,

    To use an external assembly:
    Make sure the assembly is placed in Documents\bin\custom
    Add reference to this file using a NinjaScript editor. Right Click > References > Add the file.
    Restart NinjaTrader after adding the reference.

    You should then have access to the components of your custom dll.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Got it. I never restarted. Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ScottWalsh, Today, 06:52 PM
      2 responses
      15 views
      0 likes
      Last Post ScottWalsh  
      Started by cre8able, Today, 07:24 PM
      0 responses
      0 views
      0 likes
      Last Post cre8able  
      Started by Haiasi, Today, 06:53 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by ScottW, Today, 06:09 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by ftsc2022, 10-25-2022, 12:03 PM
      5 responses
      256 views
      0 likes
      Last Post KeyonMatthews  
      Working...
      X