• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

COM Interface ?

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

    COM Interface ?

    Can anyone please answer the following questions for me:

    1. Where is the COM Interface dll? What is it's name? I tried MBTCom.dll, since it was in the bin directory of the installation, but I cannot find any definitions that relate to the COM interface documentation? So, at this point, I am just guessing by looking at the files in the bin directory. Maybe it's not even there, do you have to ask for it?

    2. Is there any other programming documentation on the COM interface OTHER than what is at the web site? Say, examples perhaps? The website doc is fine for a general overview, but there is no detailed description of the functions along with examples.

    Thanks!

    Scott

    #2
    Unfortunately there is no more documentation. We do suggest that you use DLL interface as we have had reported issues with COM in the past. Search for NTDirect.dll on your PC.
    RayNinjaTrader Customer Service

    Comment


      #3
      Basics of what I need

      Perhaps I should have started with the basics:

      1. My requirement is that I have a VB.Net external app and want to link to NT via the ATI to place and mange orders. It's that simple.

      2. I started by asking about a COM Interface, which resulted in a recommendation to not use COM and go with NTDirect.dll. Upon my own research, I discovered that NTDirect.dll is just a regular C (unmanaged) dll. I would only use this as a last resort.

      3. I then 'poked' around and found the file NinjaTrader.Client.dll. It turns out to be a managed assemply that contains external defs of the documented ATI interface. I added the reference to my VB.Net application. However, when I call the functions from my VB.Net app, they don't abort, but they don't work either. For example:

      Private oClient = New NinjaTrader.Client.Client()

      Dim iConnect as Integer=oClient.Connect(1)
      Dim sStrategies as String = oClient.Strategies("Sim101")

      Yes, the ATI menu choice is selected in NT and I do have strategies defined for the "Sim101" account, but the variable 'sStrategies" contains the null string upon return from the call. The 'Connect' returns a '0' indicating that it worked, but I have no evidence that it really did work. (there is nothing on the control panel that I could find that it accepted a connection from an external app). I also tried other functions, like:

      iret = oClient.SubscribeMarketData("ES 06-08")
      iret = oClient.Ask("ES 06-08", price, size)

      They appear to execute, but do not provide any meaningful data.

      The bottom line is that I have a simple requirement to access the ATI via my external VB.Net application. The API is (sparsley) documented at the NT website, and that is OK; as long as I can access it, I can try to figure out how it all works. However, there is no documentation that I have found that explains clearly and concisely how to do reference the API in various environments (including what files are what). So I am spending my time rooting around trying various things, without much success.

      So, please, help me. I am trying to be a good customer. All I need to know is the basics of how to access the ATI API from an external VB.Net application. And BTW, it wouldn't take more than a paragraph or two to document how the various dlls NT has fit together so that developers can get off to a better start.

      And finally, we do love NinjaTrader. It's great!!

      Scott Masters
      www.tic2tic.com

      Comment


        #4
        - NT supports the DLL and the COM ATI and nothing else. We recommend not to mess around with any other NT assembly/dll.
        - we recommend the DLL interface over the COM interface since it works better for most users
        - unfortunately there is no further information and samples available than those you already found

        Thanks for your understanding
        DierkNinjaTrader Customer Service

        Comment


          #5
          I imported the NTDirect.dll into my VB.Net app with the following results:

          1. The API "Connect" command appear to work. The return value is 0, indicating success. If I disable ATI in the Control Center, then the return value is -1, as would be expected.

          2. Unfortunately, I can't get any of the commands to work. They execute, but do not return anything meaningful. For example,

          Dim sStrategies as String = ""
          sStrategies = Strategies("Sim101")

          returns <nothing> in sStrategies (which was initialized to "")

          My guess is that strings are not being passed properly between my VB.Net app and the NTDirect.dll. I am going to investigate this by writing a C# wrapper for the API functions.

          My questions is...Does anyone have (or know of) a VB.Net application working with the ATI? Or am I breaking new ground here??

          Tx,

          Scott

          Comment


            #6
            I suggest trying .NET interop to access the DLL if COM is not working as expected.
            DierkNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Dierk View Post
              I suggest trying .NET interop to access the DLL if COM is not working as expected.
              I had imported System.Runtime.InteropServices in the test that I just reported.

              Comment


                #8
                Great. However, this makes no difference, since this is not .NET interop to access native code DLLs. Please consult the MS documents on that issue.
                DierkNinjaTrader Customer Service

                Comment


                  #9
                  I've had no problems using C#.net with NinjaTrader.Client.Dll

                  I have never tried VB.net. It shouldn't make a difference anyway.

                  Comment


                    #10
                    VB.Net and NinjaTrader.Client.dll

                    [quote=mgbloomfield;36051]I've had no problems using C#.net with NinjaTrader.Client.Dll

                    It works fine under VB.Net as well. Just a couple of other questions.

                    1. Is NinjaTrader.Client.dll COM or a managed assembly?

                    2. NT advises to use NTDirect.dll because of some issues with the COM interface. If NinjaTrader.Client.dll is a managed assembly, then the COM dll must be something else. If it is the COM that they refer to in the documentation, do you know of any serious issues?


                    Scott
                    Last edited by smasers; 04-17-2008, 08:51 PM. Reason: Update

                    Comment


                      #11
                      Unfortunately we are unable to provide information beyond my previous post and in particular about the NinjaTrader.Client.dll.

                      Thanks for your understanding.
                      DierkNinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_Dierk View Post
                        Unfortunately we are unable to provide information beyond my previous post and in particular about the NinjaTrader.Client.dll.

                        Thanks for your understanding.
                        Sorry, NO I do NOT understand. You cannot tell your client base simply whether or not NinjaTrader.Client.dll is a COM interface or .Net Managed Code??? You must be kidding! Please advise.

                        Comment


                          #13
                          Please see my post #4 below. We only support the DLL and COM interface as documented.

                          Thanks for your understanding.
                          DierkNinjaTrader Customer Service

                          Comment


                            #14
                            You have never answered my question., and I cannot understand why not..what is the .dll file name of the COM interface? If you respond NinjaTrader.Client.dll, then why did you not respond to my earlier question that this .dll is COM as opposed to managed code?
                            Last edited by smasers; 04-17-2008, 11:16 PM.

                            Comment


                              #15
                              NTDirect.dll
                              RayNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by bomanpbm, Today, 09:27 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post bomanpbm  
                              Started by tgn55, Today, 08:47 AM
                              0 responses
                              8 views
                              0 likes
                              Last Post tgn55
                              by tgn55
                               
                              Started by ballboy11, 05-04-2019, 10:26 AM
                              6 responses
                              58 views
                              0 likes
                              Last Post Kermit
                              by Kermit
                               
                              Started by mrlucky1x, Yesterday, 10:01 PM
                              0 responses
                              15 views
                              0 likes
                              Last Post mrlucky1x  
                              Started by roger556, Yesterday, 09:22 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post roger556  
                              Working...
                              X