A data series is a list of dates and their associated values; a stock factor is a list of dates and tickers and their associated values. You can import them as CSV files.
The format is simple. The first column has dates, preferably in the format YYYY-MM-DD. For data series, the second column has numerical values. For stock factors, the second column has tickers or Portfolio123’s Stock IDs and the third column has the numerical values. White spaces are not permitted in any column. For the value column, case-insensitive matches of NA, NaN, and null can be used to clear or to override a value from a prior date.
The data series functions just like a custom series. Once you save a data series, you can chart it and then use the values with GetSeries. GetSeries is used in the series parameter for a number of commands, including Close, SMA, EMA, etc.
So, for example, let’s say you only want to invest when the FRED data for the US leading index is 0.5% or higher. One way to do this would be to copy the USSLIND data from FRED, open the data series tool, upload the CSV file, give it a name (say “USSLIND”), and then in a portfolio buy rule or a screener rule, you can specify Close(0, GetSeries("USSLIND")) > 0.5. (In a simulation, one would also need a sell rule of Close(0, GetSeries(“USSLIND”)) <= 0.5.)
The stock factor tool allows you to import outside data about tickers (both stock and ETF). You can use this, for example, to import an ETF’s historical holdings (by assigning the value 1 to held tickers and 0 to remove them if they’re no longer held), the executive compensation of companies, or alternative data sources for adjusted EBITDA if you can get it. You can upload the historical Zacks ranks of companies (if you can get that) to see how well they’d backtest. If you can get satellite images of parking lots, you can upload the number of shoppers visiting public retail companies.
The tool works just like a custom formula, except that it has two dollar signs in front of the name instead of one. So you can use stock factors in screens, ranking systems, and simulations—everywhere you can use a custom formula. If a ticker changes, you don’t have to reload the file: all the data is associated with the underlying security.
For both data series and stock factors, the last date remains in effect until a new value is put at a subsequent date. For example, if your input is 2019-09-09,IBM,1, IBM’s value on that factor will remain 1 until you input a new value, e.g. 2019-12-09,IBM,0 or 2019-12-09,IBM,NA.
If you’re using old tickers, you may get an error message. You can search for the new ticker for a company by putting the company name into the Advanced Stock Search.
For user discussion of this feature, see https://www.portfolio123.com/mvnforum/viewthread_thread,12049