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

NT8 version of Newtonsoft.json

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

    NT8 version of Newtonsoft.json

    I tried to import from the .zip the current version of Newtonsoft.json for an API I am using in an indicator, and the error message stated that it's for an older version of NT, most likely 7. I did open the Newtonsoft project in Visual Studio 2017 Pro, and the namespace looked the same as what's in the using statement. Any suggestions?

    #2
    Hello pel11,

    Thank you for the post.

    I wanted to check, you said you tried to import the Newtonsoft zip file, this is not a NinjaTrader import so this would not work. Are you trying to develop using Newtonsoft in your code or are you trying to just update this file for something you have that uses it?

    If you are trying to use this in your code, you would need to manually place this file in the bin/custom directory and correctly reference it in the NinjaScript editor. If you are already referencing the included version that is in the Program Files (x86)\NinjaTrader 8\bin64 folder, that should not be updated and should only be referenced. If you want to target a specific reference it needs to be added to the bin/custom folder and referenced from there instead.

    If this is something that is already used and you just wanted to update it, I wouldn't suggest trying to update Newtonsoft to a newer version unless you specifically have used this in your own code and require that target version of this dependency. If other items you have imported also use Newtonsoft and you update the file, that may break the other items that use it.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Jesse,

      I am using 64-bit NT8, and only need to call newtonsoft.json with a " Using Newtonsoft.json;" in the preamble of an indicator. I did copy the .net4.5 version of the .dll into my Documents\NinjaTrader 8\bin\Custom folder, and restart but still get errors.

      Comment


        #4
        Can you download the .zip from newtonsoft and use a Using call in an indicator to get an indicator to compile, and then let me know how to get it working?

        Comment


          #5
          Hello pel11,

          Using third-party resources such as Newtonsoft in NInjaScript would be outside of what our support could assist with or provide samples of. This is something you will need to diagnose and work through on your end. You can use third-party references in your own programming but this is something you would need to reference in the NinjaScript editor for it to work.

          Have you at this point referenced this DLL in the NinjaScript editor? Dropping the file in the bin/custom folder would only be part of being able to use that DLL. You also need to reference the dll using the NinjaScript editor -> Right Click -> References menu. Have you done this?

          Additionally, if you plan to export the item later, you would need to add the DLL to your export. https://ninjatrader.com/support/help...esOrNativeDlls

          I look forward to being of further assistance.

          JesseNinjaTrader Customer Service

          Comment


            #6
            I'm using Newtonsoft.json in Ninjatrader 8 without any issues. I'm not using the latest version I'm using v10.0.2 - haven't had the need to upgrade from that point.

            I expect the error message you're getting is due to the DLLs being built with the wrong verion of .NET rather than the wrong version of NT. You need the Newtonsoft .NET 4.6 DLLs.

            I've attached the DLLs I'm using, copy these to Documents/Ninjatrader 8/bin/custom and add the files via "References" menu item in Ninjascript editor.
            Attached Files

            Comment


              #7
              Here's the v11 dlls that should work
              Attached Files

              Comment


                #8
                FYI - I was able to upgrade to the v11 DLLs from the previous post without any issue.

                Comment


                  #9
                  We're taking another look into this, I do not expect you to have this problem at this time after the upgrade. We may need to fix something on our side that is causing issues with the assembly load in 8.0.17.0. Will provide an update Monday/Tuesday next week.

                  Comment


                    #10
                    Hey Brett. I'm using Newtonsoft.Json extensively in my Ninjatrader development - in addition to about 6 or 7 other DLLs which I'm also loading via the Ninjascript editor. I've had no issues in 8.0.17.0 or any other releases thus far. The person who opened the forum post hasn't responded further, so I assume all is good with him too?

                    I've only been testing 8.0.17.0 for a few hours today. After 8.0.16.0 fiasco I was reluctant to upgrade, but since the forums have been fairly quiet, I decided to upgrade and throw a few trades in late on Friday for some testing while it was quiet - I had no issues with any of my addons, strategies or indicators in the hour or two I was testing live. I'm going to do more extensive testing over the weekend. If you have any specific Newtonsoft.Json / external DLL concerns please let me know specifics and I will try to reproduce.

                    Comment


                      #11
                      We will be releasing a 17.1 release here shortly (next few days) which will address this issue. Thank you for reporting it.

                      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,265 views
                      0 likes
                      Last Post sidlercom80  
                      Started by Barry Milan, Yesterday, 10:35 PM
                      3 responses
                      11 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Working...
                      X