When and how should I increase the memory allocation for TWS?

Overview: 
Java Virtual Machine memory allocation

The Trader Workstation is a Java-based application. As any other Java applications, it executes within a Java virtual machine (JVM) which manages the interactions between the program and the underlying Operating System (OS).

The memory (RAM) which is allocated by the operating system to the JVM constitutes the heap space. That is the area where all the class instances and arrays needed by the application are allocated. The heap space is created when the JVM is started and it is dynamically freed-up by the Garbage Collector (GC), the Java memory manager. When the need arises, the Garbage Collector is invoked to free up the heap space by unloading Java classes and other code structures no longer used by the application.

If the heap space is undersized, the Garbage Collector may not be able reclaim memory at the needed pace or may have to be called too often, draining the processor (CPU) resources. When this happens, the application may slow down, be unresponsive or even crash completely.

To ensure a smooth TWS run, it is therefore sometimes necessary to change the memory allocation, according to the layout complexity and the needs of the application itself.

Background: 
In which case I should change the TWS memory allocation?
If your TWS layout contains a considerable number of elements (Analytical/Trading Tools, Chart windows, News panels, Watchlists, Layout tabs...) and your platform is slow or poorly responsive, you may want to increase the memory allocation in order to achieve better performances. If your TWS freezes or crashes, we also recommend increasing the heap space as the first corrective action to attempt. 
 
How much memory should I allocate to TWS?
In general we recommend to start with a conservative memory allocation and test the TWS performances with that set up. If the performances improvement is less noticeable then expected or not yet satisfactory, you can switch gradually to higher values until you find the best fit for your platform.
Please consider the following:
  • The memory you allocate to the TWS has to be available on your system. For details, please see Note 1. Allocation values above 2048 are not supported by 32-bit OS. For details, please see Note 2. 
Considering the above, we suggest to initially reserve 1.5 GB of system RAM the TWS, as explained in the guide below.
This amount of free memory is usually available on any modern computer and should be a good fit for most of the cases. Should you still notice slowness, freezing or crashes during the TWS execution, you can raise the value to 1792.
In any case, we do not recommend to set the value above 2048 since this will produce an unnecessary overhead and may thus even decrease the overall performances of the application.

 

 
How can I change the memory allocation for the TWS?

Please follow one of the links below for the instructions, according to the Operating System and TWS release you are using

 
     Any Operating System
 
     B.1 Your Operating System is Windows      
     B.2 Your Operating System is Mac OS

 

 

 

A. TWS version 972 and higher

The steps below are valid for all Operating Systems
1) In the TWS, click on the top menu File (or Edit if you are using Classic TWS) and select Global Configuration...

2) On the left side menu of the Global Configuration panel, click on General

3) In the panel on the right side, in the Memory Allocation field, replace the existing value with 1536

4) Click on Apply and then on OK

5) Shut down the TWS

6) Launch the TWS with a double click on the Desktop shortcut Trader Workstation (Should you receive an error message, please see Note 3.
 

Back to top 

 

 

B. TWS versions previous to 972

B.1 Your Operating System is Windows

1) Close TWS in case it is running

2) On your keyboard, press WIN+R (the WIN key is the key with the windows flag located on the left side of tour keyboard,  between the keys CTRL and ALT) 
3) Type C:\Jts\tws.vmoptions and Click OK
4) Should the system ask you which program to use to open the file, select Notepad and click OK
5) Cut the line -Xmx768m and paste it below the line ### Keep on update
6) Change then the value of the parameter Xmx from 768 to 1536
7) Save the changes by clicking on the top menu File --> Save
8) Close the file clicking on the X icon on the right side of the toolbar
9) Launch the TWS with a double click on the Desktop shortcut Trader Workstation (Should you receive an error message, please see Note 3.
 
 

Back to top 

 

 

B.2 Your Operating System is Mac OS
 
1) Close the TWS if it is running
 
2) Use the Spotlight search (the magnifier glass on the top right of your Desktop) to find the file tws.vmoptions
Normally the file is located within the Jts folder (a subfolder of your home folder)

3) On the Spotlight results panel, click on tws.vmoptions to open it. Should the system ask you how to open this file, click Choose Application... select  a text editor (TextEdit, Smultron, TextWrangler...) of your choice and click Open
 
 
4) Locate the line -Xmx768m. Cut it and paste it below the line ### Keep on update
 
6) Modify the value 768 in to 1536
 
7) Save and close the file

