When I calculate my position sizes they should be up to 2-3x times larger than other positions. When I set my strategy to "Live", the positions are with 10% of each other however. Does the "live" strategy use the dynamic rebalancing or does it only use that when it does its first rebalance?
Also - I have a Max Position Drift of 100% under transaction control. That means it would only sell some of a position if it was 2x the average portfolio position size correct? And on the flip side it would never buy more essentially? (As a 100% reduction from say a weight of 5 would be 0).
You want to look at the actual transactions. In most cases you'll want to try it out with transaction scaling set to "No, warn if deviation from 100% exceeds 100%." Transaction scaling makes a huge difference here. I believe your understanding of Max Position Drift is correct. In general, a lot of experimentation and close looks at the transactions is essential if you want to use dynamic rebalancing. FWIW, my default settings are: max portfolio drift: 10% from ideal weights; minimum weight constraint: 0.13%; maximum weight constraint: 40%; max position drift: 50%; min rebalance transaction: 1%; transaction scaling: no, warn @ 100%. I also find it helpful to put the ideal number of positions far higher than you'll ever want (e.g. 300).
1 Like
Wow, thanks Yuval! This super helpful!
I'm going to look into all your suggestions, but first I want to figure out why I'm still having trouble getting accurate weights. Any formula i've tried gives me different weights compared to what I calculate.
Even if I try something super simple like weight = RankPos, with 3 stocks in the holdings
The rank weights should be:
1/6 = 16.66% for the first ranked stock
2/6 = 33% for the second stock
3/6 = 50% for the third stock
And yet the live system gives me:
First: 14.29%
Second: 35.71%
Third: 50.00%
There's lots of cash i tested it with so it shouldn't be a rounding issue.
I've tried with other numbers of holdings and its always off. I've tried using the stock's price as the weight and it was off as well.
Is there something else affect each stock's weight at the start? I have my min and max constraints set to 0% and 100%.
Often times P123 holds 5-10% (on a relative basis) more or less than what my calculations show with the exact same formula.
I'm not seeing what you're seeing. I don't know what parameters you're using. See https://www.portfolio123.com/transact_list.jsp?portid=1864339. The transactions show that the weight is precisely what it should be when the stocks are bought.
Ah, perfect thank you! I copied your system and it works perfectly now. Turns out it was my buy rules as they were screening out some of the top ranked stocks so RankPos wasn't actually = 1 for the 1st stock.
You use a maximum weight constraint of 40%? Doesn't that mean you'd have almost half your portfolio in 1 stock at times?
"I also find it helpful to put the ideal number of positions far higher than you'll ever want (e.g. 300)." - do you mean just when backtesting or moreso when you're choosing companies to buy in your live strategies?
While we are on the subject of Dynamic Weight, does anyone have some suggestions on how I could rebalance so the top 7 positions each have around a 6% weighting and the weighting gradually becomes less as the rank drops to zero around the 20-23rd position as depicted below. I would like to use dynamic weighting however I struggle to find the right formula and parameters to achieve my objective. Thanks
Yes, theoretically, but that almost never happens because I have so many stocks. I use that in order to keep my weights spread out as I'd like. If you shrink the distance between the maximum weight and minimum weight, it compresses your formula a little.
Both. This also somehow gives the system more freedom to adapt to the desired weights. I'd never go up that high, but the flexibility helps for some reason which I can't recall right now.
1 Like
Try this: -0.1428*rankpos^2 + 0.581*rankpos + 63.5
That's a polynomial regression of your data. Or just use the formula you used to generate the table you pasted.
This would only work if you put your buy rules in your universe. If you have buy rules in your simulation/strategy, you'd have to come up with a more complicated formula in place of rankpos, probably using FOrder.
I will try that, thank you so much
Thanks! That's helpful to know.
Also I have this ingenious
formula for calculating weights that adds 20%/year return to my model: (1/(RankPos^.3)) * (close(60)/close(0)) ^ 1.5
It dynamically reduces positions sizes as the rank increases while also taking into account recent price movements. However, i'm 99% sure the 20%/year bonus is from the model taking on extra leverage. I tried with transaction scaling "Yes" and the increased returns almost entirely disappear. Think there's any merit to the formula or if my static weights are just as good, which show similar performance once leverage is removed?
Using the same setting in transaction scaling as you were using--the one that added 20%/year return--compare the returns with your formula to the returns with the same formula but using (Mod(StockID,20)+1) in place of RankPos. If the returns are way higher using RankPos then the formula is working as it's supposed to. If not, then what you're seeing now is the result of using leverage.
Thanks! That test worked. Returns definitely died down in comparison now - just a difference of 4%/year between RankPos and (Mod(StockID,20)+1).
So its hard to say if beneficial. I also noticed if I removed just 1 well performing stock from my 20-year backtest of 25 holdings, it reduced the annualized returns by 5%/year. So maybe just an artifact of optimization. My out of sample test also doesn't hold up with this formula.