Factor and data series importing

Here is the Trading System for $$USMV which I use.


Thanks Very much. So it seems that I can use any universe, as along as I have the $$series= 1. Is my understanding correct?

You can use any universe, but to make sure you get all the stocks you should use All Fundamentals.

If I’m importing stock tickers I have no idea what to put into the third column…
First column is date (which seems meaningless), next is the ticker, and then what?

I import that and try to run a sim using $$XXX=1 as the buy rule but nothing happens.

In the csv file the 1st column is the date, 2nd column the stock symbol, 3rd col is 1 or 0.
1 when the stock is in the holdings, 0 when the stock exits the holdings.

The whole exercise is tedious. Also the dates for 1 and 0 must be weekday=6 (Friday) for Monday’s trades. If Friday is a non-trading day you have to use weekday=5 (Thursday).

thanks Georg. You are immense help. Yes, building the universe was very tedious

Georg, I will be changing the behavior to resolve to the latest date before the trading day, so Saturday and Sunday values will no longer be delayed.
I’ll let you know when the change is in place.

That’s great, Aaron! Will that apply to both the port and screener backtester?

Walter

Yes; it will behave this way for all usages.

There’s a few small issues to sort out with this. I’m going to try to have it all squared away tomorrow.

Also I want to draw attention to the fact that one can upload a Stock Factor into a universe.
This is an extremely valuable feature because ranking rules apply to the universe.

For example, I am keeping the Seeking Alpha undercovered and overcovered stocks in a universe via a Stock Factor.
In the simulation there are no buy rules, only a rank sell rule.

Inception of the simulation is June-2019 because one would not have had the stock holdings before that date. One has to update the Stock Factor every few months to bring in the new stocks and get rid of the old ones which are not anymore in the listing.


Georg, you may have found a good strategy using USMV as universe. At least, experimental results on past data point to that conclusion. However, the theory is weak. Not your fault: USMV prospectus is verbose and misleading. Reading it quickly makes us believe that USMV picks low-risk stocks. That’s wrong. It builds a low-risk portfolio, which is a different story. It is more obvious in the MSCI index description:

"The MSCI Minimum Volatility Indexes are designed to provide the lowest return variance for a given covariance matrix of stock returns. Each MSCI Minimum Volatility Index is calculated using Barra Optimizer to optimize a given MSCI parent index for the lowest absolute volatility with a certain set of constraints. "

In short, USMV is not good because it picks good stocks, but because it builds a good package from a covariance matrix. Also, it aims at lowering the risk of a benchmark, not at beating it. If you downsize the package using a ranking system ignoring the rules used to build it, you may break the balance that makes it good (= the optimized covariance matrix). In fact, it is possible (not to say likely) that USMV outperformance doesn’t come from the low-vol anomaly of its holdings. So there is no sound theory to claim that you can only beat USMV by piggybacking on it any ranking system looking good in a broad universe. Like always, only results count. As long as you make money, you are right.
Disclosure: long USMV, and also EFAV, EEMV

Frederic, what you say may be correct, but the proof of the pudding is in the eating.

I have now, since 6/30/2014 had a 12 stock USMV model live on my website. It has outperformed USMV by 37% over this period. The model’s annualized return to 1/24/2020 with trading costs was 16.8% vs 13.6% for USMV.

This is pretty cool and powerful but I have a concern about the amount of work that it’ll take unless I’m not fully understanding it.
Lets say I want the stock series to look like this:

Quarter 1
Stock A
Stock B
Stock C

Quarter 2
Stock A
Stock E
Stock F

If I’m uploading a series in Quarter 2, does my cvs file have to look like this
Stock A, 1
Stock E, 1
Stock F, 1
Stock B, 0
Stock C, 0

or

like this
Stock A, 1
Stock E, 1
Stock F, 1

I have a feeling its the former which creates a ton more work because I have to keep track of what was in the list the time period before this and adjust which will get exponentially more cumbersome with each uploaded time period.

I basically have Marko’s question and would like to piggy-back off of that. Can I do this?

Quarter 1
Stock A,1
Stock B,1
Stock C,1

Friday before Quarter 2 (when the market is open on that Friday)
Quarter 1
Stock A,0
Stock B,0
Stock C,0

Quarter 2
Stock A,1
Stock E,1
Stock F,1

This would allow me to just zero-out all the factors in the spreadsheet from Quarter 1. This would help me keep track of which stocks need to be zeroed-out. And if the zeroing-out can be done with a separate upload it simplifies the process a little.

This really could get hard with changing universes as Marko suggests.

I guess my main question—if this works—is whether the Friday before Quarter 2 (in this example) is the best day to zero-out everything.
Is there a better day? Could it even be done the Tuesday after the Monday start of Quarter 2? There are not as many Tuesday holidays to keep track of or to make a mistake with.

Just adding one day to all of the (Monday) dates, zeroing-out all of the factors, checking for Tuesday holidays, saving as a new file and uploading this file separately (not using daily rebalance in the sim) would automate the whole process—if Tuesdays work.

Just adding to Marko’s question (if I understand correctly).

-Jim

You also need to precede every stock with a date. This is the method that Walter suggested, and it works. The real problem is to get the delisted stock symbols right so that P123 can recognize them. Once you have all the historic data in the csv file it is easy keep it up to date every quarter going foreward.

Thank you Georg. I am very sure I would not have gotten this without your, Walter, Yuval, Cary and other’s posts. -Jim

I’m not certain it clarified my question. How do I treat the tickers if I want to zero them out. Does not mentioning them in a follow up date zero them automatically or must I keep track of what’s in the list and manually zero them out?

Bottom line. You have to manually zero them out.

I am sure Georg or someone will correct me if I have this wrong. Or expand if I am missing something.

If you list it as indicated, the obsolete symbols will be automatically eliminated. (B and C will be removed like this.)