|
||
|
|
Investor/RT Tour Trading Systems and BackTesting See Also:
Backtesting Video Series Investor/RT now makes it possible to define a trading system. A trading system is composed of one or more trading rules. Each trading rule is in turn composed of a trading signal and an associated action such as buy, sell, sell short, etc. Trading signals are logical expression (true or false statements) written in the Investor/RT Language (RTL). RTL is the language used to compose scans, custom indicators, and trading signals in Investor/RT. Once a trading system has been defined in Investor/RT and given a name, the user can Backtest the trading system using historical data for one or more instruments. BackTesting refers to the actual execution of the trading system on a security, or set of securities over a given period of time. It simulates decision making based on past data, and is effective in refining systems in order to optimize future performance. Upon completion of the Backtest, Investor/RT displays a summary and a detailed report of the performance of the trading system over the specified period. The user can make revisions to the trading rules, add or remove rules, or adjust the trading signals used in the rules, then Backtest again to see if the revisions improved the performance of the trading system. Here is a sample summary report for a simple trading system (resize the Help window wider for best results). IRT_TRADING_SYSTEM COMPUTER ASSOC INTL-Daily 08/03/98 - 12/30/99 Performance Summary: All Trades Gross profit $15,905.00 Maximum Drawdown 2,312.50
Commissions $176.00 Total # of trades 11 Percent profitable 81% Number winning trades 9 Number losing trades 2 Largest winning trade $3,765.25 Largest losing
trade $1,828.50 Largest winning long $3,765.25 Largest losing
long $1,828.50 Number periods long 79 Percent periods long 22% Max consec. winners 5 Max consec. losers 1 ------------------------- BackTesting by Investor/RT, © 1996-2000 Linn Software, Inc. Investor/RT produces a detailed report showing the date and time each trade occurred, the signal that triggered the action, and account balance information at each entry and exit during BackTesting. Here is some sample detailed output: IRT_TRADING_SYSTEM COMPUTER ASSOC INTL-Daily 08/03/98 - 12/30/99 09/16/98 MACD_BUY: BUY 500 at 33 5/8. Creating a New Trading System Defining Trading Rule If not trading signals appear in the list, you must define the signals you wish to use in the trading system. Click the "New" button inside the "Define Trading Rule" area of the window to add a new trading signal. A signal setup window will appear for building the signal using RTL. For example, you may define the signal: MACD1 < 0 AND MACD > 0 When prompted, setup the MACD as an oscillator with the desired periods. Save the signal under the name "MACD_BUY". This is a simple signal that triggers whenever the MACD oscillator crosses from below zero to above zero. Similarly, you could add a "MACD_SELL" signal using the RTL formula: MACD1 > 0 AND MACD < 0 When you close the signal setup window, the two new trading signals will appear in the signals list on the Trading System Builder window. Create rules by picking a signal and an action, specifying a quantity and a price if appropriate and clicking the "Add Rule" button. The newly added rule will appear in the list at the bottom of the setup window. For example, choose MACD_BUY as the signal, "BUY" as the action and enter a quantity of 500 at the "last" price. For now, set the periodicity for Daily data. After clicking "Add Rule" the new rule will read: Daily: If MACD_BUY then BUY 500 at Last price Similarly, add a rule to SELL when the MACD_SELL signal is triggered. Since "SELL" means sell the entire position to exit a long position there is no need to specify a quantity. For price, we can use the average price for the day (High + Low)/2. This yields a new rule: Daily: if MACD_SELL then SELL at Hi + Lo/2 price These two rules actually make up a complete (but simplified) trading system. There is a rule for going long and another rule for exiting the long position. Both rules depend upon the MACD indicator. We can now test the system on past data (BackTest). BackTesting Setup At the top of the window, specify a ticker symbol or a quote page on which to apply the Trading System. The "Maximum Position Size" settings are used when going long or short or adding to long or short positions to assure than no more than the maximum shares or contracts are purchased or shorted during any particular trade. Enter the commission and fees to apply on entry and exit of trades during the BackTest. Use the "BackTesting Period" controls to specify the time period over which to run the BackTest. Investor/RT will attempt to load data for the specified period from the database but may use less data if historical data is unavailable for a portion of the requested period. A space is provided for user comments. Comments are stored with the trading system for future reference. Click OK to return to the Trading System Definition window or click the BackTest button to run the BackTest. For convenience, there is a BackTest button on the Trading System Definition window as well. Trading Rule Actions
Notice that the SELL and SELLSTOP actions do essentially the same thing, as do COVERSHORT and BUYSTOP. The actions are provided to clearly distinguish between rules for exiting a position pre-maturely (i.e. a stop loss rule) and rules for exiting normally when the trading system issues a trading signal. Modifying Rules - Visual Markers |