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

Loading External DLL - Error

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

    Loading External DLL - Error

    Hi,

    Every framework I'm trying to use, I get the same run-time error:

    Strategy 'xxx': Error on calling 'OnBarUpdate' method on bar 0: Could not load file or assembly 'encog-core-cs, Version=3.3.0.0, Culture=neutral, PublicKeyToken=3e882172b12155d4' or one of its dependencies. The system cannot find the file specified.

    I tried 4 different frameworks and different versions - always the same issue - so it's 100% issue in the NT8 (or the way I use it).


    PLEASE try to help me here.

    to get the DDL file I do:
    C:\Users\XXX\Desktop\NT8\FW>C:\Users\XXX\Downloads \nuget.exe install encog-dotnet-core -Version 3.3.0

    than I'm loading the DDL by this guide:


    thanks.

    #2
    Hello gsapir,

    Thank you for your post.

    Did you use .NET 4.5 for the assembly? This would be the required version for NinjaTrader 8.

    In addition, you need to reference the .dll file and not the .exe file. Do you know where the .exe file is storing the .dll upon running the .exe file?

    I look forward to your response.

    Comment


      #3
      Hi.

      I'm not sure how the assembly is done. I only use this command:
      C:\Users\XXX\Downloads \nuget.exe install encog-dotnet-core -Version 3.3.0

      and yes, I take the DDL file.

      can you help me understand how to check the assembly ?


      thanks

      Comment


        #4
        Hello gsapir,

        Thank you for your response.

        There are a few means to determine the .NET version. I would suggest a Google search.
        Here are a few I found:
        Please let me know if I may be of further assistance.

        Comment


          #5
          Hi,

          So now I took only .NET4.5 build of Accord. still the same issue

          attached the files that I use. (zipped)

          what I'm trying to do is:

          using Accord.Controls;
          using Accord.MachineLearning.VectorMachines.Learning;
          using Accord.Math.Optimization.Losses;
          using Accord.Statistics;
          using Accord.Statistics.Kernels;
          using System;

          var smo = new SequentialMinimalOptimization<Gaussian>()
          {
          Complexity = 100 // Create a hard-margin SVM
          };


          PLEASE HELP
          Attached Files

          Comment


            #6
            Hello gsapir,

            Thank you for your response.

            Can you provide a test script you are using for this?

            You can export your indicator by going to Tools > Export > NinjaScript Add On > Add > select your indicator > OK > Export > name the file 'NTsupport' > Save.

            The file will be located under Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript. Please attach the file to your response.

            I look forward to your response.

            Comment


              #7
              Thanks Patrick!

              attached: very simple strategy that uses the Accord framework.

              -note: it's a strategy, not an indicator. (does it matter ?)
              Attached Files

              Comment


                #8
                Hello gsapir,

                Thank you for your response.

                I am only seeing that it seems certain namespaces and classes that are being called do not exist or the needed reference and/or declaration is not made.

                This is your own assembly you have corrected, correct?

                Comment


                  #9
                  Hi,

                  no it's not my assembly, I downloaded it from nuget.

                  Do you see anything I'm missing?
                  can you make this simple algorithm work and not crash ?

                  thanks

                  Comment


                    #10
                    Hello gsapir,

                    Thank you for your response.

                    I cannot get your code to compile due to errors in regards to calls that are being made. However, I can add the references and declare them as using in the code. I have no knowledge of this .dll so I have no means to test it.

                    I would recommend contacting the developer of said assembly for further assistance.

                    Comment


                      #11
                      the same algorithm with the same library works great in VS.
                      this is the developer website:

                      Accord.NET is a .NET machine learning framework combined with audio and image processing libraries completely written in C# ready to be used in commercial applications.


                      it's a very known and important framework for algo-trading.

                      Comment


                        #12
                        Hello gsapir,

                        Thank you for your response.

                        We would not provide support for third party libraries. In my testing with these .dll files my NinjaTrader installation would crash on start up.

                        Please let me know if you have any questions.

                        Comment


                          #13
                          this is not issue with the third party library- the issue is with NT8.
                          I tried 4 different libraries that works on VS.
                          but gets the same issue in NT8

                          Comment


                            #14
                            hi gsapir, I know I'm super late but i think i understand the fix to your issue. So basically you need to create a strategy or an indicator where you intend to use the accord library and open it via script editor of nt 8. While there right click anywhere in it and go to references. In the opened window click add and navigate to the folder on your local machine where you have the dll files and click ok. Then find the library in the references list, select it and click ok.

                            Comment


                              #15
                              hi gsapir, thanks for providing the extracted Accord library. However, I noticed that the Accord.Neuro dll are missing out. Do you know how to extract the Accord.Neuro dll for ninjatrader 8, i.e net4.5 version?

                              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
                              1 view
                              0 likes
                              Last Post CortexZenUSA  
                              Started by usazencortex, Today, 12:43 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post usazencortex  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              168 responses
                              2,266 views
                              0 likes
                              Last Post sidlercom80  
                              Started by Barry Milan, Yesterday, 10:35 PM
                              3 responses
                              13 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Working...
                              X