Step 1: Download and install Anaconda Python
(Skip this step if you are using Mac or Linux !!!)
Download and install the latest version of Anaconda, 64-bit Python, either 2.7 or 3.6. It will take up to 1 hours to download and install Anaconda depending on your internet speed.
Step 2: Download and install Interactive Broker’s TWS or IB Gateway
Both TWS and Gateway can be used to trade. If you are relatively new to trade at IB, then I would recommend TWS as it is more user friendly. However, if you want to save time and avoid IB system restarts then go for the IB Gateway.
Step 3a: Configure TWS if you are using TWS
Open TWS and input your credentials, you will see TWS is running.
Then click the little tool and select “Settings”, you will see a window jumping out.
Click “API” on left
Make sure “Enable ActiveX and Socket Clients” is checked
Make sure “Socket port” is “7496”
Then, click “OK” to complete the configuration.
Step 3b: Configure if you are using IB Gateway
After input your IB credentials, IB Gateway opens. Please go to its configuration.
Then, click API-> settings on the left hand. Make sure the Socket port is 7496.
Step 4: Open Spyder
Step 5: Set up Python Path
Go to “Tools” and select “PYTHONPATH manager”
A window will show up like this:
Click “Add path”, you will be prompt to select the folder that you had unzipped IBridgePy.
Step 6: Re-open Spyder
You can start your algo trading journey from here.