PTL Trader Guide
PTL Trader is a proprietary automated trading system solution for pair trading. See more information here. You can use it to execute your pair trading strategy portfolios you have built using the Pair Trading Lab website Portfolio Manager.
- Windows OS compatible with Java 7 is required
- 32-bit Java 7 (1.7) or newer is required. The installer checks this. 64-bit Java is not supported at this moment, but it will be at some point.
- PTL Trader requires Interactive Brokers TWS or IB Gateway, providing an API access. Server IB API version 66 or newer is required.
PTL Trader and Portfolio Manager are only available to Premium Members.
Installation & Setup
In order to use PTL Trader application, you must obtain PTL Trader API keys first. They are used to authenticate the application running at your side against our server, so the application is able to retrieve your portfolio and settings and send back your trading stats (unless confidential mode is used). There are two keys needed - the Access Key and the Secret Key
Steps to do:
- Go to the Pair Trading Lab website and login to your account
- Go to Menu -> PTL Trader -> Setup & Download (if you don't see this, you are not a Premium Member or your membership has expired) (see the screenshot)
- If you don't have API access keys yes, you will see a button Generate PTL Trader keys for me now. Press it, it will generate your keys and setup your PTL Trader access immediately
- When you already have API keys generated, you can see your Access Key already. In order to see your Secret Key press the link saying "click here to see my Secret Key".
- Now, you can download the PTL Trader MSI installer by clicking the button Download PTL Trader. You download should start.
- Check software requirements above
- Run the installer to install the PTL Trader application. The installer checks the Java version, so it won't allow you to install if you don't have Java or if it is outdated
- Run PTL Trader from your start menu
- Go to the Settings tab and fill in your access keys. By pressing Connect button it should authenticate and connect to our website and download your portfolios you created in Portfolio Manager
- Start IB Trading Workstation or IB gateway, enable socket-base API access in settings
- In PTL Trader settings, check the IB ABI Client Id and Port if matches what you need. Client Id can be 1 if PTL Trader is the only application connecting to your API. Default port numbers are 7496 for TWS connection and 4001 for IB Gateway connection.
- Press Connect. It should connect to your IB API now.
- You are ready now to setup your portfolios and account bindings.
Multiple Instances & Autostart
PTL Trader supports running in multiple instances on the same machine, but each instance must run under a different configuration profile and must connect to different IB account. The default configuration profile name is default, which is used when no command line arguments are used. If you want to start the application using different profile, you have to manually specify the profile in command line arguments. Argument syntax is this:
<profile name> [autostart]
If autostart is specified, PTL Trader will automatically connect to both Pair Trading Lab site and IB account, as long all credentials are already configured in the Settings panel. You can use autostart feature e.g. for automatic system start after your VPS reboots. Please note that the autostart is always the second argument, so if you want to use autostart with default profile, command line arguments will look like this:
Good practice is to create file shortcuts, where you can specify command line arguments directly like on the screenshot on the right. PTL Trader installation comes with two default application shortcuts:
- PTL Trader - profile: default, no autostart
- PTL Trader (second instance) - profile: secondary, no autostart
For instance, you can use the first one for regular trading, the second one for paper trading. You can of course edit those default shortcuts yourself, e.g. to enable autostart feature.
Again - you need to worry about profiles only if you use two or more PTL Trader instances on the same computer. If you run them on different machines, you can stick with default profile.
Remark: if you run multiple instances on the same computer, each instance must connect to a different IB TWS/Gateway instance!