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