8) Launch the TWS with a double click on the Desktop shortcut Trader Workstation (Should you receive an error message, please see Note 3.
 

 Back to top 

 

 

Notes

 

1. Available system RAM
In order to check the amount of available system RAM on your computer, you can:
 - on Windows: use the key combination CTRL+SHIFT+ESC to start the Task Manager, click on the tab Performance and look for the "Available" Physical Memory. This will tell you the amount of unoccupied RAM in MB (1024 MB = 1GB)
 
 
- on Mac OS: Open Finder, go to Application --> Utilities and open Terminal. In the terminal type the command:
sudo purge
and press Enter. The system may ask you to enter your Mac user password. Enter the password. Once the command has completed, type the following command:
top -l 1| grep PhysMem
The "unused" value will tell you the amount of unoccupied RAM in MB (1024M = 1GB)

 

 

 2. Limitations of 32-bit Operating Systems
Please notice that 32-bit Operating Systems can normally only address a maximum of 2 GB of RAM per process (see table below for details). Because of this OS architecture limitation, if you have a 32-bit OS, the maximum memory allocation for the TWS must not exceed 2048 Mb.

 

3. Error: "Could not create the Java Virtual Machine"
This error may be displayed upon TWS startup if you set the memory allocation to a value higher than the available RAM of your system or if you set it higher than 2048 on a 32-bit Opertaing System. To overcome the error, you would need to decrease the memory allocation to a lower value using this procedure
 

Back to top 

 

Cloud Watchlists

Overview: 

This article explains how to setup Cloud Watchlists.

Background: 

It is now possible to synchronize the watchlists on your mobile devices with the watchlists of Trader Workstation on your computer. You will no longer need to worry about adding same tickers over and over again. The Cloud Watchlists feature is available in Trader Workstation build 936 and higher. Once the Cloud Watchlists have been enabled, they can be then imported in mobileTWS using the "Import" option from the Configuration menu.

Enable the Cloud Watchlists in Trader Workstation

  1. Login into the Trader Workstation
  2. Click on Edit in top menu, then on Global Configuration (or File -> Global Configuration if TWS is in the Mosaic layout)
  3. In the left column of the configuration window, click on Lock and Exit
  4. In the right pane, mark the checkbox "Save watchlists to cloud" (as shown in the screenshot below)
    Enable Cloud Watchlists in the TWS
  5. Click Apply, then OK to close the configuration window

Enable Cloud Watchlists on a mobile device

 

iPhone

  1. After the Cloud Watchlists feature has been enabled in TWS, login into mobileTWS
  2. Upon login, you will be prompted with a screen asking you to try the new feature
  3. Select "Try It", and then select the device/computer to import the watchlist from
  4. If you are not shown the "Try It" prompt, please go to the Configuration menu and select Watchlist Import and select the device/computer to import from
  5. In the Configuration meny, enable the option "Save Cloud Watchlists"

iPad

  1. After the Cloud Watchlists feature has been enabled in TWS, login into mobileTWS
  2. Upon login, you will be prompted with a screen asking you to try the new feature
  3. Select "Try It", and then select the device/computer to import the watchlist from
  4. If you are not shown the "Try It" prompt, tap on "Setup" in top left corner and enable "Save cloud watchlists"
  5. Back in the main screen, in top left section, tap on the Import button and select the device/computer from which to import the Cloud Watchlist

Android mobile or tablet

  1. After the Cloud Watchlists feature has been enabled in TWS, login into mobileTWS
  2. Upon login, you will be shown the Watchlist Import wizard
  3. Select the device/computer from which to import the watchlist
  4. To see the imported watchlists, navigate to Quotes and Charts from the main menu and select an imported watchlist from the dropdown

Please note that it is not possible to sync watchlists from mobileTWS to your desktop TWS.

 

 

 

 

Compatibility between MetaTrader and Interactive Brokers

Overview: 

Interactive Brokers (IBKR) provides to its account holders a variety of proprietary trading platforms at no cost and therefore does not actively promote or offer the platforms or add-on software of other vendors. Nonetheless, as IBKR's principal trading platform, the TraderWorkstation (TWS), operates with an open API, there are numerous third-party vendors who create order entry, charting and various other analytical programs which operate in conjunction with the TWS for purposes of executing orders through IBKR. As these API specifications are made public, we are not necessarily aware of all vendors who create applications to integrate with the TWS but do offer a program referred to as the Investors Marketplace which operates as a self-service community bringing together third party vendors who have products and services to offer with IBKR customers seeking to fill a specific need.

While MetaQuotes Software is not a participant of IBKR's Investors Marketplace, they offer to Introducing Brokers the oneZero Hub Gateway so that MetaTrader 5 can be used to trade IBKR Accounts[1]. Clients interested would need to contact oneZero directly for additional assistance. Please refer to the Contact section from the following URL.

Note: Besides oneZero Hub Gateway, different vendors such as Trade-Commander, jTWSdata and PrimeXM also offer a software which they represent, acts as a bridge between MetaTrader 4/5 and the TWS. As is the case with other third-party software applications, IBKR is not in a position to provide information or recommendations as to the compatibility or operation of such software.

 

1: oneZero is not available for Individual Accounts, please click here for more information on Introducing Brokers.

 

 

How to reset the TWS to the default settings on a Windows computer

Should you need to strip the TWS of any customization you did and revert to the default settings, use the instructions in this video.

Applicable to any TWS version under any operating system.

How to Create an Alarm

How to create price or volume based alarms in Trader Workstation

The Trader Dashboard

How to access and use the Trader Dashboard

Troubleshooting Trading Platform Login Failures

Click on the link below which best describes your situation:

 
 
 
 
a. Confirm whether your account has been approved. Accounts which have not been approved or which have been approved after the daily cut-off time are provided access solely to Client Portal and not the trading platform (access will be provided next day if approved after daily cut-off time)
 
b. Confirm whether your account remains open. Accounts which have been closed, either by customer action or by IBKR due to no balance, no longer have access to the trading platform but continue to have access to Client Portal in order to obtain activity and tax statements. Access to Client Portal is provided using the same User Name and password combination which existed when the account was open and do not require the use of the security device.
 
c. If you are attempting to log into your paper trading account, make sure that you are not using the user name and password combination from your live account. This combination is possible only if paper account is selected in the drop down menu of the login window.
 
 
 
 

a. If operating with a temporary passcode, note that alpha characters are case sensitive and are required to be input in upper case format

b. If operating a security card or electronic device, note that there are no spaces between characters

 
 
 
 
For security purposes, all requests for assistance with a user name and/or password must be initiated via telephone and require prior verification of the account holder’s identity. Requests are to be directed to one of the regional Client Services.
 
 
 
 
a. Confirm that your Internet connection is active (test by accessing another website). If you are unable to establish an Internet connection you will need to contact your Internet Service Provider for assistance.
 
b. Confirm whether you are operating under a firewall which is blocking the TWS connection. If so, the firewall would need to be re-configured in order to provide access.* 
 

c. Ports 4000/4001 are being blocked. These ports are often blocked from public connections such as hotels, cafes, etc. and required to be open to accommodate Inbound/Outbound TCP protocol. In addition, if you have a router connected to your computer, these ports must be open on the router.*

*Please click here to check your connectivity status: IBKR Dedicated Connectivity Test Page.

 
 
 
 
If you are temporarily without possession of your security device, interim access may be provided by contacting your regional Client Services via telephone where, once your identity has been verified, you will be provided with a temporary passcode.
 
The temporary passcode is a static alpha-numeric code which replaces the randomly generated code provided through your security device and which will provide full access to Client Portal and the trading platforms for 2 days. Should a longer period of permanent device replacement be necessary, and to obtain enhanced protection, it is recommended that you use the temporary passcode to log into Client Portal and print out the online security code card which will operate as a replacement to your security device for up to 3 weeks.  
 
After the expiration of the temporary passcode or online security code card, or if you regain possession of your security device beforehand, you will need to log into Client Portal and select the menu option to re-activate your security device.
 
 
 
 
In the case of a lost or damaged security device, you will need to contact our Client Services to arrange for a replacement and to provide for interim access. As the time frame for shipping a replacement device may range from 3 to 14 days depending upon your country of residence, interim access is provided via an online security code card. This card may be retrieved for printing or saving as an image to your computer once a temporary passcode has been provided for Client Portal access.
 
 
 
 
The temporary passcode is intended to provide full access to both Client Portal and the trading platforms for a period of 2 days. After 2 days, the temporary passcode may no longer be used to access the trading platforms but may be used to access Client Portal for an additional period of 10 days. The Client Portal access, however, is limited solely for the purpose of printing or saving the online security code card.  
 
If your window of access to Client Portal using the temporary passcode remains, you may print or save the online security code card through which full access to both Client Portal and the trading platforms is provided for a period of 21 days. If you are unable to log into Client Portal, you will need to contact your regional Client Services for assistance.

 

 

 
The online security code card is intended to provide full access to both Client Portal and the trading platforms for a period of 21 days. This time frame, while limited, is intended to provide sufficient opportunity for the account holder to either regain possession of a temporarily unavailable security device or request and receive a replacement device.
 
If you are unable to log in using the online security code card, you will need to contact your regional Client Services for assistance and to provide information as to the status of your permanent security device.
 
 
 
 
Depending upon your location, the physical security device should be delivered to the address of record on your account within 2 days in the case of US residents and within 2 weeks for all other accounts. It’s important to note that the permanent devices are set to automatically activate after a set time frame if not yet manually activated by the account holder. If this is the case and you encounter difficulties logging into your account, please contact our Technical Assistance Center from one of the numbers listed on ibkr.com/support.
 
 
 
 
If your window of access to Client Portal using the temporary passcode remains, you may print or save the online security code card through which full access to both Client Portal and the trading platforms is provided for a period of 21 days.
 
If you are unable to log into Client Portal, you will need to contact your regional Client Services for assistance.
 
 
 
 
You have received your new two-factor security device. Detailed instructions on its activation are in the envelope in which the device came. Alternatively, the card will auto-activate in 2-3 weeks, depending on your geographical location. 
 
 

How to Create an Alert On Trader Workstation

An example of how to set up alerts by creating a margin cushion alert.

Margin Cushion is calculated as follows:

(Equity with Loan Value - Maintenance Margin) / Net Liquidation Value

Use cases where assistance with system access is required

Overview: 

Please click on the use case below which best describes your login issue for guidance as to how to proceed:

I. No Access to Account Management or TWS

1. I forgot my User Name and/or password

2. I am temporarily without possession of my security device

3. My security device is lost or damaged

4. My temporary passcode has expired

5. My on-line security card has expired

 

II. Partial Access (Account Management only)

1. I am able to log into Account Management with my temporary passcode but not the trading platform

 

III. Full Access to both Account Management and TWS

1. I am in possession of my security device and wish to activate it.

 

 

 

 

 

 


  1. I forgot my User Name and/or password

For security purposes, all requests for assistance with a User Name and/or password must be initiated via telephone and require prior verification of the caller’s identity. Click here for a list of IB’s regional Customer Service center contact numbers.

 

  1. I am temporarily without possession of my security device

If you are temporarily without possession of your security device, interim access may be provided by contacting your regional Customer Service center via telephone where, once your identity has been verified, you will be provided with a temporary passcode.   

This temporary passcode is a static alpha-numeric code which replaces the random code supplied by your security device and which will provide full access to both Account Management and the trading platforms for 2 days.  Should a lengthier period of interim access be necessary and to obtain enhanced protection, it is recommended that you use the temporary passcode to log into Account Management and print out the on-line security card which will operate as a replacement to your security device for up to 3 weeks.   

After the expiration of the temporary passcode or on-line security card, or if you regain possession of your security device beforehand, you will need to log into Account Management and select the menu option to re-activate your security device.

 

  1. My security device is lost or damaged

In the case of a lost or damaged security device, you will need to contact our Customer Service center to arrange for a replacement and to provide for interim access. As the time frame for shipping a replacement device may range form 3 to 14 days depending upon your country of residence, interim access is provided via an on-line security card. The on-line security card may be retrieved for printing or saving as an image to your desktop once a temporary passcode has been provided for Account Management access.

 

  1. My temporary passcode has expired

The temporary passcode is intended to provide full access to both Account Management and the trading platforms for a period of 2 days.  After 2 days, the temporary passcode may no longer be used to access the trading platforms but may be used to access Account Management for an additional period of 10 days.  The Account Management access, however, is limited solely for the purpose of printing or saving the on-line security card.   

If your window of access to Account Management using the temporary passcode remains, you may print or save the on-line security card through which full access to both Account Management and the trading platforms is provided for a period of 21 days. If you are unable to log into Account Management, you will need to contact your regional Customer Service center for assistance.

 

  1. My on-line security card has expired

The on-line security card is intended to provide full access to both Account Management and the trading platforms for a period of 21 days. This time frame, while limited, is intended to provide sufficient opportunity for the account holder to either regain possession of a temporarily unavailable security device or request and receive a replacement device. 

If you are unable to log in using the on-line security card, you will need to contact your regional Customer Service center for assistance and to provide information as to the status of your permanent security device.

 


 

  1. I am able to log into Account Management with my temporary passcode but not the trading platform

If your window of access to Account Management using the temporary passcode remains, you may print or save the on-line security card through which full access to both Account Management and the trading platforms is provided for a period of 21 days. 

If you are unable to log into Account Management, you will need to contact your regional Customer Service center for assistance.

 


  1. I am in possession of my security device and wish to activate it.

To activate either a replacement device or one which was temporarily unavailable and which required issuance of a temporary passcode, you will need to log into Account Management and select the reactivate security device menu option.  Once reactivated, neither the temporary passcode nor on-line security card will remain operable.

 

Introduction to the Trader Workstation

Introduction to basic order entry concepts on the Trader Workstation

If you would like to see how to enable additional features on the Trader Workstation please click here

If you would like to see how to customize the Order Management page please click here

 

 

Syndicate content