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

Import dll

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

    Import dll

    Hi

    How can I import a DLL and use it on my strategy? Is there a .net framework limitation?

    Thanks

    #2
    What is your goal? This is simply C# so I can't imagine there'd be any limitation to importing a 3rd party library.

    Comment


      #3
      Hello kiss987,

      Thank you for your post.

      If you need to use a dll in a NinjaScript, add the dll file within the ..\Documents\NinjaTrader 8\bin\Custom directory, then add a reference to it by right clicking the NinjaScript editor>References>Add the file you just copied.

      After that, you can add a "using MyDLL;" at the top and use the methods and properties from that dll.

      Please let me know if I can assist further.

      Chris L.NinjaTrader Customer Service

      Comment


        #4
        Chris, could you show a simple example, of strategy in script format, in addition is there not another option making use of
        using System.Runtime.InteropServices
        DLLimport. If so could you do both options. I am more a visual learner and once I see it, I got it.

        Comment


          #5
          Hello JLSwin,

          Thanks for your notes.

          We do not have an example script or video demonstrating this concept at this time. That said, you could open a Windows File Explorer window, navigate to the Documents\NinjaTrader 8\bin\Custom folder, and add the DLL file within this folder.

          Then, open a New > NinjaScript Editor window, right-click in the Editor, select 'References', and add the reference to the file you just put in the Documents\NinjaTrader 8\bin\Custom folder.

          Once the DLL file is added to the Documents\NinjaTrader 8\bin\Custom file and you added a reference to the DLL in the References window, you can add a "using MyDLL;" at the top of your script and use the methods and properties from that DLL.
          Brandon H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CortexZenUSA, Today, 12:53 AM
          0 responses
          1 view
          0 likes
          Last Post CortexZenUSA  
          Started by CortexZenUSA, Today, 12:46 AM
          0 responses
          0 views
          0 likes
          Last Post CortexZenUSA  
          Started by usazencortex, Today, 12:43 AM
          0 responses
          2 views
          0 likes
          Last Post usazencortex  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          168 responses
          2,262 views
          0 likes
          Last Post sidlercom80  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          10 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X