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

Reference Issue

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

    Reference Issue

    Hi NT,

    I am trying to ingest MongoDB Driver in strategy files. Even though I have added them in reference ( Through NinjaEditor ) the strategy is throwing issue :
    HTML Code:
    ( Could not load file or assembly 'MongoDB.Driver, Version=2.11.5.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.)
    Attaching screenshots for reference.

    Looking forward to hearing back from you soon.
    Attached Files

    #2
    Hello dastaan, thanks for writing in.

    Could you try removing the references, then moving the DLL files into Documents\NinjaTrader 8\bin\Custom then adding the references again? It could be a file access error we are seeing here.

    I look forward to hearing from you.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi ChrisL,

      Indeed! You are on point. [ Kudos ]

      I tried your solution and stuck with new issue :

      HTML Code:
      Error on calling 'OnBarUpdate' method on bar 0: The type initializer for 'MongoDB.Driver.Core.Misc.DnsClientWrapper' threw an exception.

      NT is utilizing 4.8 .Net & according to https://docs.mongodb.com/drivers/csharp version 2.11 should work so I think version mismatch can't be the case.(?)


      [ Also how can I check what exception it is throwing ? ]
      Last edited by dastaan; 12-16-2020, 10:46 AM.

      Comment


        #4
        Hi dastaan, thanks for your reply.

        You could try using Visual Studio debugging to attach to the NinjaTrader process, then run the script while attached to make it throw the exception. I'm not positive if that will work on a DLL file though please test it out.
        https://ninjatrader.com/support/help..._debugging.htm

        Please also look in your latest trace file within Documents\NinjaTrader 8\trace to see if there is a trace error in there.

        Best regards.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi Chris,

          Highly appreciate your suggestion, It is valuable.

          This is the exception that I am getting from it :
          HTML Code:
          System.TypeInitializationException: The type initializer for 'MongoDB.Driver.Core.Misc.DnsClientWrapper' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'DnsClient, Version=1.3.1.0, Culture=neutral, PublicKeyToken=4574bb5573c51424' or one of its dependencies. The system cannot find the file specified.
          at MongoDB.Driver.Core.Misc.DnsClientWrapper..ctor()
          at MongoDB.Driver.Core.Misc.DnsClientWrapper..cctor()
          --- End of inner exception stack trace ---
          at MongoDB.Driver.MongoUrlBuilder.Parse(String url)
          at MongoDB.Driver.MongoUrl..ctor(String url)
          at MongoDB.Driver.MongoClient..ctor(String connectionString)
          at NinjaTrader.NinjaScript.Strategies.RevMasterV5F.On BarUpdate() in c:\Users\91991\Documents\NinjaTrader 8\bin\Custom\Strategies\RevMasterV5F.cs:line 195


          Any idea what am I missing here ?

          Comment


            #6
            Hello dastaan, thanks for your reply.

            It looks like you used Nuget to add in the MongoDB DLLs into the custom Visual Studio project. You should not add any dependencies to the custom project like this because NinjaTrader handles the DLL building, not Visual Studio. What you will need to do is take an external VS .net framework 4.8 WPF project, use nuget in that to acquire MongoDB, and build the project. Open the bin/debug folder and copy all .dll's that are needed for mongo but not the applications exe to the Documents\NinjaTrader 8\bin\Custom folder. Then manually reference those dll's in the NS editor and compile.

            Best regards.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Hi Chris,

              Your suggestion was extremely valuable. [ It has resolved the issue ].

              Apart from it, I have a few general questions :

              1) How I can get a support job ( Remote?) at NinjaTrader ?

              2) Does one's activity in support forums ( or no of posts ) helps in it ?
              Last edited by dastaan; 12-18-2020, 02:35 AM.

              Comment


                #8
                Hello dastaan, thanks for your reply.

                All of our career listings are here, there are currently no openings for support:
                Take a look at the current openings at NinjaTrader


                You will need to ask your questions to the Human Resources department after applying for more details.

                Best regards.
                Chris L.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Irukandji, Yesterday, 02:53 AM
                2 responses
                17 views
                0 likes
                Last Post Irukandji  
                Started by adeelshahzad, Today, 03:54 AM
                0 responses
                3 views
                0 likes
                Last Post adeelshahzad  
                Started by CortexZenUSA, Today, 12:53 AM
                0 responses
                3 views
                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  
                Working...
                X