Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

failed to initialize DLL error while trying to call ntDirect.dll on newer version

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

    failed to initialize DLL error while trying to call ntDirect.dll on newer version

    I have been using the OIF for a while with the older version of Ninjatrader (version 8.026.1 64 bit) that had two folders for 32 and 64 bit. I have been using python and the 32 bit NtDirect.dll file in the folder 32 and everything works fine.

    If I update to latest version of ninjatrader that doesnt have the 32 folder I get an error when I initiate my code. The error is "Ninjatrader failed to initialize ninjatrader DLL ntDirect.dll (0x80040154)"
    I have made sure to update my route to the NtDirect file correctly. Is ther anyone that know whats wrong and how to fix this?

    this is the line of code that calls the NtDirect and with new version doesn't work:
    //
    dll_file_path = 'C:\\Program Files\\NinjaTrader 8\\bin\\NtDirect.dll' #>> changed from this "C:\\Program Files (x86)\\NinjaTrader 8\\bin\\NtDirect.dll"
    ninja_lib = ctypes.WinDLL(dll_file_path)
    is_connected = ninja_lib.Connected(1)
    //​

    #2
    Hello Ray11,

    The NT8 ntdirect dll is not working in the current version. If you can make use of the other unsupported ntclient dll you can use that instead. You would otherwise need to use the previous version of NT8 or use a different approach for your goal. There is currently no information on a fix for this, you can track the issue in future change logs with the ID 15495.

    https://ninjatrader.com/support/help...ease_notes.htm

    https://ninjatrader.com/support/foru...626#post793626
    JesseNinjaTrader Customer Service

    Comment


      #3
      would I be able to use the ntDirect.dll on the latest version?

      Comment


        #4
        Hello Ray11,

        The NTDirect dll has been discontinued and will no longer be available going forward. You can still use the File interface if you need to submit orders from an external application. If you are specifically using a C# external application you can still use the unsupported managed NinjaTrader.Client dll.



        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello Ray11,

          The NTDirect dll has been discontinued and will no longer be available going forward. You can still use the File interface if you need to submit orders from an external application. If you are specifically using a C# external application you can still use the unsupported managed NinjaTrader.Client dll.


          Shouldn't the release notes for 8.1 explicitly state that NTDirect.dll support has been dropped? And the relevant pages removed from the help or noted that this is no longer possible as of NinjaTrader 8.1? To read the documentation at https://ninjatrader.com/support/help...b=ntdirect.dll and https://ninjatrader.com/support/help...b=ntdirect.dll it would certainly appear that this is supported. Can you provide any insight on why support for this has been dropped?

          Edit: by searching the forums and scrolling through many posts, I eventually found this statement by NinjaTrader_ChelseaB at https://forum.ninjatrader.com/forum/...26#post793626:
          Originally posted by NinjaTrader_ChelseaB View Post
          Update April 6th, 2023 - Due to the lack of user utilization and resource cost of maintaining, the native c++ NtDirect.dll has been discontinued.
          We will continue to track interest into this functionality and may revisit re-implementing in the future if there is high user demand.
          The API is still available with the .NET managed assembly NinjaTrader.Client.dll. Further, the ATI is still available through the Email and Order-Instruction-File approaches.​
          But, I still maintain, this should be in the release notes that support for this has been dropped, because the release notes are how users decide whether it is safe to update, and the documentation should explicitly state that NTDirect.dll support has been dropped - to read the documentation, it looks like it should work, and it DID work until recently.

          To the casual observer, it gives the appearance that it was broken accidentally in the 8.0.28.0 time frame, and then it was judged to be too much trouble to fix it so it was sort of ret-conned to have been dropped.

          It's okay to drop support for something that's a lot of trouble and few people use, if that is the decision, but you should be explicit about this - put it in the release notes that it is dropped and update the documentation so everyone knows and they don't just upgrade, blindly trusting that the release notes describe the changes, and then are surprised their work is broken and have to scramble to figure out what to do. If you didn't know it was broken when the release notes were written, just go back as soon as you do know and know you've decided not to fix it and add working like this: "Note: NTDirect.dll no longer works as of this version and will no longer be supported" and add the corresponding note on those two help pages above. At least then they would know.
          Last edited by QuantKey_Bruce; 06-08-2023, 07:45 AM.
          Bruce DeVault
          QuantKey Trading Vendor Services
          NinjaTrader Ecosystem Vendor - QuantKey

          Comment


            #6
            Hello QuantKey_Bruce,

            They are left there for any users that still need reference for older versions where that was still included. This also is the only documentation of the functions of that interface which is shared with the unsupported C# client dll. Despite it being documented that does not mean it is supported for other language use cases. This interface was made for use with tradestation but has been replaced with the email interface in recent versions.


            JesseNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Jesse View Post
              Hello QuantKey_Bruce,

              They are left there for any users that still need reference for older versions where that was still included. This also is the only documentation of the functions of that interface which is shared with the unsupported C# client dll. Despite it being documented that does not mean it is supported for other language use cases. This interface was made for use with tradestation but has been replaced with the email interface in recent versions.

              Don't you think it should at least say somewhere what versions no longer include it? This should be in the release notes for the first version where it was broken / not fixed / dropped, and in a warning at the top of those pages.
              Bruce DeVault
              QuantKey Trading Vendor Services
              NinjaTrader Ecosystem Vendor - QuantKey

              Comment


                #8
                Hello QuantKey_Bruce,

                That is not up to our support to decide, that would be developments decision on what they put in the notes for updates.The only pages which needed changed surrounding this were for tradestation, those were updated to reflect the email interface when that change happened.

                Just as a reminder when using unsupported scripting concepts those can be subject to change with no warning or documentation. Its always a risk when using something in an unsupported way. The following post describes this well by mentioning that while there are samples that were created they are 100% unsupported. This post was also updated to mention that this was discontinued which serves as a form of unsupported release notes.




                JesseNinjaTrader Customer Service

                Comment


                  #9
                  NinjaTrader_Jesse Surely you don't mean to suggest that in order to understand what changed in a release, after reading the release notes, they should read all of the posts on all of the forums also because there might be "a form of unsupported release notes" there somewhere...

                  If that post is the canon regarding the unsupported ATI, then the help pages in question should point to the forum post. One or the other of them should be authoritative, and I would think the documentation.

                  I understand you are saying that some other team does the documentation, and you can't put things in there. That's an internal matter for NinjaTrader to work out - but the people who are relying on the documentation need it to contain the actual facts. Right now, the documentation plainly says that NTDirect.dll is available, and it is not available at all, for either the current version 8.1.1.7 or "previous" version 8.0.28.0.

                  Further, there is nothing in the official documentation for the ATI https://ninjatrader.com/support/help...terface_at.htm to suggest that the DLL interface is unsupported. I hear you and others posting here saying it's unsupported and "you're on your own" but the documentation does not read that way at all. I'm not debating whether it's supported - I understand what you are saying that it is unsupported. What I am saying is the documentation should say that - as well as saying that NTDirect.dll does not work at all in any currently available version.

                  This is just a case where the documentation needs to be updated to reflect recent policy decisions - sort of like how https://ninjatrader.com/support/help...y_provider.htm starts its provider comparison by plainly stating that NinjaTrader is not a market data provider, and then the first market data provider listed is NinjaTrader.

                  I realize the 8.1 rollout rocked a lot of boats. They say you have to break some eggs to make an omelette. But, don't forget to fix the documentation to reflect that you now have an unsupported omelette instead of some unsupported eggs, and that the eggs are stilll documented only for historical reasons.
                  Last edited by QuantKey_Bruce; 06-08-2023, 09:04 AM.
                  Bruce DeVault
                  QuantKey Trading Vendor Services
                  NinjaTrader Ecosystem Vendor - QuantKey

                  Comment


                    #10
                    Hello QuantKey_Bruce,

                    NinjaTrader_Jesse Surely you don't mean to suggest that in order to understand what changed in a release, after reading the release notes, they should read all of the posts on all of the forums also because there might be "a form of unsupported release notes" there somewhere...

                    If you are using unsupported concepts then yes, you should use the forum for that instead of looking in the help guide. Those type of concepts won't go in the help guide. This specifically is a unique case because the NTDirect == NinjaTrader.Client and it also served a previous purpose of being used for tradestation so it was documented to explain the returns on the API. Other unsupported concepts would just be undocumented and may change with no mention in the release notes or help guide.

                    If that post is the canon regarding the unsupported ATI, then the help pages in question should point to the forum post. One or the other of them should be authoritative, and I would think the documentation.

                    Anyone using the NTDirect dll would have first visited that post with the sample to know how to use it in an unsupported way, there is no information in the help guide on how you would actually use that in an unsupported capacity. It only documents what the api had provided which was originally used by tradestation. Because that is unsupported to use that dll in external applications a link to that forum post would not be included in the help guide.


                    As this will not be changed there is no reason to continue replying to this post, I am not going to post again on this topic. Having that information there is still relevant for anyone using the client dll which is still available.







                    Last edited by NinjaTrader_Jesse; 06-08-2023, 09:09 AM.
                    JesseNinjaTrader Customer Service

                    Comment


                      #11
                      I have the solution how to replace NTDirect dll and continue using of ATI API in your TS scripts. This solution not a hack of course
                      Contact me and we discuss the details.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by geddyisodin, Yesterday, 05:20 AM
                      7 responses
                      45 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by gbourque, Today, 06:39 AM
                      2 responses
                      5 views
                      0 likes
                      Last Post gbourque  
                      Started by cre8able, Yesterday, 07:24 PM
                      1 response
                      13 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by cocoescala, 10-12-2018, 11:02 PM
                      6 responses
                      939 views
                      0 likes
                      Last Post Jquiroz1975  
                      Started by cmtjoancolmenero, Yesterday, 03:58 PM
                      1 response
                      17 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Working...
                      X