Index | Recent Threads | Who's Online | Search

New Thread
This topic has been viewed 185 times and has 8 replies
wwasilev
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?

Attachment universe.png (450230 bytes) (Download count: 98)


Attachment screener.png (494848 bytes) (Download count: 99)


Jan 13, 2020 9:57:31 PM       
Edit 4 times, last edit by wwasilev at Jan 13, 2020 10:18:12 PM
wwasilev
Re: Weirdness with Stock Factors?

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

Jan 13, 2020 10:48:04 PM       
wwasilev
Re: Weirdness with Stock Factors?

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.

Jan 15, 2020 8:29:01 AM       
yuvaltaylor
Re: Weirdness with Stock Factors?

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.

Yuval Taylor
Product Manager, Portfolio123
invest(igations)
Any opinions or recommendations in this message are not opinions or recommendations of Portfolio123 Securities LLC.

Jan 15, 2020 9:23:52 AM       
Edit 1 times, last edit by yuvaltaylor at Jan 15, 2020 9:24:42 AM
wwasilev
Re: Weirdness with Stock Factors?

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.

Jan 15, 2020 9:35:15 AM       
Edit 1 times, last edit by wwasilev at Jan 15, 2020 10:07:56 AM
aschiff
Re: Weirdness with Stock Factors?

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.

Aaron
Portfolio123 Staff

Jan 15, 2020 1:32:21 PM       
wwasilev
Re: Weirdness with Stock Factors?

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

Jan 15, 2020 2:43:23 PM       
Edit 2 times, last edit by wwasilev at Jan 15, 2020 7:49:09 PM
aschiff
Re: Weirdness with Stock Factors?

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.

Aaron
Portfolio123 Staff

Jan 27, 2020 4:11:46 PM       
Edit 1 times, last edit by aschiff at Jan 27, 2020 4:12:19 PM
wwasilev
Re: Weirdness with Stock Factors?

Thank you, Aaron!

Jan 27, 2020 5:54:04 PM