Index | Recent Threads | Who's Online | Search

Posts: 16    Pages: 2    1 2 Next
Last Post
New Thread
This topic has been viewed 1262 times and has 15 replies
primus
Feature Request: Expose Porfolio functions to Position Weight Formula

I would like to use the Portfolio functions "TotMktVal" and "PosCnt" in a portfolio's Position Weight Formula.

Would it be possible to expose these functions to the Portfolio's Position Weight Formula on the rebalancing tab? My specific use case is to incorporate slippage estimates, which depend mostly on position sizes themselves, into the weighting function.

I understand that many Portfolio functions are not available to ports which use variable position sizing (e.g., BuyAmount, CashPct, etc.) since position weights are evaluated after buy/sell rules. I would think at least some of the same technical constraints apply to things like "Buy Amount", but I hope it's still possible to introduce at least some of these items.

Thank you for your consideration.
View the feature request here .

"The world is. The world is. Love and life are deep maybe as his eyes are wide." - Rush, "Tom Sawyer"

May 17, 2018 8:44:16 PM       
Edit 1 times, last edit by primus at May 17, 2018 8:45:02 PM
aschiff
Re: Feature Request: Expose Porfolio functions to Position Weight Formula

In order to support PosCnt properly, the way illegal weight values are handled would have to be revised. Currently, weights of existing positions are only evaluated and stored during the sell phase, to either sell invalid positions or cause an error. This would have to be changed to re-evaluate later, and the best approach to handling various cases is not readily apparent.
Adding support for TotalMktVal , on the other hand, is a very simple thing. Will that be sufficient for your model?

Aaron
Portfolio123 Staff

May 21, 2018 3:32:29 PM       
Edit 1 times, last edit by aschiff at May 21, 2018 3:32:56 PM
primus
Re: Feature Request: Expose Porfolio functions to Position Weight Formula

Aaron,

Thank you for the speedy reply.

Really, anything that might be useful for estimating position size will help.

So, yes, I will eagerly use TotalMktVal and any other portfolio items that are available.

//dpa

"The world is. The world is. Love and life are deep maybe as his eyes are wide." - Rush, "Tom Sawyer"

May 21, 2018 5:32:28 PM       
jmh
Re: Feature Request: Expose Porfolio functions to Position Weight Formula

Voted for this. Anything we can have to get a better control of the output of the active weighting algo would be great.

How about CashPct?

Specifically, the theoretical risk I mentioned in a post in another thread just happened to me in the last 3 weeks...
https://www.portfolio123.com/mvnforum/viewthread_thread,11016_offset,20#62568

- Assume you have set Min weight = 5% ; Max weight = 15%
- if you have a buy condition that prevents buying for an extended period of time (e.g. bear market) -> say, you end up one day with 5 positions (over time, the portfolio sold some stocks but is forbidden from buying new ones)
- You will typically end-up invested significantly more than 50% (ie somewhat closer to 75% = 5 * 15%).
- My concern is that it means a very high concentration risk on these 5 stocks (if one goes bust) - especially at a time of market stress (bear market)
- I tried to tie the cash invested to the # of holdings but I do not think it is possible with Active weighting. We would need Max Weight to also be dynamic e.g. Max Weight = 'eval(Bear market,10%,15%)'
- Did anyone found a way to do that?


So, following the recent market (down) moves, my (normally) 10-position port was running with 8 positions and was therefore more concentrated.
As it happens, two of the holdings took a ~15% hit each in a period of 2 weeks.

It would be ideal to have a way to set CashPct dynamically or reasonable alternatives:
1) dynamic max weight in the active weight settings or
2) 'eval(Bear market, weight < (PosCnt * (TotMktVal / 10)), normal active weighting)' // assumes a 10-position portfolio in normal times or
3) 'eval(Bear market, cashPct >= (10-PosCnt) * (TotMktVal / 10), normal active weighting)' // assumes a 10-position portfolio in normal times or
4) 'eval(Bear market, cashPct >= whatever custom series or # of weeks since trigger signal, normal active weighting)'

Many thanks

Jerome

May 22, 2018 11:10:08 AM       
primus
Re: Feature Request: Expose Porfolio functions to Position Weight Formula

Anything we can have to get a better control of the output of the active weighting algo would be great... It would be ideal to have a way to set CashPct dynamically
.

I totally agree. Do you know if there's an extant feature request for this? I would imagine something similar to the existing formula weight module, but in this case, it would control the portfolio's target leverage.

It would open up worlds.

"The world is. The world is. Love and life are deep maybe as his eyes are wide." - Rush, "Tom Sawyer"

May 22, 2018 1:38:12 PM       
aschiff
Re: Feature Request: Expose Porfolio functions to Position Weight Formula

Support for TotMktVal in weight formulas is now available. Let me know if I should keep the request open.

Aaron
Portfolio123 Staff

May 22, 2018 3:53:33 PM       
jmh
Re: Feature Request: Expose Porfolio functions to Position Weight Formula

Thank you Aaron. Can you do CashPct as well or do you need me to open a feature request?

Jerome

May 22, 2018 4:13:10 PM       
primus
Re: Feature Request: Expose Porfolio functions to Position Weight Formula

Support for TotMktVal in weight formulas is now available. Let me know if I should keep the request open.


Thank you, Aaron.

Given that Jerome and I would like to see additional Portfolio functions exposed, it might be easier to keep this generic request open rather than to keep a tally of every line item.

But I'm honestly good with whatever you think is better.

Thanks again!

//dpa



.

"The world is. The world is. Love and life are deep maybe as his eyes are wide." - Rush, "Tom Sawyer"

May 22, 2018 4:55:38 PM       
Edit 2 times, last edit by primus at May 22, 2018 4:59:13 PM
aschiff
Re: Feature Request: Expose Porfolio functions to Position Weight Formula

That's a tricky one. It really doesn't make much sense to support that factor in the weight formula, as CashPct fluctuates all the way to the end of the process. We can discuss solutions to the cash problem in this thread though.
I'm wondering, though, whether this change would be better addressed by additional formula weight control or by adding a hedge weight formula (excluding GO TO CASH for technical reasons). Would you be opposed to moving the cash to a hedge during these periods? I guess an absolute cash weight formula could be a reasonable solution, but then the question (for cash portfolios) is whether the cash is allowed to be deployed to a hedge if entered.

Aaron
Portfolio123 Staff

May 22, 2018 4:59:55 PM       
whotookmynickname
Re: Feature Request: Expose Porfolio functions to Position Weight Formula

Hi Aaron

A new higher level "portfolio" control would probably be the best where we could directly control CashPct, (Target) Leverage, etc.
Would it be possible to access portfolio metrics? Like DD, STD, Current leverage, no. Of holdings, largest weight, etc.?

Whotookmynickname

May 23, 2018 1:54:25 AM       
Posts: 16    Pages: 2    1 2 Next
  Last Post