Index | Recent Threads | Who's Online | Search

Posts: 116    Pages: 12    Prev 1 2 3 4 5 6 7 8 9 10 Next
Last Post
This topic has been viewed 4848 times and has 115 replies
wwasilev
Re: Factor and data series importing

I'm trying to wrap my head around data series. So for example, I could export the portfolio performance of a live P123 portfolio with just the daily dates and amount of the portfolio, and then import it into a time series and construct buy/sell timing rules based on 50 and 200 SMA trends of the portfolio?

I haven't tried that yet. But I have imported portfolio transactions and used that to generate a universe for a custom series. With that done, it's easy to analyze the portfolio for things like median PE, median volume, avgrec, etc.

Walter

Jan 2, 2020 12:58:38 PM       
marco
Re: Factor and data series importing

George why do you have turnover=100% 5 times ? Seems wrong

Portfolio123 Staff.

Jan 2, 2020 1:24:33 PM       
geov
Re: Factor and data series importing

Marco,
As per Walter's suggestion, I make all the holdings active from a particular date and then deactivate all of them before I activate the next set of holdings. That way I don't have to actively manage the deselections. That can cause sometimes a 100% turnover.
I am tracking USMV holdings quarterly. So turnover spikes can occur at the end of every 3-month period. That would happen if the first trading day of the week coincides with the the date when the change happens, I think, but not sure.

For example the holdings as of 6/30/2018 are held until 9/29/2018. Therefore, input is:
2018/06/30 AAPL 1 (active)
2018/06/30 ABT 1
etc.
2018/09/29 AAPL 0 (deactivate)
2018/09/29 ABT 0
etc.

Then for the new list which becomes active from 9/30/2018
2018/09/30 AAPL 1 (active)
2018/09/30 ABT 1
etc

Jan 2, 2020 1:56:31 PM       
Edit 3 times, last edit by geov at Jan 2, 2020 4:07:11 PM
geov
Re: Factor and data series importing

Marco, I just checked. It has to do with the date specification.

There was a turnover spike on 1/3/2018 when deactivating on 12/30/2018 and activating new list on 12/31/2018.
1/2/2018 104.7359695 104.9631882 0 189
1/3/2018 104.9413071 105.1820297 97 5
1/4/2018 106.3816071 105.5998077 0 5
1/5/2018 107.0279007 106.1369629 0 5
1/8/2018 106.9877014 106.3160172 0 5
1/9/2018 106.8179245 106.3756943 0 188
1/10/2018 106.2072906 105.8584366 0 188

The spike disappears when deactivating on 12/29/2018 and activating new list on 12/30/2018.
1/2/2018 104.7359695 104.9631882 0 189
1/3/2018 105.0679855 105.1820297 12 188
1/4/2018 105.2545166 105.5998077 0 188
1/5/2018 105.931282 106.1369629 0 188
1/8/2018 106.1905594 106.3160172 0 188
1/9/2018 106.1460495 106.3756943 0 188
1/10/2018 105.5392532 105.8584366 0 188

Jan 2, 2020 2:27:24 PM       
geov
Re: Factor and data series importing

Here is the revised All Holdings equal weight USMV screen with turnover spikes removed.
100% TURNOVER IS NOT PERMISSIBLE. It does affect the performance. So one has to watch out for this.

Turnover occurs at end of 3-month periods and also when some of the holdings go extinct.

Attachment rev USMV from 10-1-2012 to 12-31-2019 all holdings.png (228899 bytes) (Download count: 139)


Jan 2, 2020 3:06:28 PM       
Edit 1 times, last edit by geov at Jan 2, 2020 3:08:58 PM
wwasilev
Re: Factor and data series importing

Georg, How did you handle the turnover? Did you specify the deactivations manually? Something else?

How does the 25 stock sim look now?

Jan 2, 2020 3:45:23 PM       
geov
Re: Factor and data series importing

As I said before: "it's a pain in the neck".
I did not specify the deactivation manually. I specified the deactivation on the second last day of March, June, Sept, and Dec.
And then I specified the activation on the last day of March, June, Sept, and Dec.

That resulted in 5 x 100% turnover situations, which Marco mentioned.

When this occurred, I specified the deactivation on the third last day, and then I specified the activation on the second last day. That removed the turnover spikes.

Screen of Top 25 is below - not much different from before.

Attachment rev USMV Top 25 from 10-1-2012 to 12-31-2019 .png (266280 bytes) (Download count: 132)


Jan 2, 2020 4:01:31 PM       
Edit 2 times, last edit by geov at Jan 2, 2020 4:08:26 PM
wwasilev
Re: Factor and data series importing

Georg, Do you set 'Force Positions into Universe' true? Just curious.

Jan 2, 2020 6:00:55 PM       
geov
Re: Factor and data series importing

Georg, Do you set 'Force Positions into Universe' true? Just curious.

The data series for $$USMV are the historic stock holdings of ETF USMV. A stock is held from a particular starting date to an end date as specified in the series. If a stock disappears for some reason or other then the end date is the disappearance date of the stock, which would coincide with its removal from the All Fundamentals universe.

Forcing a stock into the universe would not have any effect on its end date in the data series, because in a simulation with historic holdings stocks are not selected from the universe according some rules. Only relevant are the "in" and "out" dates in the data series.

Jan 3, 2020 8:35:11 AM       
Edit 1 times, last edit by geov at Jan 3, 2020 8:36:12 AM
InmanRoshi
Re: Factor and data series importing

So for example, I could export the portfolio performance of a live P123 portfolio with just the daily dates and amount of the portfolio, and then import it into a time series and construct buy/sell timing rules based on 50 and 200 SMA trends of the portfolio?


FWIW, this works. It's a nice little stop loss measure to protect yourself if you're afraid of you ranking suddenly going out of favor and gets back into the market when your ranking system is back in favor. I haven't had much time to play around with it too much. Like most timing strategies it whipsaw you and effect your total alpha, but it's a nice "sleep at night" tactic.

For a vanilla example, create a simple simulation with maximum positions with a buy rule of Rank > 90 & sell when Rank < 90 on the longest time period your membership allows. Covert it to a live portfolio. Export the return results to CSV keeping only the Date and Total Equity columns. Upload it into a data series names "Rank 90".

Create a custom function Rank90: eval(SMA(50,0, GetSeries("Rank 90")) > SMA(200,0, GetSeries("Rank 90")),0,1). Put $Rank90 = 0 in your buy role to make sure your Rankings Top 10th Percentile 50 SMA is above it's 200 day average. Sell $Rank90=1 when it's below.

This functionality is a big step towards making more market neutral strategies. You can imagine how you can nest Eval statements against trend of several different ranking systems like this to swap in and out of portfolios using those rankings with the Portfolio() function.

Jan 3, 2020 3:44:56 PM       
Edit 4 times, last edit by InmanRoshi at Jan 3, 2020 3:59:05 PM
Posts: 116    Pages: 12    Prev 1 2 3 4 5 6 7 8 9 10 Next
 Last Post