Data

Trade Strategist would be useless without historical data. This section explains where the data comes from, how it is stored in the Trade Strategist database, what types of data can be used, and how you can export data to other applications.

Data Sources

You can set the data source that Trade Strategist uses in the Preferences panel. For general stock data from around the world, the best choice is the Yahoo! Finance data source. This site provides historical data for all major US and international markets, in addition to charting and analysis. The symbols you enter in your stock lists should correspond to the symbols given on the Yahoo! Finance web site. You can do a symbol search on the web site to find the symbol to use for a given company.

The OANDA data source is for foreign exchange rates (Forex). Only close-of-trade rates are available, and data is only available for up to 2000 days. The symbols you need to enter, in order to access the OANDA currency rates, take the form CURRENCY1_CURRENCY2. This gives the exchange rate from CURRENCY1 to CURRENCY2. For example, to get the US dollar to Euro exchange rate, enter USD_EUR for the symbol.

If you have access to your own source of data, there are two ways you can use it: the simplist is to choose the Comma-Separated Values (CSV) File data source, and then populate a folder with files containing the data in a given format. The second way is to use the Software Development Kit (SDK), but this requires some experience in programming. Both approaches are discussed further below.

Types of data available

The Random source provides daily data, including the open, high, low, and close prices, in addition to the trading volume. This data is entirely fictional.

Yahoo! provides daily equities data, including the open, high, low, and close prices, in addition to the trading volume.

OANDA provides foreigen exchange (Forex) daily close-of-trade data for up to 2000 days. The symbol for an exchange rate is CURRENCY1_CURRENCY2. For example, US dollar to Euro is entered in Trade Strategist as USD_EUR.

The Comma-Separated Values (CSV) File data source provides the open, high, low, and close prices, and the volume. You must provide this data to Trade Strategist as described below if you wish to use this data source.

Data adjustments

You can choose how you want price data to be adjusted in the Preferences panel. Data can be adjusted for stock splits and/or dividend payments. Not all data sources allow for price adjustments. If adjustments are not allowed, the adjustment popup items will be disabled.

Downloading data

As long as you have your data preferences configured correctly in the Preferences panel, data should be downloaded automatically as needed when Trade Strategist runs a simulation or plots a chart. Data will either be downloaded, or read from file, depending on the data source you have selected in the Preferences.

You can also force Trade Strategist to retrieve data for a particular stock list. This might be useful if you want the data to be added to your database (see below) so that you can later test your strategies offline. To explicitly download data for a stock list:

  1. Set the range of dates in the main simulation window.
  2. Select the stock list.
  3. Choose the menu item Data > Retrieve Stock List Data
You can cancel the data retrieval by selecting Data > Stop Data Retrieval.

Supplying your own data

If you have access to your own source of data, one simple way to use it is to choose the Comma-Separated Values (CSV) File data source. This source takes its data from files in a folder of your choosing. You need to find a way to populate the folder with files containing stock data; each file contains data for one stock, and the file name is chosen to indicate what type of data is included, as explained further below. After you have entered the path to the directory in the Preferences panel, and chosen the Commas-Separated Values (CSV) File data source, Trade Strategist will look in the directory for data whenever it is required.

To make use of the CSV File data source you need to adhere to some basic rules about formatting and file names. Trade Strategist expects file names to be of the following form:
<STOCKTICKER>__<SPLITOPTION>__<DIVOPTION>.csv
(Note that the format includes double underscores)
After the stock ticker comes a split adjustment option, which can either be SPLITADJ or SPLITUNADJ, for split-adjusted and split-unadjusted data, respectively. The dividend adjustment option follows; it can be either DIVADJ or DIVUNADJ, which stand for dividend-adjusted and dividend-unadjusted. For example, the name of a file containing split and dividend adjusted data for Apple would be AAPL__SPLITADJ__DIVADJ.csv.

Trade Strategist also expects the data in each file to be formatted in a particular way. Each line should include: a date, like 21-Jul-04; the open price; the high price; the low price; the close price; and the trading volume. Anything appearing on the line after the volume is simply ignored. The entries on each line should be separated by commas, and the lines should be in order from oldest to newest data. Here is some data in the correct format:


21-Jul-04,32.42,32.71,31.34,31.62,5379600
22-Jul-04,31.25,31.73,31.06,31.68,5966400
23-Jul-04,31.53,31.75,30.48,30.70,4885200
26-Jul-04,30.85,31.45,30.78,31.26,7034500
27-Jul-04,31.80,32.75,31.57,32.43,7589400
28-Jul-04,32.31,32.41,31.16,32.27,5090200

In addition to the CSV File data source, users familiar with Cocoa programming can use the Software Development Kit (SDK) to add their own data sources to Trade Strategist. The data source used by Trade Strategist can be selected in the Preferences panel. Using the SDK, any data source could be used, from a simple file, to a database, or commercial data provider.

The database

Trade Strategist includes a built-in database, which can be used to store any data that gets retrieved while you are working. This database serves two purposes: it allows you to use Trade Strategist when you are offline, and it can make retrieving data considerably faster, because data that is already found in the database does not need to be downloaded again.

The behavior of the database can be configured in the Preferences panel. You have a number of options available to you. For example, you can opt to only use the database for data, and never download new data. Or you can choose to always download new data, and never access the database. Other combinations are also possible.

It is useful to know a little about how the database works. In particular, it is important to realize that the database stores data separately for each stock, data source, and combination of adjustment options. In other words, it is possible that the database contains several data sets for any one stock: one for each combination of data source and adjustments. For example, a database may contain separate data sets for Apple (AAPL) from Yahoo! and some other data source, and different sets for split-adjusted and split-unadjusted options. The particular data set used depends on the choice of data source and adjustment options that you have selected in the Preferences panel. A data set for one data source will never be used if another data source is selected.

The database itself is simply a file. It is located in the folder Library/Application Support/Trade Strategist in your home directory. The file is called PricesDatabase.tsdb. If at any point you want to empty the database, simply quit Trade Strategist, and throw this file in the Trash. Trade Strategist will create a new database when it next tries to retrieve or store data.

Data for non-US Stocks

Trade Strategist can run simulations for any stock for which historical data is available from Yahoo! Finance (US). Data for many non-US stocks is provided by Yahoo, so there is a reasonable chance that the data you seek will be there, but if you are unsure, you should check the web site directly.

Note that non-US stocks usually have an extension to the stock ticker. For example, KPN.AS is the Dutch company KPN, listed on the Amsterdam Stock Exchange. To find out what the stock extension is for your stock, go to Yahoo! Finance (US) and perform a search for the stock.

Exporting data

You cannot directly export the data that Trade Strategist downloads, but you can use the chart window to calculate any function, and export or copy the chart data. You can then import or paste into a spreadsheet or charting program, for example.

If you just want to export the historical data, rather than the values of a function or indicator, you can simply use price functions in the chart window to generate the data you want. For example, if you want the close price and open price, simply create two plots in the Chart Window, and enter the expressions close(0) and open(0). Plot the data, and then either copy, or choose the Data > Export Chart Data... menu item.

 
Home