Weirdness with Stock Factors?

I’m seeing an issue with stock factors that is confusing me. Today, I made a stock factors list called $$debug;

2020-01-01,aapl,1
2020-01-02,baba,1
2020-01-03,c,1
2020-01-04,de,1
2020-01-05,ea,1
2020-01-06,f,1
2020-01-07,ge,1
2020-01-08,h,1
2020-01-09,intc,1
2020-01-10,jnj,1
2020-01-11,ko,1
2020-01-12,lyft,1
2020-01-13,mcd,1

A Universe using that SF reports stocks up to 2020-01-10 (jnj). However, using that Universe in a Screen, yields stocks up to 2020-01-11 (ko). Why the difference? And why doesn’t the Universe or Screener include the 2020-01-12 (lyft) entry?



After the nightly update, stocks up to MCD (inclusive) are now reported in both the Universe and Screener.

Can p123 comment on when Stock Factors dates are recognized in both the screener and live strategies? Also, what is the recommended process for capturing ETF holdings? I had been deselecting holdings w/ Saturday dates and adding new holdings w/ Sunday dates, but the screener doesn’t seem to see the changes until Monday evening. That’s too late to be useful.

Think of stock factors exactly the same as any other factor. Take P/E as an example.

Every night from Monday to Friday at around 10:20 CST, that day’s P/E will show up on your screens; before 10:20, you’ll be seeing an older P/E. Every weekend and Monday during the day, you’ll still be seeing Friday’s P/E.

A factor that gets updated on a non-trading day doesn’t make sense. Any factors that are given dates on non-trading days have to be treated as if the date were the following Monday and will then appear after the Monday night update.

If you want your updates to be recognized before Monday, you need to give them Friday dates.

Thanks, Yuval. So what happens to factors that get updated over the weekend? Do they gain visibility at the 10:20PM Monday update?

EDIT: Ok, I think it’s sinking in. The weekend updates get Friday timestamps? I’ll resist asking how weekend corporate events are recorded.

When run, screens have a ‘price date’ assigned which is just the most recent bar before the as of date.
That is the date which is currently used to resolve user stock factor values, which I think is a mistake.
Changing it to use a date one day before the as of date would make it function as expected and match the behavior of built-in factors and ratios.
We probably shouldn’t consider the as of date itself to avoid ‘looking ahead’ and to be consistent with the general approach throughout the system.

Hi Aaron, Thanks for the reply. I’m not quite following but something is off if the screen reports more stocks than the universe reports. In any case, I now know how to properly maintain my stocks factors and that’s what I was after. And since I’m light user of the screener, I’ll let someone else drive the issue, if needed.

Walter

I have released a change which makes stock factors respect the observation date.

Here’s how it works now:
For simulations, the observation date will be a day before the rebalance date (i.e. the transaction date).
For screens, the observation date will be the date entered into the “As Of” field.
For screener backtests and screener rolling backtests, the observation date will be the “As Of Dt” reported in the output.
For other things, the observation date will generally be the fundamental date (i.e. a Saturday date or the most recent trading date).

This should be clear and consistent behavior. Let me know if you have any concerns or notice anything amiss.

Thank you, Aaron!