Dynamic Weights for Books

P123 Team
When can we expect this long promised feature for Books?
We need a weight formula similar to what is available in the Rebalance module for sims.
Should not be too difficult to implement.

Thanks

I second that

Jerome

Actually, this would be quite difficult to implement as the coding for books is entirely different from the coding for simulations. I don’t remember this being promised, but my memory isn’t good. If it was promised, maybe it shouldn’t have been . . . Sorry about that . . .

In the meantime, you can create a simulation that functions like a book using the “Portfolio” command and adjust weights by combining “Eval” and “Portfolio.”

Yuval,

I can theoretically see how you would do that but could you create a public example using 2 or 3 dummy sims (or 2 or 3 of the P123 invest systems) to make sure everyone is on the same page?
Possibly then result linking into the reference / P123 manual

Thank you,

Jerome

No problem.
Sim1 https://www.portfolio123.com/port_summary.jsp?portid=1591259 chooses 10 S&P 500 stocks. Sim2 https://www.portfolio123.com/port_summary.jsp?portid=1591260 chooses 10 R2000 stocks. Sim3 https://www.portfolio123.com/port_summary.jsp?portid=1591261 chooses 20 stocks, 10 from each, and the weight of the S&P 500 stocks is double that of the R2000 stocks. It functions like a book that weights Sim1 double that of Sim2.
I used the same ranking system for all three sims, but you don’t have to do that. Sim3’s holdings are limited to those in Sim1 and Sim2 so as long as the universe is big enough to encompass all the holdings of Sim1 and Sim2 it’ll choose those stocks no matter what the ranking system is.

This looks like interesting stuff. Can the stock weights for the original ports be maintained?

One observation that I have to make is that P123 appears to have three different directions going on: (1) the hedge module, (2) books, and (3) Portfolios()/Accounts(), etc. All of these.features do some things better than others but are deficient in other ways. Has P123 considered stepping back and having a look at the bigger picture? My point is that the best way forward may not be in supporting all of these 3 different features, but identify the issues with each, and move forward with one clean solution. The alternative is to perpetuate all three concepts and make it even more confusing and difficult for the average investor to use the site. From what I can tell, it is only us geeks that are here. and I don’t believe that is P123’s objective.

What are the issues? First of all, the segregation of stocks and ETFs is a problem. Books and the hedge module address this to some extent but definitely lacking for Portfolio() functions.

Dynamic weight adjustments are not possible for books or the hedge module. Less of a problem for the Portfolio() function, but weight scaling is restricted to one field on the rebalancing page. This makes for limited usefulness. And as I asked above, can original stock weightings be maintained using the Portfolio() function.

So my suggestions are:
(1) Solve the stock/ETF domain problem. We should be able to cross domain boundaries more effectively.
(2) Give us a reasonable rules-based architecture for dynamically weighting portfolios and stocks within portfolios
(3) Deprecate two of the three features that I have listed and stick with and build upon the approach that best solves the issues I’ve mentioned. This is the only way to “dumb down” the site for average users.

*** EDIT *** And a 4th suggestion is to give us “state variables”, even one variable that transcends time would suffice. State variables would enable the designer to establish where in the business cycle we are, and other system-level design issues that we cannot currently address. This all ties into the issue of dynamic weighing and the need for a rules-based architecture. Let’s stop treating dynamic weighting as an afterthought and start making it integral to the solution.

Steve

I use the Portfolio() function to utilize market timing to blend a portfolio weight in and out the market inside a book. Given that I’m skeptical about the ability to perfectly time the market without losing alpha, but do think it’s useful depending on your investment outlook/horizon to take risk on and off depending on appetite and horizon as a way to stick with a high volatility model … this is a useful way for me to go about it.

First set up composite $Risk function that combines say unemployment, breadth, future earnings, trend … to returns a numeric risk score of 1 (low risk) to 4 (high risk).

Portfolio 1 BASELINE: Buys 10 stocks with your desired unverse, rank, buy/sell rules without any market timing. Auto rebalance
Portfolio 2: Buys Portfolio(“Portfolio 1 BASELINE”)=TRUE, Hedge/Martket Timing go to SHV when $RiskFunction>=1
Portfolio 3: Buys Portfolio(“Portfolio 1 BASELINE”)=TRUE, Hedge/Martket Timing go to IEF when $RiskFunction>=2
Portfolio 4: Buys Portfolio(“Portfolio 1 BASELINE”)=TRUE, Hedge/Martket Timing go to TLT when $RiskFunction>=3
Portfolio 5: Buys Portfolio(“Portfolio 1 BASELINE”)=TRUE, Hedge/Martket Timing go to GLD when $RiskFunction=4

Composite Book Assets: Portfolio 1 Baseline + Portfolio 2 + Portfolio 3 + Portfolio 4 + Portfolio 5.

Your book blends in and out of your equity portfolio and goes into hedges as your risk function score goes up or down.

I think this is very cool. As far as the weights, I assume one might simply determine this with trail and error in the Books and would likely find a good solution—probably optimal with enough trial and error.

I have a true question:

For those experienced in finance: Would you ever want to pick a portfolio this IS NOT ON THE EFFICIENT FRONTIER? If not why? Maybe MPT just does not work in practice?

