Interactive Brokers TWS Performance Optimization

This article describes a performance optimization tweak for Trader Workstation that helps to get TWS running faster and smoother, and even to prevent an occasional crash (Out of Memory error).

Interactive Brokers Trader Workstation is a powerful trading platform. However, out of the box configuration contains basic settings which are not optimal for serious users. Fortunately there is a simple way to update default configuration to improve runtime performance of TWS.

Increasing Java Memory Size

This bumps up amount of memory allocated to TWS to 1GB from default 256 or 512mb (depending on TWS version). More memory will help TWS run faster, do this only if you have at least 4GB of memory on your computer.

Windows

1) Right-click on TWS icon, and select “Properties”
2) In the shortcut’s Properties window, in “Target” field add the following parameters at the end of the value (don’t forget to add space) :  ” -Xmx1G -XX:MaxPermSize=256M”. Complete value of “Target” field should look something like this:

C:\Windows\System32\javaw.exe -cp jts.jar;total.2012.jar -Dsun.java2d.noddraw=true -Dswing.boldMetal=false -Dsun.locale.formatasdefault=true jclient/LoginFrame C:\Jts  -Xmx1G -XX:MaxPermSize=256M

NOTICE: if you are using 64-bit Java (JRE/JVM) and have plenty of memory you can increase amount even further by setting -Xmx2G or -Xmx4G
 
interactive brokers performance optimization on Windows - instructions

Mac OS

1) In Finder go to Applications directory
2) Find TWS Trader Workstation app icon, right-click, select “Show Package Contents”. This will open a new directory view of the TWS application contents.
3) Expand Contents -> MacOS directory.
4) Open ‘JavaAppLauncher’ file in text editor: Right-click on ‘JavaAppLauncher’ file, click on “Open With…” option in the popup menu, click “Other…”, then find ‘TextEdit’ app in the list, or any other text editor you have installed.
6) In the ‘JavaAppLauncher’ file find line that starts with “java -cp
7) Add following parameters after the jar file name (don’t forget to add a spaces around): ” -Xmx1G -XX:MaxPermSize=256M ”

Your ‘JavaAppLauncher’ file should contain records similar to this towards the bottom of the file:

interactive brokers performance optimization on Mac OS - instructions
 

8) Save file in the text editor and close it.

NOTICE: if you have at least 4GB, and ideally 8GB of RAM on your computer you can add even more memory by setting -Xmx2G or -Xmx4G in the file above.
 


Trading Geeks provides consulting in trading strategy and software development for independent traders and hedge funds. Please inquire for more information or a free quote for your project via Contact Us form on the right.


Posted in Trading Tools
3 comments on “Interactive Brokers TWS Performance Optimization
  1. Philippe says:

    Actually in Mac OS X the file you need to change is found under
    Users/*username*/Jts/tws.options

    Thanks for the tip

  2. Dirk Schmidt-Rittershaus says:

    Thanks Phillipe but that file only shows:
    # maximum Java heap size
    -Xmx768m

    Should I just change last line to: -Xmx2G ?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

IB Data Downloader


ib_downloader_3_downconf ib_downloader_3_options

IB Excel Trader

  • IB Excel Trader version 1.6 is now available!
  • Trade Stocks, ETFs, Futures, and Forex directly from Excel.
  • Implement custom trading rules using spreadsheet formulas or VBA.
  • Program entry rules for single or bracket exit orders. Market, Stop, Limit, Stop-Limit, as well as complex algo orders are supported.
  • Order Log sheet (new!). Contains a detailed list of each order status change in a filterable Excel table.
  • Use our Customization Service to extend IB Excel Trader and contract our programmers to develop your custom trading strategies.
IB-Excel-Trader-1-5_wTWS-2

Interactive Brokers (IB) is a low cost provider of trade execution and clearing services for individuals, advisors, prop trading groups, brokers and hedge funds. IB's premier technology provides direct access to stocks, options, futures, forex, bonds and funds on over 100 markets worldwide from a single IB Universal account.

Member NYSE, FINRA, SIPC. Visit www.interactivebrokers.com for more information.

Contact Us!

Please enter your contact details and a short message below and we will respond to your message shortly.