Recomendations -dynamic weighting?

I want to try different kinds of dynamic weighting.

How many of you use dynamic weighting instead of static, and would anyone share what they’re using?

I’ve been asking for this for years…

From 2015 -

I took each of my nodes that has something to do with company size, liquidity, or volume and I tried each of them as the dynamic weight, often time altering them in some way such as using its inverse. Then I started pairing them together in various ways. I found several that improved my returns. This was a somewhat randomized process. I currently use a liquidity formula multiplied by ((1/RankPos)). Not sure if that’s a the best approach, or even a good one, but it improves my returns.


Are you willing to share any of them that worked?

What do you mean by dynamic weighting? I use formula weight rebalancing in simulations and live strategies–is that what you mean? Or do you mean adjusting weights within ranking systems depending on what’s going on in the market? If the latter, I tried that, to absolutely disastrous effect, and would not recommend it at all.

1 Like

I meant this…

These are the settings I use:

The formula I use ($amt2buy) is basically R * (X - T) / X where R is a rankpos-based formula such that higher-ranked stocks get higher numbers, X is my expected return on an average stock, and T is a formula that gives my round-trip transaction cost of the particular stock.

There are lots of possibilities for R. Rank, or Rank - n where n is less than 95, or 1/RankPos, or 1/(RankPos+N), or y^(n*RankPos) where y is a number greater than 1 and n is between -1 and 0, or n - RankPos where n is somewhere between 20 and 100 . . . Any of those should work fine.


One major issue for me with dynamic weight position sizing is that the portfolio123 trading system optimizer still does not support strategies using this feature:

Trading system studies not currently supported for the Dynamic Weight position sizing method

p123 team: What are the technical obstacles to making the optimizer support these strategies? I’m not even trying to optimize position sizing parameters, even buy/sell rule parameter optimization is not supported, etc.


1 Like

Anyone who reads this in the future and follows this rabbit hole:

  1. Also read this: How to Manage Your Portfolio to Maximize Your Returns - Portfolio123 Blog
  2. What Yuval has provided is absolute gold, it provides an excellent foundation for dynamic sizing that aligns with the blog post.
  3. It also provides realism for expected returns when your portfolio begins to get too big for nano-smallcaps. Hopefully a problem you all experience in the future.
  4. Finally it also provides another vector check for curve fitting as with this approach you can expand the number of positions without significantly impacting portfolio performance.

Thank you for the guidance Yuval.

I used your basis and historical returns to create a quadratic formula (fitted with Python) that estimates expected returns based on rank and another for fees based on real IBKR costs.

I found the curve is pretty steep > 95 rank, but then more linear when below 95 - which you alluded to above I think.

The end result was simply R - T

The idea is that the ranking would therefore automatically allocate more to higher rank stocks, however in practice it didn't allocate enough. I realized (of course) the theoretical optimal allocation is 100% to the highest returning proposition - ignoring any constraints, which your simpler 1 / RankPos succeeded at tilting towards better.

So in the end my over-complicated formula is, using the various equations is simply:

(R - T) ^ N

N has to be cranked pretty high to hit the allocations 1 / RankPos targets and similar return profile.

It was an interesting experiment anyway.

I'm still stumped on how to prevent over-allocating to low liquidity stocks other than hard limits in the Universe, or manually calculating (based on universe liquidity and portfolio size) and setting a position cap with the ranking formula based on the most illiquid stock we might take a position in - which is sub-optimal.

Using estimated fees does take care of this a bit, but when you're allocating heavily to your best prospect that still overrides the fee calculation and might potentially put too much in a low liquidity position.

I think I'd need a formula to calculate the maximum position size I'd want to take based on portfolio size and liquidity, which might be sort of possible with Rank Formula, but then because the resulting rankings are normalized to 100% I don't think there's a way to actually implement it.

Another idea would be just multiple portfolios tiered out based on liquidity, with manual hard limits as above, then combined into a book.

Or just turn down the N so allocations are a bit smoother and monitor real positions carefully.

Just a follow-up to my previous post if anyone wants to try this path.

I switched to a much simpler linear formula for the return prediction. The previous try was too curve-fitted for my liking. I also rounded the values from the linear fitted formula to improve generic robustness. To do this set PolynomialFeatures(degree=1).

I tested it on many different ranking systems I've accumulated, and on average it improved CAGR and Sharpe by a reasonable amount - nothing crazy.