Documentation for Version 1.12

A lot of features have been added since version 1.12. I recommend you read everything in the home page, features, documentation, and FAQ. If you need help setting up the program, I'll gladly walk you through it if you make a Paypal contribution. Most users usually can figure out how to use the program without reading everything here, if you read something here you do not understand, try asking another user or send me an email.

Click here if you are looking for documentation for version 1.11.

Download and Start the Program

Go to the download page to download the program if you have not already done so. You have the option of downloading the Java JAR file format or the new Windows EXE format. Java version 1.4 is required to run the program, if you are already using TWS, then you should be all set. All you need to do for either one is to copy it to any folder location you desire, and then double click on the file.

Sometimes, file compression programs such as WinZip or WinRar are associated with *.jar file extension. In order for double click to work, you need to remove the file association with any of the other applications other than Java. Otherwise, you can create a dos batch file with the following line to start the program, "javaw -jar AutoTrader.jar" without the quotes. Make sure javaw.exe is in your PATH environment variable.

When the program is first run, it creates a file called AutoTrader.properties file in the same location as the AutoTrader.jar file. This file is where all the program settings are stored. If you have the log to file set to on, a log file is also created in the same directory.

If you are upgrading from version 1.11, the properties and symbols file are still compatible, so you will not lose any symbols data or preferences you have set.

Setting Up the Program

If you are ready to use AutoTrader in real trading, or in simulation mode using live market data, you need TWS running first, and the TWS option menu Configure/API/Enable ActiveX and Socket clients must be selected. Otherwise, you can use the program in simulation mode and playback a data file that contains collected tick data. You can download a sample data file from the download section.

The first thing you want to do is setup the program Preferences. Select from the AutoTrader menu File/Preferences or click the Preferences toolbar button. This will open the Preferences dialog window where you can setup program defaults.

The Preferences window is grouped into four sections, Connection, Main Window Options, Logging and Contract Information. In Contract Information section, you need to define Contract security that you are going to use for trading in the main window. If this is the first time you are using the program, three sample contracts will be generated for you.

To add a new contract, click on "New" button. Enter the information for the contract, click the "Details" button to get the tick size information for the contract (you must be connected to TWS for this to work). Click the "Save" button to save the contract information.

To edit an existing contract, simply change the information on the displayed contract, and then click "Save" when done. You need to edit contract information, say every quarter for options and futures to use the front month contract.

If you click the "Default Contract when Program Starts" checkbox on the currently displayed contract, that contract will be used when the program starts.

If you check "Log Messages to File", AutoTrader will send log messages to file, in addition to displaying them in the Message tab in the Main window. AutoTrader now uses the industry standard log4j libraries for logging messages. If you are familiar with log4j, you can modify the log4j.properties file to customize the log messages printed out according to your needs. There are also many third party programs available to process log4j messages. Visit http://jakarta.apache.org/log4j if you want to learn more about it. The file naming convention for the log file has changed as a result of using log4j. The current day's log is always logged to a file called AT.log. At the end of each day, the log file will be renamed to AT.log.MM-DD-YY.log, and the AT.log will contain messages for the new day. This is the Daily Rolling File feature of log4j.

Click Ok to Save and exit this window, click Cancel will not save any of the changes you made.

Trading Simulation

A major new feature introduced in version 1.12 is ability to paper trade. You have the choice of using live market data or you can collect market data, and then use it later to simulate trading. When you select "Simulate Trades" in the preferences dialog, none of your orders will be submitted to TWS, all orders are simulated. When you click "Ok" on the preferences dialog, and you request a connection to TWS, it will prompt you if you want to run simulation using live market data or not. If you select yes, then it will request market data from TWS and that is what will be displayed in the Market Data section. If you select "No", then it will open up a File Chooser dialog, and you need to select your market data file. If you have not collected any data yet, you may try out this feature by downloading the sample market data from the download section.

To collect market data, anytime you are displaying live market data, select from the menu File/Start Data Collection, and it will prompt you for a filename to save the collected data into. The complete data is collected, including timestamp. So whenever you playback the data, the spacing between the tick information will be very close to the original timing of the tick data. So if there is heavy volume trading, the tick data will display faster, and during slow trading, the tick data display during playback will also be slow.

In simulation mode, Account Information, Trade Executions, and Positions are not updated. You will need to go to the log for now to review your simulated trades.

The Main Window

The main window is grouped into five sections.Market data, Monitor, Position Entry, Position Exit and Messages and Info section. Most of the components have tooltip help text. If you move the mouse pointer to a component (text entry box or button), it will display some help message.

Mouse wheel is used in text entry boxes as the main means of changing values. AutoTrader is the first program to introduce this feature and the rest followed. To change the value of an entry box, simply move the mouse cursor inside the box, and turn the mouse wheel up to increase the value, and turn the mouse wheel down to decrease the value. Note than when you change the value, the background color of the entry box changes to "light yellow" color. This gives you some visual feedback that the value has changed. The new value is only applied when you move the mouse cursor out of the entry box. If you move the mouse wheel and stop back at the original value, then the background color will return to "white" and when you move the mouse cursor out of the entry box, no change will occur. This method is more efficient than the clicking on a + or - button, as the change is only applied once you have your final value (when you move the mouse cursor out, as compared to updating an order everytime the + or - button is clicked). Of course you can always type in the value and change is applied when you type tab or click another component. Yet another option is you can right click on an entry box and possible choices will be displayed in a popup menu and you can select the value using the mouse.

