Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader on separate computers to share Interactive Broker connection

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

    NinjaTrader on separate computers to share Interactive Broker connection

    Does IB Gateway software need to be installed on both computers to share the IB Gateway Connection or can you install IB Gateway on just one and then on the other computer just set up the connection in NT? With respect to the install guide below, is there anything else that needs to change? Client Id perhaps from 0 to 1 on the 2nd computer?




    #2
    Hello bc24fl,

    Thank you for your post.

    IB Gateway will need to be installed on both computers.

    The connection guide lists all of the necessary steps and information to get connected.

    Please do not hesitate to contact us for any other NinjaTrader inquiries you may have.

    Comment


      #3
      Are you sure the installation doesn't change on the 2nd computer? Interactive Brokers only allows one connection to its connection so shouldn't the 2nd computer have some differences like below:
      • User name (optional): *** LEAVE BLANK BECAUSE PC1 IS ALREADY LOGGED IN***
      • Password (optional): *** LEAVE BLANK BECAUSE PC1 IS ALREADY LOGGED IN***
      • Connect using: Set to either “TWS” or “Gateway” depending on the initial setup steps you choice earlier
      • Auto logon: *** LEAVE BLANK BECAUSE PC1 IS ALREADY LOGGED IN***
        • Important: You are required to use the API version listed on this page for this feature to work properly
      • Auto logon path: NO CHANGE
      • Client ID: ** SHOULDN'T THIS BE 1 INSTEAD OF 0 BECAUSE PC 1 IS USING 0?
      • Host (optional): **THIS SHOULD BE THE IP OF PC1 CORRECT?
      • Port TWS: NO CHANGE
        • TWS: production / live account 7496, paper account 7497
        • Gateway: production / live account 4001, paper account 4002
        • To avoid changing ports on the NinjaTrader side, you could setup 2 account connections, one for your production / live login, and one for your paper login

      Comment


        #4
        Hello bc24fl,

        Thank you for your post.

        I am not aware of any other changes that would need to be made. When setting up Interactive Brokers connections in secondary PC's for other users, I have only ever copied the exact settings from the original PC to the secondary PC. Please leave the Client ID set to a value of zero "0". Please also use the default Host.

        Please do not hesitate to contact us for any other NinjaTrader inquiries you may have.

        Comment


          #5
          Why does host on the guide page say:
          • Host (optional): Leave this as “127.0.01” (localhost) unless you want to connect NinjaTrader to TWS running on another PC within your local area network. If connecting over a network enter the computer name or IP address.
          Let me reach out to IB and find out if multi connections on IB are allowed for the same user account. I believe I read that it was not. I'll update the thread when I find out.

          Thanks.

          Comment


            #6
            So according to IB, it is not possible to have two separate IB Gateway install using the same credentials as one will logoff the other. You would have to create a separate account which defeats the purpose of being able to share one connection. Is it an absolute requirement of NinjaTrader that IB Gateway be installed on the same machine?

            Comment


              #7

              Hello bc24fl,

              Thank you for your note

              NinjaTrader can connect to multiple different IB accounts that have separate login usernames and passwords at the same time.

              To set this up please see the instructions below. In order to do this, however, users must manually start TWS multiple times for each account first in the morning, then connect with NinjaTrader since the auto startup functionality does not work with multiple logins.
              1. Close NinjaTrader (if open)
              2. Start TWS
                1. If you have three accounts you'll need to start TWS three times with each account logged in.
              3. When TWS has started, Click Configure > API Settings > Socket Port > Provide a unique value.
                1. The default is 7496. Leave this as-is for the first username.
                2. In the other instances of TWS, add 1 to this value for each additional connection
                  1. For example, the second TWS would be 7497, the third TWS would be 7498, and so on. It is critical that each instance of TWS/each account has a unique port number
              4. Start NinjaTrader
              5. In your NinjaTrader connection for these accounts, match the port with what you specified in TWS for each account connection.
                1. https://ninjatrader.com/ConnectionGu...nnection-Guide
              6. Connect in NinjaTrader using Connections, you will do this three times for all three accounts

              Below I have included a short video my colleague recently made on this topic:

              World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


              Please let me know if I can be of any further assistance.
              Eleanore T.NinjaTrader Customer Service

              Comment


                #8
                Thank you but I have IB Gateway installed on a separate PC than NInjatrader. So:

                PC1 = has installed only IB Gateway
                PC2 = has installed only Ninjatrader

                Is it possible to configure PC2 to connect to PC1 on the same LAN?

                Comment


                  #9
                  Hello bc24fl,

                  Thank you for your reply.

                  They do need to be on the same PC because NinjaTrader looks for a specific file path for the gateway on your local PC.

                  Please let me know if I can be of any further assistance.
                  Eleanore T.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_Eleanore View Post
                    Hello bc24fl,

                    Thank you for your reply.

                    They do need to be on the same PC because NinjaTrader looks for a specific file path for the gateway on your local PC.

                    Please let me know if I can be of any further assistance.
                    Right. Then what is the use case for this:
                    • Host (optional): Leave this as “127.0.01” (localhost) unless you want to connect NinjaTrader to TWS running on another PC within your local area network. If connecting over a network enter the computer name or IP address.

                    Comment


                      #11
                      Hello bc24fl,

                      Thank you for your reply.

                      I was mistaken. You can input your IP address for the other computer.

                      For this to function, the computer name and/or IP address must be correct and port 4001 must be open.Please let me know if I can be of any further assistance.


                      Eleanore T.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_Eleanore View Post
                        Hello bc24fl,

                        Thank you for your reply.

                        I was mistaken. You can input your IP address for the other computer.

                        For this to function, the computer name and/or IP address must be correct and port 4001 must be open.Please let me know if I can be of any further assistance.

                        Right ok. So then PC2 does not require the IB Gateway install since it's connecting to PC1 that already has IB Gateway correct?

                        Comment


                          #13
                          Hello bc24fl,

                          Thank you for your reply.

                          Correct, as long as you have used the specific configuration settings, this will work.

                          Thank you for using NinjaTrader.
                          Eleanore T.NinjaTrader Customer Service

                          Comment


                            #14
                            Originally posted by NinjaTrader_Eleanore View Post
                            Hello bc24fl,

                            Thank you for your reply.

                            Correct, as long as you have used the specific configuration settings, this will work.

                            Thank you for using NinjaTrader.
                            Ok. So I prefer to separate my automated vs my manual trading. If I introduce PC3 with only Ninjatrader should I have to change client id to 1 or leave as 0? Do you mind sharing what this option is used for? See below:
                            • Client ID: Leave this set to a value of zero "0" unless otherwise instructed by a technical support representative


                            Comment


                              #15
                              Hello bc24fl,

                              Thank you for your reply.

                              The Client ID and TWS Master API client ID must match. This would only be applicable if a client is placing orders from another third party app to their Interactive Brokers account and also connecting Interactive Brokers to NinjaTrader and wanting to see those orders/executions within NinjaTrader. The API client with a specific client ID will receive all orders and trades even though places by other API clients. Only this API client will be able to receive commission reports for all elevations.

                              I would leave the client ID at 0 unless you are using a third-party app that is not NinjaTrader, TWS, or IB Gateway.

                              Please let me know if I can be of any further assistance.
                              Eleanore T.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Today, 05:17 AM
                              0 responses
                              48 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              126 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              66 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              42 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              46 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X