Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

identify SubscribeMarketData connection error

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

    identify SubscribeMarketData connection error

    How can I identify what error is causing a failed connection? I am using the standard code in a C# standalone program, but it always returns -1. I tried using SIM101, Sim101, sim101, and my own account. I tried using several instruments (variable inst).
    Also, should inst="$EURUSD" or "EURUSD" without the $?


    Code:
    using NinjaTrader.Client; // using statement
    
    NinjaTrader.Client.Client NTClient = new NinjaTrader.Client.Client();
    NTClient.SubscribeMarketData(inst);
    connStatus = NTClient.Connected(0);
    Last edited by ricktek; 11-25-2014, 10:53 AM.

    #2
    Hello ricktek,

    Thank you for your post.

    The code you have posted is not supported by NinjaTrader to do.

    I am also unsure of what you are trying to accomplish.

    OnConnectionStatus() is the method that gives all supported information about the connection.
    Below is a link to the help guide on OnConnectionStatus().
    http://www.ninjatrader.com/support/h...tionstatus.htm

    You can also set the connection loss handling.
    http://www.ninjatrader.com/support/h...sshandling.htm


    Also, EURUSD is a currency pair and must be preceded with the "$" even in code when calling this instrument.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi ChelseaB,

      I wasn't asking you to support the code, I was just showing what code I was using.

      My main question in the original post is: How can I identify what error is causing a failed connection?

      Although I don't support NinjaTrader customer service personnel, I'll make an exception for you:
      NinjaTrader.Client.IClient.SubscribeMarketData(str ing instrument) is a function in NinjaTrader.Client.dll which comes from NinjaTrader and is part of the ATI (Automated Trading Interface).

      What I am trying to accomplish is to subscribe to market data using a NinjaTrader recommended function SubscribeMarketData.

      The function Connected(0) (also part of the NinjaTrader.Client.dll) is used to check if the connection succeeded. Connected(1) is supposed to display a message box. For some reason, it is not displaying any error message.

      I already know that the connection failed because Connected returns an non-zero value.
      You might want to learn more about it at: http://www.ninjatrader.com/support/h...terface_at.htm
      I was not asking how to handle a failed connection.

      However, you did answer my secondary question as to whether or not I should include the $ at the beginning of a currency pair's symbol name. You answered that it is required to be included in the code.

      Comment


        #4
        Hello ricktek,

        The NinjaTrader.Client.dll is not supported to be used for custom projects and this is not in the help guide (because it is not supported by us to do).

        However, you are free to use any unsupported code you would like. I'm just trying to let you know that I will not be able to assist with this.

        It is supported to use the NTDirect.dll file in an external program and this is outlined in the help guide.
        http://www.ninjatrader.com/support/h.../functions.htm

        Again, the NinjaTrader.Client.dll is not supported by NinjaTrader to use for custom projects, however, this thread will remain open for any community members that would like to comment on this.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          So are you saying that you will only answer the question if I say that I am using the NTDirect.dll?

          Btw, when I try to add that reference, I get the following message.
          A reference to 'C:\Windows\System\NtDirect.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.

          Comment


            #6
            Hello ricktek,

            If you use the methods as they are intended to be used in the NTDirect.dll I will be able to assist with this.

            On a 64-bit system you may find the NtDirect.dll file in:
            C:\Windows\SysWOW64
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I get the same error message.

              Comment


                #8
                Hi ricktek,

                What line of code is causing the error?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  For now, I can't even add the reference to the program.

                  Comment


                    #10
                    Hi ricktek,

                    If you open C:\Windows\SysWOW64 can you find the NtDirect.dll file?

                    Is your machine a 64 bit machine?

                    If not, can you open C:\Windows\System32 and find the NtDirect.dll file?
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      It's a 64-bit. I have NTDirect.dll in both System32 and SysWOW64. I tried to add both and both times I received the same error message.

                      Comment


                        #12
                        Hi ricktek,

                        May I have a screenshot of the error message?

                        The message you have posted has an incorrect path.

                        "A reference to 'C:\Windows\System\NtDirect.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          I just left off the 32 from System32 when I wrote it down. It's the correct directory. That's not the problem.

                          Comment


                            #14
                            Hi ricktek,

                            May I have a screenshot of the error message?
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              I'm not going to the trouble of loading the image to the internet and then adding a link just because you don't believe me. Why don't call your supervisor or at least someone who knows something about the ATI?

                              Is there anyone else on the forum who knows something useful about using ATI?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by futtrader, 04-21-2024, 01:50 AM
                              4 responses
                              41 views
                              0 likes
                              Last Post futtrader  
                              Started by Option Whisperer, Today, 09:55 AM
                              1 response
                              11 views
                              0 likes
                              Last Post bltdavid  
                              Started by port119, Today, 02:43 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post port119
                              by port119
                               
                              Started by Philippe56140, Today, 02:35 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post Philippe56140  
                              Started by 00nevest, Today, 02:27 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post 00nevest  
                              Working...
                              X