Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can't use my own DLL in my strategy

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

    Can't use my own DLL in my strategy

    I created an NT8 strategy. Has main thin .cs file and all business logic is in a .DLL
    1. I added the code from the .cs file into a new strategy in NinjaScript editor.
    2. I added my custom DLL as a reference. The DLL is in /bin/Custom folder.
    3. The strategy code in the ninjascript editor has `using MyDLL;`
    4. It compiles without errors.
    5. However, if i go Tools > Export > Ninjascript Addon and attempt to export my addon to a NinjaScript zip file, I get errors in log indicating it failed to find the referenced DLL (type or namespace name MyDLL does not exist):

      "error CS0246: The type or namespace name 'MyNamespace' could not be found"
    How can I fix this? Claude suggests it's because I need to sign my assembly (DLL) in Visual Studio... That seems weird.
    I'm stuck.

    UPDATE:
    I did not realize that I have to manually select the references to include in the export build. I have done so and it exports as desired.
    Last edited by iantriestrading; 11-11-2024, 01:54 PM.

    #2
    Hello iantriestrading,

    I'm happy to hear you were able to work this out.

    Yes, when exporting all dependencies should be included with the export. With dlls, this will be a reference to the dll, but then the dll should be manually added to the export .zip.

    Below is a link to a video demonstrating.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hey again, update! So I realized the problem was I needed to drag my referenced DLL into the exported assembly zip file. I had named it the same as the export so that confused me, thinking that the DLL inside the zip was the one I needed. 😆

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      68 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X