Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Target machine actively refused connection

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

    Target machine actively refused connection

    Hi.

    NT 7.

    Can't connect to my Interactive Brokers simulated account.

    I'm moving my trading from machine A to machine B. Used the "Backup & Restore" approach.

    I can connect to my live IB account, no problem. Without even looking at the connection options for that account in NT.

    I can connect to Kinetick no problem: didn't even look at the account parms.

    But I can't connect to my IB simulated account: I get the msg "Login failed: IB Adapter MessageLoop No connection could be made because the target machine actively refused it::1:7496".

    Searched in the forum but couldn't find anything which I hadn't already tried... Double checked the TWS API parms. Even replaced, in the NT account connection parms, the IP address which was in the "Host" parm with "localhost", as suggested.

    What's the next step?

    Thanks!

    #2
    Hello M_ichel,

    Have you followed the connected guide for Interactive Brokers?





    Is ActiveX and Socket Clients enabled in TWS?
    What ports are you using?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea. Thanks for your response (on a Sunday!)

      Yes, I followed the instructions.

      Except, I did not create an account connection, since I already had one... I'm tempted to delete the NT/Tools/Account Connections.../IB Simulated and recreate a new one...

      What throws me is the fact that in order to connect to the live IB account, I didn't have to do anything!!! I just selected that connection and off it went! First time!

      Should I delete the connection and create a new one?

      Thanks.
      Attached Files

      Comment


        #4
        Hi M_ichel,

        Using the old connection should be ok as long as this is an Interactive Brokers connection type.

        What is the port number used in the connection in NinjaTrader?
        May we have a screenshot of this?

        I'm seeing 7496 in TWS.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Chelsea.

          Here are snapshots of my two IB connections, the simulated one and the live one. The only difference I can see is that the live one has an IP address in the "Host" parm...

          Thanks.
          Attached Files

          Comment


            #6
            Thank your for your reply,

            I suggest making sure again that the correct version of TWS is downloaded and confiured per our connection guide.

            If you still see the same, try changing the 'Host (optional)' field from 127.0.0.1 to "localhost" from the NinjaTrader connection options (Tools > Account Connections > Select your connection > Change).

            We look forward to assisting further.
            Eric B.NinjaTrader Customer Service

            Comment


              #7
              Problem SOLVED

              Hi Eric.

              Yes, I'm using 944.3 (and I get the IB warning about this version not being supported after June when I connect to my live account).

              What I just did to resolve the problem, was
              1- delete the existing connection
              2- create a new one as per the Ninja guide

              It worked first time.

              Thanks.

              Comment


                #8
                This exception message says you're trying to connect to the same host ( 127.0.0.1 ), while you're stating that your server is running on a different host. This 127.0.0.1 represents a 'loopback' . It allows the computer to communicate with itself via network protocol .

                Dns.GetHostEntry(IPAddress.Loopback).HostName returns the host name of your machine. When you pass a host name to TcpClient , it will resolve it to one or more IP addresses using Dns.GetHostAddresses(hostName) . This includes the public and local IP addresses of your machine (e.g. 192.168.12.10), but not 127.0.0.1 (loopback address). So your client is trying to connect to any of the non-loopback addresses of your machine, while your server is listening only on the loopback address . So, no connection can be established. The solution to this problem is that connect to the same end point your server is listening on.

                This error is a network-related error occurred while establishing a connection to the Server. It means that the error is occurring because there is no server listening at the hostname and port you assigned.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by adeelshahzad, Today, 03:54 AM
                5 responses
                32 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by stafe, 04-15-2024, 08:34 PM
                7 responses
                32 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by merzo, 06-25-2023, 02:19 AM
                10 responses
                823 views
                1 like
                Last Post NinjaTrader_ChristopherJ  
                Started by frankthearm, Today, 09:08 AM
                5 responses
                21 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                43 views
                0 likes
                Last Post jeronymite  
                Working...
                X