Most of the sections are self explanatory, or you can get the information you need from the tooltip messages. I will just provide some description of the Position Entry and Position Exit sections.

Position Entry

On the main window, the selected contract will automatically receive market data if you have a successful connection to TWS. Or you can playback a data file collected during a previous trading session. You have two options for position entry, the first is the One Click option, and the other is the Classic option. The One Click option is pretty straightforward. All you need to do is set the Qty to trade, then click on one of the six possible order options. In Classic mode, you need to specify Buy or Sell, then the Order Type Limit, Stop or Market (stop limit not yet supported, it will be in a future version). And if you selected limit or stop order type, the limit and stop trigger price. You click on the "Submit" button when you want to place the order.

Note that if your Qty is more than 1, then there is the possibility of getting a partial fill. In this case, if you have the "Enforce Stop on Partial Fill Qty" option checked (highly recommended), the anytime while the order is waiting to be completely filled and the price goes against you by the amount you set in Stop Offset, the unfilled balance order is cancelled and then the partially filled position is closed.

SmartTrack is useful mainly in market where the bid/ask spread is usually more than one tick (FTSE on LIFFE for example), and for Buy on Bid/Sell on Ask orders only. If the spread of the market is usually more than one tick, and if the Ask price during a Buy order comes down, there is a good chance the Bid price will also go down, in this case, if SmartTrack is selected, the Buy on Bid order will update the order to move down one tick (vice versa for Short orders). For E-mini and other contracts where bid/ask spread is usually one tick, this option is better to be left unchecked.

Position Exit

Position exit order always comes as a target limit order and a stop order pair. If "Auto Send Exit Order" option is checked (highly recommended), then once the main order is completely filled, the two exit orders are submitted immediately as OCA orders if "Stop Trigger on Last Price" option is selected. If "Stop Trigger on Bid/Ask" is selected, then the Stop Order is just simulated in the program. The position will be closed by submitting a limit or market order when the Stop Offset is hit. The Stop order will be the Fill Price less the Stop Offset amount, and the Target Limit order will be the Fill Price plus the Target Offset amount (opposite for short position).
If "Auto Trail" option is checked, then every time the current bid price (for long position) or ask price (for short position) goes in your favor, the Stop Market price is advanced correspondingly. However, the advanced can be delayed by specifying a "Trail Increment" higher than the tick size of the contract. For example, the tick size of ES is 0.25, by default, for every 0.25 the price goes in your favor, the Stop Order price is advanced the same amount. However, on some situations, particularly in volatile market conditions, you may want to delay the Stop trail after the price has moved a little further in your favor. So for example, setting the Trail Increment to 0.75, the Stop Price is only adjusted if the Best Price of the current position has advanced by 0.75 instead of every tick.

AutoTrader also allows you to scale out your position at your specified increment. Lets say you have 10 contracts of ES, if you check the "Scale Out" option, and specify a Scale Out Qty of 3 and a Target Offset of 1.0, for every 1.0 advance in the Best Price, 3 contracts will be closed, until your position is completely closed.

If you selected Use Mkt to Close, whenever you click the "Close (Long/Short) Position" button, it will submit the order as a market order (same thing if a simulated stop is hit). If you selected Use Lmt to Close, the the order is submitted as a limit order, but you can add some safety to your limit order. So for example, if the current bid is 800.50 and you want to close you position using a limit order with a tick safety of 2 ticks, the the limit sell order will be submitted at a limit price of 800 (800.50 less two ticks). This is useful in case of fast market, where by the time you click on the button, the price has already moved another tick or two. If the bid remained at 800.50, even if you submitted a sell at 800, your fill will still be at 800.50.

Position Risk Management

If your position is already in your favor, but the Stop Price is still below break-even, (say your Stop is 1.5 but the position is already 1 pt. in favor), and you do not want to wait any longer, you can click on "Breakeven Stop" button and the Stop Order price will be moved up to your Fill Price. This way, the only loss you will incur is just the commission, and possibly some slippage.
If you have "Scale Out" enabled, sometimes you might have a feeling you want to scale out before the current target is reached, you simply click the "Scale Out Now" button and the current target order will be closed, and the next block of exit orders will be submitted, and so on.

Another way to manage risk is by adjusting the Target Offset, Stop Offset or Trail Increment while the exit orders are active. Lets say your original Target Offset was an optimistic +10, but after you get into your position, you realize it will never make it there, while the Exit Orders are active, you can use the mouse wheel or type in a new number into the Target Offset field, say 5, and then hit tab, and immediately the Limit Order is updated to have a limit price of Filled Price plus the new Target Offset price you entered. The same is true for changing Stop Offset and Trail Increment.

The "Reverse" button is available only if you selected "Enable Reverse Function" in the preferences dialog window. If you first enter a long position, and all of a sudden the market turns around, you can click on the "Reverse" button and your long position will be closed, and a new short position will be opened. The method of closing for a long position is an order to sell twice the long position quantity will be entered, and once the order is filled, the Position Exit orders for the short position will be submitted.

Sunday, March 23, 2003 9:06 PM