- Solve real problems with our hands-on interface
- Progress from basic puts and calls to advanced strategies
Lesson 3 of 8
In previous lesson, we listed down the steps for installation of R and Rstudio. The next step is to configure the Trader Workstation (TWS) before we start writing programs in R. This lesson explains the steps required to set up the Trader Workstation.
Interactive Brokers provides API solutions which can be run on Windows, Linux, and MacOS. The API makes a connection to the IB Trader Workstation (TWS). The TWS, in turn, is connected to the IB data centers and thus, all the communication is routed via the TWS. The IBrokers R package enables a user to write his strategy/program in R and helps it get executed via the IB TWS.

Before we start writing programs in R, we need to configure the Trader Workstation (TWS). The next section explains the steps to configure the TWS.

If you check the “Create API message log file” box, it will create TWS log files.
If you also check the ‘include market data in API log file’ box, it will cause real-time market data to be captured in the API when trouble shooting market data problems.
A unique order Id is required every time an order is placed to an account. This unique order Id has to be greater than all the order Ids previously used. The reset button allows resetting the order Id sequence. However, note that this can be done if there are no active orders.
In this lesson, we learned to configure the Trader Workstation (TWS). In the next lesson, we start with the introduction to the IBrokers Package and explain the various API methods available in the package with examples. The subsequent lessons will explain other advanced API methods and finally illustrate an example strategy in R.
Note – The IBrokers package provides native R access to Interactive Brokers Trader Workstation API
For specific platform feedback and suggestions, please submit it directly to our team using these instructions.
If you have an account-specific question or concern, please reach out to Client Services.
We encourage you to look through our FAQs before posting. Your question may already be covered!
Information posted on IBKR Campus that is provided by third-parties does NOT constitute a recommendation that you should contract for the services of that third party. Third-party participants who contribute to IBKR Campus are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results.
This material is from QuantInsti and is being posted with its permission. The views expressed in this material are solely those of the author and/or QuantInsti and Interactive Brokers is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to buy or sell any security. It should not be construed as research or investment advice or a recommendation to buy, sell or hold any security or commodity. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.
Does socket port number 7497 used here above in simulated trading is also applicable to real trading ?
I think it mentions in some of the other tutorials that the live account port number is 7496