MPT would not be truly dynamic but it would give some sort of optimal solutions for the weight of each of the ports (including the hedged ports).

I am experimenting with the portfolio that optimizes the Sharpe Ratio (Tangency Portfolio) and the Minimum Volatility Portfolio.

What I am looking at is using the trailing 5 years of my out-of-sample data to get the weights for my Ports using the Tangency portfolio. One thing I like about this is it will (gradually) reduce the weight, automatically, if the Port stops working. It also seems to give a sane and automated allocation for Ports (risky and tame ports alike).

For the rest of my assets–not including my ports (eg ETFs)–I may use the Minimum Volatility Portfolio (tip of the bullet in MPT) which seem to minimize the drawdowns if I include the 2008 time period for the MPT calculation. And this could be the least risky portfolio going forward.

I am finding that the Minimum Volatility Portfolio also performs well as far as expected returns. There are many papers that find the Minimum Volatility Portfolio has good out-of-sample returns. This is because of the difficulty predicting expected returns going forward and because reducing the drawdowns helps the returns (reduces volatility drag). Or more plainly, you do not have to dig yourself out of such a deep hole when there is not a big drawdown.

But one could also try to purposefully find the portfolio that maximizes returns along the efficient frontier. This may not mean giving 100% weight to the port with the greatest returns.

It does not seem that it would be too easy to find these solutions with pure trial and error in the Books with much over 4 assets.

FWIW. Just to throw this out and would appreciate any comments/ideas. I can do this easily with the P123 downloads so this is not a feature request although P123 might want to consider this if Marc likes MPT.

-Jim

Interesting idea. In fact, I have done this previously with 3 ETF portfolios, but not using the Portfolio() function.

I have a general problem with how books are implemented and is a strong disincentive for use. The problem is that books have to be rebalanced at the highest rate, otherwise changes to the Ports do not flow through. Anyways, that is my understanding and someone can correct me if my understanding is wrong. This implies that Books pretty much have to be rebalanced weekly and therefore all port positions adjusted weekly, making for a lot of work and high trading costs. What would make Books useful is if they could be rebalanced at a slow pace, quarterly for example, but all of the weekly changes in Ports would still flow through and represented properly in the book holdings. Until that time, I’ll continue to grumble.

SteveA

Steve, have you tried simply using strategies in Invest instead of books? You can’t backtest them, but you can be a lot more flexible in terms of carrying out your strategies. By linking each of your Live (Research) strategies to an Invest strategy (which can be scaled up and down at will within an account or across accounts), I think you might be able to manage your portfolio better than by using books. Explore it a bit and see if it might work for you. One idea behind the whole Invest platform was to simultaneously replace books and make it easier for users to actively trade the strategies they design or subscribe to.

Yuval - I’m sure that Invest is a good tool but I don’t use it for a number of reasons, the primary reason is that I don’t personally trade much anymore due t my age (risk) and lack of funds. I subscribe to P123 in order to develop trading models, consult when opportunities arise, and as a tool for providing info when writing for 3rd party sites such as Seeking Aloha. P123 provides enough for me to make a modest living, but not as an investment tool proper. I don’t see Invest as a way forward for me personally. I prefer the marketability of self-contained portfolio and sets of portfolios that one should theoretically be able to present with the Book technology. How do I market my models and ideas using Invest?

SteveA

Try it. I think you’ll like it. Here’s a way to start.

Take some of your simulations and make them live strategies (make sure the initial funding matches what you want). Then open a paper account. Create a strategy based on a Live Strategy in your Research account. Then download all the transactions from the Live Strategy and import them into the account using “Import Transactions.” Do the same with five other strategies. You’ll be able to quickly access all the transactions, the performance of each strategy and the performance of the account as a whole. (If you don’t want to use live strategies, you can still create account strategies by importing transactions from simulations.)

I’m sure there are things you can do with a book that you can’t do with an account, but you should play with it a little. There may be some things there that will help you. There’s a ton of flexibility, and the performance presentation has some advantages over that of the simulations and books.

Yuval - it will take me some time to get my head wrapped around this. I’ve stayed clear of Trade as I didn’t think it was useful for my situation. The big question for me is will I be able to market, write about and exchange “top-level” strategies using Trade in a fashion that is similar to Books? Right now I can create a Group and exchange Ports, Sims, RS’s, Screens, and (I think) Books with other P123 members. Will I be able to do the same with Accounts? If so then the big question for me is… what is the restriction on the number of accounts, which I presume is the replacement for book technology?

In principle, what you are saying sounds good but I will have to look into it further.

SteveA

Yuval,
You can use “Account” with a number of strategies. However, this works like Live Books, it does not provide a backtest ability.
Attached is a screenshot for my Account “INCOME* & TARGET*” with 2 strategies beginning 3/6/2019.

A total of $58,580 was initially invested 50:50 into each strategy, and the account has gained a total of $6,063 to date, with TARGET* having gained a bit more because it holds predominantly equity. Both strategies are buy&hold.

If one wanted to hold more of TARGET* during up-market periods one would need a weight formula to do this automatically. Of course one can adjust the weights manually, but that is not optimal.

What’s nice about the Account feature that the prices are continuously updated.

Thanks.