Announcement

Collapse
No announcement yet.

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.

      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.
          <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          71 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          143 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          76 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          47 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          51 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X