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

Calling DLL from strategy

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

    Calling DLL from strategy

    I am using version 7. I am attempting to call a DLL function from my strategy. I have added all of the relevant DLL's in the bin/custom directory. I have referenced the DLL and the strategy builds successfully. The initialisation fails with an error: Could not load file or assembly ... The system cannot find the file specified. A similar exercise in version 6.5 worked. Are there any changes in the new release that would cause this error? Is there a way of finding which file is missing?

    #2
    Originally posted by brucieW View Post
    I am using version 7. I am attempting to call a DLL function from my strategy. I have added all of the relevant DLL's in the bin/custom directory. I have referenced the DLL and the strategy builds successfully. The initialisation fails with an error: Could not load file or assembly ... The system cannot find the file specified. A similar exercise in version 6.5 worked. Are there any changes in the new release that would cause this error? Is there a way of finding which file is missing?
    Is the dll a protected dll?

    Comment


      #3
      No, they are DLL's that I've written to enable me to link to a service from a Ninja Trader strategy.

      Comment


        #4
        BrucieW, welcome to our forums - did you restart NT7 fresh after copying in the files and adding the references?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Yes I did, still same problem.

          Comment


            #6
            I tried creating a simple class library DLL with only one API, added it to the reference, added using statement and call to API in strategy code. All compiles cleanly but still same problem when I run a backtest. It can't find the DLL. This new class library doesn't reference any other DLL but Ninja is still unable to load it.

            Comment


              #7
              Can you please send me one of your DLL's not working currently for testing to support at ninjatrader dot com Attn Bertrand?

              Thanks,
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Is there any progress on this DLL problem?

                Comment


                  #9
                  Can you please reply to the note I sent to your inbox directly?

                  Thanks,
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Do you mean the email regarding sending a script? If yes, I replied yesterday.

                    Comment


                      #11
                      No, I was referring to the update from that we were looking into the issue currently.
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        I am having the exact same problem; has there been any resolution of this issue?

                        I even tried changing the constructor in the dll and then recopying it to the bin->Custom directory. When I restarted NT, I got the message I had a programming error in one of my strategies. This was now correct since the old new() statement was no longer valid.

                        I corrected the error by adhering to the new constructor and yet the same "can't find..." message when trying to use the dll. NT can find the assembly such that it can give me a compile error but can't load it because it can't find it.

                        I am likely doing something very simple incorrectly but this is how I would load a dll in a non NinjaTrader project.

                        Best Regards,
                        Scott

                        Comment


                          #13
                          Hello,

                          I will have bertrand respond with an update tomorrow.

                          Thanks for your patience.

                          Comment


                            #14
                            Thank you Brett.

                            Comment


                              #15
                              The problem is with the version of .NET. If you try and load a .NET 4 library, it fails. You can only load .NET 3.5 or less.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by PhillT, 04-19-2024, 02:16 PM
                              3 responses
                              14 views
                              0 likes
                              Last Post mangel2000  
                              Started by TraderBCL, Today, 02:37 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post TraderBCL  
                              Started by mangel2000, Today, 02:23 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post mangel2000  
                              Started by mangel2000, Today, 01:30 AM
                              0 responses
                              14 views
                              0 likes
                              Last Post mangel2000  
                              Started by Doxxxx, Today, 01:24 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post Doxxxx
                              by Doxxxx
                               
                              Working...
                              X