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 Barry Milan, Yesterday, 10:35 PM
      5 responses
      17 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by DanielSanMartin, Yesterday, 02:37 PM
      2 responses
      13 views
      0 likes
      Last Post DanielSanMartin  
      Started by DJ888, 04-16-2024, 06:09 PM
      4 responses
      13 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by terofs, Today, 04:18 PM
      0 responses
      12 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by nandhumca, Today, 03:41 PM
      0 responses
      8 views
      0 likes
      Last Post nandhumca  
      Working...
      X