|
||
| Investor/RT Tutorials Pairs Trading: Creating Spreads (Using Custom Instruments) Also See: Custom Instrument Tour This Tutorial will demonstrate how to create a Custom Instrument which represents the spread between two instruments (in the case, between two stocks, LLY and MRK). The term "Instruments" is synonymous with the term "Symbol" for the context of this tutorial. The steps involved are as follows:
Define Component Instruments
Setup Component Instrument for Intraday
Monitoring (if applicable) You can either mark the instruments individually, or mark a whole quotepage at once. To mark a instruments individually, right-click on the instruments in a quotepage a choose "Setup" from the popup list. Check the "Intraday" and "Daily" Monitoring options at the bottom (leave Weekly and Monthly unchecked). Your Setup Instrument window for MRK should resemble the one below at this point.
Click "Modify" then "Close" to
dismiss this window. Do the same for both component instruments (if
you are monitoring intraday). You can also mark all the instruments
in a quotepage for intraday at one time by just clicking on the
"Mark/Unmark for Intraday"
Download Data for the Component Instrument
Notice we have selected our "Spread Components" quotepage on the list on the left (you must unselect "One Instrument" checkbox in order to be able to select a quotepage). The download type should be "Historical Quotes" and the periodicity "Daily". I have chosen to download approximately 2 years of daily data (current date is 12/12/02). I've chosen a "From" date of "12/12/00" and a "To" date of "Current Date". Now click the "Download" button and give the program a few moments to download the data. If you bring up a daily chart on either of these two instruments, you should see complete data for the past 2 years now. If you will be monitoring your spread intraday, you'll want to repeat this process again for 1-minute data. Again, click on the "Download Data" button in the main toolbar. This time, set the window up something like this.
I've chose to download the last 6 days of data. Click the "Download" button to execute the download and give the program a few moments to complete the download. Again, you should be able to bring up an intraday chart and view the last 6 days of data (you may need to adjust the viewing period of your chart preferences to actually see 6 days back). Create the Spread Enter a unique ticker symbol to
identify your spread (custom instrument). I've chosen
"LLYMRK" to represent the difference between LLY and MRK.
Now provide a name for the spread. Again, I've chosen "Eli
Lilly - Merck Spread". Choose "Difference" for the
"calculation type" since we will be subtracting one component
instrument (MRK) from the other (LLY). Now, in the list on the left,
find the first component "LLY", and click on it, then click on
the right arrow
Now, click the "Save and Close" button. This button will create your spread, mark it for intraday (if applicable), and generate daily and intraday (if applicable) historical data on spread based on the pre-loaded data of the component instruments. Place the Spread in a QuotePage and
Chart the Spread
Notice that the Change and % Change columns probably won't fill in until the day after the spread (custom instrument) is created. You can now double-click on your spread ticker symbol to bring up a chart on the spread. To change the periodicity of the chart, right-click in the chart and choose "Periodicity". This entire process may seem somewhat lengthy, but can be completed very quickly once you get the hang of it. Also, now that the quotepages are created, these steps won't be necessarily next time through. As far as expediting the download process, Investor/RT 5.9.1 has a new schedule action option called "Download Data". This action gives the user to download 1-minute or daily data, for any number of days, on the instruments in any quotepage, directly from a schedule. Since the schedule can be run using a shortcut key (like F2), a single keystroke can download the daily and intraday data based on the number of days you require. To accomplish this, from the menu, go to "Setup Schedules". Create a new schedule that is setup to run from a function key of your choice. Then assign to this schedule two actions. The first action should download maybe 500 days of daily data. The second schedule should download maybe 6 days of 1-minute data. The resulting schedule window will look something like this.
With the first action download 500 days of daily data, and the second action downloading 6 days of 1-minute data. If you have any confusion regarding the process above, or would like me to supplement this tutorial with additional information regarding the creation of spreads for pairs trading, please email me at support@linnsoft.com . |
||