Announcement

Collapse
No announcement yet.

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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      157 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      91 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      143 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      130 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X