|
|
Investor/RT and AutoTrader Software
and

Important Information about
AutoTrader
This Investor/RT release is designed to operate with
the AutoTrader beta latest version 1.24.145 or higher. AutoTrader version
1.24 can be downloaded from the AutoTrader web site at:
AutoTrader Web Site
AutoTrader Download Page
AutoTrader is a Java application for trading order
management and simulation that operates in conjunction with the
Interactive Brokers TWS software.
Investor/RT users can use AutoTrader to initiate AutoTrader managed
trades, or AutoTrader may be used as a conduit for submitting trading
orders directly to Interactive Brokers from within the Investor/RT
software environment. AutoTrader supports only a single managed trade at
one time. If you want to issue orders for multiple instruments, e.g. pair
trading a pair of stocks or futures contracts, then these orders can be
passed to Interactive Brokers directly by AutoTrader. There is no
AutoTrader management of stops and target in this case. Integrated support
for AutoTrader in Investor/RT is built into the "Trading Order". Click
here for more information on Investor/RT Trading Orders.
In a nutshell, a Trading Order is a named specification (a "preset") for
an order. Trading orders are usually (but not always) associated with and
are executed by a "Signal Action". A signal action is a named
specification for one or more actions to be performed when the signal
action is executed. Trading Orders can executed in several ways:
- Manually, by clicking on a chart button setup for
the purpose of executing some signal action or trading order.
- By an indicator in a chart (e.g. a signal marker,
trend line, reference line) that has an associated signal action.
- By a trading system rule associate signal action.
Trading systems run inside charts using the Trading System indicator.
- Using the Interactive Brokers order desk window in
Investor/RT to directly send a specific trading order.
Chart Buttons may be setup to execute
trading order setups directly or to execute signal action which have an
associated trading order. If you want the clicking of the button to be
accompanied by a particular sound, or if you want a signal to be tested as
confirmation before sending the trading order, then you must create a
Signal Action preset and specify the signal action as the button's
purpose. If the only thing you want to happen when you click the button is
to send a trading order, create the button with the purpose "Execute
Trading Order" and include the name of the trading order preset you wish
the button to initiate. There are a number of convenience features in
Investor/RT that makes setting up trading order buttons very easy.
Adding Trading Buttons to Investor/RT Charts
The first method, the manual method, for using AutoTrader is to include
chart buttons in your chart(s) for buying, selling, closing positions,
etc. It is very easy to setup chart buttons that initiate trading orders
to IB via AutoTrader. As a simple example, suppose you want to setup two
buttons in your chart, one for sending a market order to buy 100 shares
and another market order to sell 100 shares. Open the chart to which you
want to add these trading buttons. Leave the chart open as you begin the
setup process for the trading order.
Press Alt-T (Apple-T) or click the Setup Menu and choose "Trading Orders".
When the "Trading Order Preferences" window appears, choose "Interactive
Brokers" as the Destination. Setup the order's action as Buy, Quantity
100, and choose "Market" as the Order Type. For Symbol, choose "Default".
This means that the ticker symbol for the order will be determined when
the order is submitted based on the symbol in the chart. Finally, check
the box "Request Confirmation...". This completes the setup the order
properties. Click the "Presets" menu at the bottom of the window and
select "Send to Chart as Button". A prompt for a name will appear. Provide
a name for this trading order preset; call it "Buy Market". A button will
then appear in the chart window titled "Buy Market". To create the sell
order, simply change the order action from Buy to Sell, click the Preset
menu again and select "Send to Chart...". Enter the name "Sell Market" and
click OK. A second chart button will appear in the chart window titled
"Sell Market". In the Trading Order Setup window, click cancel or OK, or
press the esc key to dismiss the window.
You can test the chart's newly added trading buttons by clicking them.
Since you checked the Request Confirmation check box in your trading order
setups you will be prompted for an OK before the order is sent to
Interactive Brokers. The confirmation message is displayed in green text
for buy orders and red text for sell orders. Click "cancel" in response to
these so that the orders are not sent to IB. Now change the ticker symbol
in the chart. Test the buttons again. Notice that the orders are now
pegged to the ticker symbol currently in the chart.
If you are using IB as your real-time data source, you can test the
Investor/RT trading orders more extensively before using them for actual
trading by running the Interactive Brokers TWS software in demo mode
(using user name edemo and password demouser) rather than your actual IB
Account. If you are using one of the other real-time data feeds as your
real-time data source you can leave your IB/TWS running with your real
trading account, but setup AutoTrader in "Simulation Mode" rather than
"Live Mode". The AutoTrader software must of course be running and
connected to TWS. When you click the button "Buy Market" in the chart,
Investor/RT will present the confirmation message. Click OK and the order
will be sent to Interactive Brokers via AutoTrader. Trading Orders with a
destination of "Interactive Brokers" will be sent to AutoTrader as
pass-thru orders. This means that AutoTrader will simply serve as a
conduit to send the order to IB and will not manage the trade in any way.
Use the order destination "AutoTrader (IB)" to initiate "managed" trades.
Managed Trades will have one of four Order Types: "Buy" (go long), "Sell"
(go short), Reverse, and Close Position. User preferences in the
AutoTrader software control how the trade is managed. See AutoTrader
documentation for details. Investor/RT trading orders have several "order
actions" that have to do with setting stops and targets for managed
trades. These order actions will be covered in detail later.
If you wish to shorten the button titles, right-click on the button and
choose Edit Button. Shorten the name to "Buy". You may choose to color
code your trading buttons, e.g. green for the "Buy" button and red for the
"Sell" button.
In this simple example, the order quantity in the trading orders is fixed
at 100, but suppose that you want your trades to be different sizes
depending on the price of the stock you are trading. This can be easily
accomplished using a V# user variables. First, go to Setup: Preferences:
User Variables and setup a user variable, e.g. V#33 as your order quantity
user variable. Assign the name "Order Qty" to V#33 and set the display
format to 99 (meaning whole number display, no decimals).
Return to the chart, right-click on the "Buy" button and choose Edit
Button. You will see that the button setup calls for executing the trading
order preset named "Buy Market". Click the "Edit" button to edit the Buy
Market trading order. Note that there is a shortcut for editing trading
order buttons: ctrl-click (option click on Mac) on a chart button and
Investor/RT will open the associated trading order for editing. This
ctrl-click shortcut works for signal action buttons and technical
indicator preset buttons as well. The ctrl-click tells Investor/RT you
want to edit trading order associated with the button, not the button
itself.
Look at the trading order setup. Note that the order quantity is set to a
constant 100. Edit the 100, changing it to V#33 (you can type in V33 or
v33 or v#33 or v 33 and Investor/RT will recognize that you mean user
variable V#33. Click OK to save this modification and close the trading
order. Your chart button will now use the value contained in the symbol's
user variable V#33 when composing the order for Interactive Brokers.
We recommend that you create a user-defined quotepage named "Trading List"
to keep a list of the stocks or futures you are trading. Open (or create
this quotepage) add the symbols you want and add V#33 as a column to this
quotepage. You will see the column title "Order Qty" for this user
variable. Suppose your chart contains the stock CSCO, make sure CSCO is in
your Trading List. You can enter a value for Order Qty directly into the
quotepage cell for CSCO. Enter say 200 and press enter or tab to complete
the entry. Then return to your chart and click the "Buy" button. You will
notice that the confirmation message reads "Buy 200 CSCO...". The ticker
CSCO was obtained from the chart's instrument, the quantity 200 was
obtained from user variable V#33 for CSCO. This illustrates the concept
that trading orders in Investor/RT are essentially "templates" for
submitting orders. The same V# variables techniques are available for
"Limit Price" and "Stop Price". Set aside say V#34 as your limit price
variable and V#35 as your stop price variable. Then when you create
trading order presets for limit or stop orders you can specify V#34 and
V#35 respectively.
Does this mean that you have to enter limit and/or stop prices into
quotepages before you can submit a trade. No, of course not. You can do
this if you wish, but a better way is to add "Reference Lines" indicators
to your trading chart. Add a reference line setup to track V#34 (limit
price) and another pegged to V#35. You can enter "ball park" numbers for
these reference lines into your quotepage cells directly, or you could
simply run a daily scan to "set" these V# variables to reasonable values
for your entire list of symbol. For example, each day before the market
opens you schedule a scan to run on your "Trading List" quotepage,
setting, for each instrument, the limit price to say .5 above the last
trade and the stop price to .5 below the last price. The scan formula
would be: SET(V#34, CL + .5)
AND SET(V#35, CL - .5); Now when
you view your chart (and change from ticker to ticker) you will see your
two limit/stop lines above and below the current trading level. You can,
of course, color code these lines appropriately and you can specify a text
label for each line, e.g. "Limit" and "Stop". Now as you drag the
reference lines up and down the price scale you are not only moving the
line but you are also updating the value of the associated V# variable.
The values in the V# variables that will be used when your limit (or stop)
orders are submitted.
Auto Trading Using Investor/RT Trading Signals
The second method of executing trading orders is to associate the trading
order with a signal action that operates in an Signal Marker or some other
indicator in a chart. A signal marker indicator in a chart essentially
checks a user-specified trading signal written in the RTL language. When
the signal triggers TRUE on the current bar, the associated signal action
triggers. By associating an AutoTrader or Interactive Brokers destined
trading order with such a signal action, trades to enter or exit a
position can be initiated automatically by Investor/RT. Automated orders
can be based on any market condition expressible in the RTL language.
Notice that the Trading Order need not have "Request Confirmation" check
marked, although this is certainly recommended until you are very well
versed and comfortable with the operation of your trading signals.
In the earlier example, reference lines were used as a vehicle to adjust
stop and limit order prices before submitting trading orders via button
clicks. Note also, that you can click on a reference line to select it,
then use the up/down arrow keys on the keyboard to move the line and its
associated V# user variable up or down one price tick. Another way of
using reference lines is to have the reference line serve as a trigger for
submitting an order, just like a signal marker does. For example you can
create a signal action that will play some alert sound of your choice and
submit a sell order when the instrument trades at or above the reference
line.
To do this, we first must create the Signal Action and setup it up with
the proper trading order. Press Alt-T to quickly open the Trading Order
default preferences. Then choose "Signal Action" from the list of names at
the left. Setup the Signal Action to Play a particular sound, then mark
the "Trading Order" check box and choose "Sell Market" (the name of our
sell market order preset created earlier). Then click the Preset Menu at
the bottom and select "New...". Provide a name for this Signal Action
preset, e.g. "Sell Market Action". Press esc to dismiss the setup window
and return to your chart. Edit the reference line in the chart
(right-click on the line and choose Edit). Check mark the "Action" check
box. Then choose "Sell Market Action" from the list of Signal Actions and
click OK. The reference line will then "monitor" price levels and as soon
as the instrument in the chart reaches or penetrates the reference line,
the signal action will fire and the trading order will be sent to
Interactive Brokers. In this example, we describe the reference line as a
target price for selling to exit a long position when prices rise up to or
above the target reference line. A similar reference line stationed below
the current trading price could be used to trigger a sell order if price
falls to or below the reference line. The reference line can be
repositioned, moved up like a trailing stop, using the arrow keys or by
dragging the line with the mouse. Similar techniques can be used to handle
stops and targets in short positions. Signal Markers, Trend lines, and
Horizontal Reference Lines all have this "Signal Action" capability.
Using the Order Desk for AutoTrader/Interactive Brokers
Setup: Preferences: Order Desk can be used to specify
AutoTrader/Interactive Brokers as your preferred order desk. Thereafter,
clicking the Place Trade button on the main toolbar (keyboard shortcut
Alt-L) will open the AT/IB order desk window. The order desk window
presents a list of your trading order presets and trading order groups,
and a list of the ticker symbols in your "Trading List" quotepage. You can
select a trading order (or group) and a symbol and then view the order's
description in the text box to the right. Buttons are provided for editing
the selected trading order or creating new trading order presets. This
window dynamically updates to show the current bid, ask, and last trade
and sizes for the selected symbol. When the symbol you have selected has
an open position reported to Investor/RT by AutoTrader, you will see Long
or Short and Quantity in the live quote display at the upper right of the
window.
Trading orders with limit or stop prices expressed as V# variables will
update dynamically as V# values are updated/recalculated. Orders may be
sent to AutoTrader using the Send button. A find box is also provided for
entering a search pattern. Investor/RT will respond by listing the trading
orders that match that pattern. For example, the pattern text *buy will
list only trading order that contain the text "buy" in their trading order
preset name. If you have a stop or limit trading order with "Mouse Click"
as the limit or stop price, sending the order will cause the intra-day
chart for the symbol in question to appear prompting for limit or stop
price selection. Click the mouse at the price level you wish and select
the actual limit or stop price from the ensuing pop up menu. Limit/Stop
price selection via menu is exactly the same as if the order had been
placed directed from within that chart via chart or trading signal for
example.
The AT/IB Order Desk is a convenient play to define new trading orders or
edit existing ones. You can also delete, rename, view and edit Trading
Orders and Trading Order Groups using the Object Editor Window. The Object
Editor window is opened by clicking on the Object Editor button on the
main toolbar.
Getting Feedback from AutoTrader
Investor/RT Version 8 also has capabilities of receiving "feedback" when
operating with AutoTrader. New quotepage columns named "Position",
"Position TR", "Fill Price", "Fill TR", "Fill Time", "Target" and "Stop"
are available for display in Investor/RT Quotepages. At present the
Position, Position TR, Fill Price, Fill TR and Fill Time will update when
Investor/RT receives an "order filled" status back from AutoTrader. The
RTL tokens POS_SIZE and ENTRY can be used to refer to the position size
and fill price (entry price) values in scans and in trading signals active
in chart windows. Note that POS_SIZE and ENTRY have a different meaning
when backtesting or using the Trading System indicator. Instead, use
TR_POS, TR_FILL tokens if you use Trading System Indicator. The Target and
Stop quotepage columns can similarly be referred to using TARGET and STOP
tokens in RTL.
When AutoTrader has a managed position open, the Investor/RT user can send
trading order with order action "Get Position Info" and AutoTrader will
respond with the current values for Target and Stop for the position.
These values are reported to the quotepage Target TR and Stop TR columns.
These values can be referenced for the instrument in question using RTL
tokens TR_TARGET and TR_STOP respectively.
Submitting Limit and Stop Orders from Investor/RT Charts
Investor/RT 8.0 supports trading order setup where the Limit Price or Stop
Price can be setup as "Mouse Click". This kind of setup means that when
the order is executed by Investor/RT, the software will prompt you to pick
your limit or stop price by clicking inside the chart window where the
order originates. A prompting message will appear in the middle of the
chart window and the cursor will change to indicate you are being prompted
for a price level. Click the mouse inside the chart window at the
approximate price level you want and Investor/RT will pop up a menu of
selectable prices at or on either side of the price you clicked upon. If
you mis-click, simply click again at some different price level and the
pop up menu to revise itself. After selecting a price from the menu, the
order will be submitted to AutoTrader, with an intervening confirmation
box if you have requested order confirmation before submission. The
confirmation message will display the actual limit price or stop price
from your menu selection.
The AutoTrader / Interactive Brokers Order Desk Window
Setup: Preferences: Order Desk can be used to specify
AutoTrader/Interactive Brokers as your preferred order desk. Thereafter,
clicking the Place Trade button on the main toolbar (keyboard shortcut
Alt-L) will open the AT/IB order desk window. The order desk window
presents a list of your trading order presets and a list of the ticker
symbols in your "Trading List" quotepage. The order desk is of little or
not value until you have created and populated your Trading List quotepage
with instruments that you wish to trade via AutoTrader.
Important Note Regarding Ticker Symbols
When trading stocks, there is no confusion at all about ticker symbols.
You can use AutoTrader and Investor/RT together to trade stocks regardless
of whether you use the IB Version of Investor/RT or whether you use one of
the commercial data vendors that Investor/RT supports (eSignal,
DTN/DTN.IQ, myTrack). When trading futures however, the ticker symbols
used by the commercial data vendors will usually differ from those used in
the TWS IB System. For example, if you are using eSignal and track the
current front month S&P E-Mini Contract, your Investor/RT ticker symbols
will be ES #F or ES U5, for DTN.IQ it will be @ESU5 for the Sept 2005
contract expiration. When sending trading orders for these Investor/RT
ticker symbols it the TWS/IB software, Investor/RT uses the "Brokerage
Alias" symbol. The "Broker Alias" for each Investor/RT instrument can be
setup using Setup: Instruments in the Advanced section. Or you may add
this data column to your Trading List or any other quotepage and edit the
broker alias cell directly in the page.
Investor/RT uses the following convention for broker alias symbols for
futures contracts:
XXXXMY
where XXXX is a 1 to 4 letter future class (future type) for the contract
in question.
M is a one letter month code, the industry standard future month code,
e.g. H for March, N for June, U for Sept and Z for December.
Y is a one digit year code, e.g. 5 for 2005, 6 for 2006, etc.
Thus, for example, the broker alias for eSignals ES #F would be ESU5 for
the Sept 2005 expiration. For the Euro FX E_Mini futures the DTN.IQ
Investor/RT ticker symbol would be @EUU5, the IB/TWS future type is EUR,
thus the broker alias for @EUU5 should be specified EURU5. Note that
internal to TWS/IB, IB sometimes refers to this as 6EU5, but remember, the
Investor/RT convention is to use the future type + the month code + the
year code. Internal IB "local symbols" do not affect the ability of
Investor/RT and AuutoTrader to convey proper trading orders to TWS.
Investor/RT uses the future type code, expiration date, and proper IB
exchange code to convey trading orders. All the user has to do is code the
broker alias with the correct IB future type (sometime call the underlying
symbol or underlying type in IB terminology). Now, what about the exchange
code needed for trading? The exchange code for a large number of common IB
futures types is kept in the Investor/RT database. In effect, Investor/RT
"knows" that the exchange code for the ES and EUR is GLOBEX so you do not
have to specify this anywhere. You can view or update future type
information using Setup: Futures. Click the Setup button at the upper
right and enter EUR as the future type. You will see there the GLOBEX is
the exchange code that Investor/RT will use when communicating with
AutoTrader concerning EUR future contract trading.
Continuing now with the discussion of the Order Desk...
You select any trading order name listed in the order desk and an
associated symbol if applicable and then view the order's description in
the text box to the right. Buttons are provided for editing the selected
trading order or creating new trading order presets. This window
dynamically updates to show the current bid, ask, and last trade and sizes
for the selected symbol. Trading orders with limit or stop prices
expressed as V# variables will update dynamically as V# values are
updated/recalculated. Orders may be sent to AutoTrader using the Send
button. A find box is also provided for entering a search pattern.
Investor/RT will respond by listing the trading orders that match that
pattern. For example, the pattern text *buy will list only trading order
that contain the text "buy" in their trading order preset name. If you
have a stop or limit trading order with "Mouse Click" as the limit or stop
price, sending the order will cause the intra-day chart for the symbol in
question to appear prompting for limit or stop price selection. Click the
mouse at the price level you wish and select the actual limit or stop
price from the ensuing pop up menu. Limit/Stop price selection via menu is
exactly the same as if the order had been placed directed from within that
chart via chart or trading signal for example.
OCA orders are supported via an OCA check box in the Trading Order setup.
Also, trading order groups are also supported. A trading order group is a
collection of two or more orders that can be submitted as a group at the
same time, either via a button click or via the IB/AT Order Desk.
Creating Trading Orders for AutoTrader
Use the "New" button in the AutoTrader/IB Order Desk window to create a
new trading order. If you want AutoTrader to manage the trade for you, set
the Destination of the trading order to "AutoTrader Managed (IB)". See the
AutoTrader documentation for details on how AutoTrader provides stop and
target management of trades, scale in and scale of positions, etc. If you
want more direct control over all trading activity, create trading orders
with Destination "Interactive Brokers". These are called "pass thru"
orders, Investor/RT sends such orders to AutoTrader and AutoTrader passes
them to The IB/TWS for execution. It takes less than a second from the
instant Investor/RT sends the order until it is received by the IB/TWS
software, whether the order is for an AutoTrader managed position or a
pass thru order.
The choice of "Order Action" depends on the destination. First, consider
the order actions that are available when AutoTrader Managed is the
Destination:
-
Buy - Enter a new long position.
-
Sell - Enter a new short
position.
-
Reverse - Reverse the current
open position.
-
Close Position - Exit the
current open position
For Buy and Sell order actions, a
variety of order types are available: Market Orders, Limit Orders, Stop
Limit Orders, and Stop Market Order (called Stop Orders). There are also
special AutoTrader limit orders, called Buy@Bid, Buy@Ask, Sell@Bid and
Sell@Ask, where AutoTrader supplies the limit price from the current bid
or ask of the instrument being traded.
There are several order related command for getting or setting values used
in the trading management activities of AutoTrader, for example, Get AT
Position Info can be send as an "Order Action". AutoTrader responds with
the current position symbol, qty long or short, current target price and
stop prices. These values are posted to the Investor/RT instrument. YOu
can see the values in a quotepage via the "Position TR", "Target TR" and
"Stop TR" columns, or you can reference the current value of these fields
in RTL formulas using tokens TR_POS, TR_TARG, and TR_STOP. When an
AutoTrader position is initiated, the TR_Fill token is also set to the
fill price of the position, the entry price.
The order actions Set Target, Set Target Offset, Set Stop, Set Stop Offset
cause AutoTrader to adjust the current stop or target price in the IB/TWS
for the currently open position.
Now, let's consider pass thru orders, trading orders with Destination
"Interactive Brokers". This Order Actions are similar, but keep in mind
that there is no AutoTrader management and any stop or target related
brokerage orders must be initiated individually if you use pass thru
orders. The advantage of pass thru orders is that the Investor/RT user can
have as many different open positions as you like. AutoTrader is limited
to managing one instrument at a time. YOu can add to a managed position
but you cannot have managed positions for more than one instrument at a
time. Here are the pass thrus order types:
-
Buy - Enter a new long position
-
Sell - Exit a long position
-
Buy (cover) -Buy to cover a
short position
-
Sell Short - Enter a new short
position
|