More details on how the dynamic position sizing works in the background. An example...

P123,

I have been playing with the dynamic position sizing in the last few days and while I do manage to improve my backtest results, I would like to fully understand what it does in the background before committing real money.

The entire logical flow would be great but if I had to choose, I really want to understand the logic with a min and a max weight constraint and how it intersects with the “Automatically adjust new transactions to remain at 100% invested”. Note that I have read (with great attention) the tutorial in the help section.

Please see the attached set-up in the picture: a 10-stock port; weighted by MktCap with a min of 5% and a max of 15% position. No position drift and a min rebalance @ 2% to avoid frequent small buy/sell orders.

  1. For example, when the portfolio is first created:

It takes the 10 stocks that rank best and pass the buy rules. But what is the logic to allocate the weights in my example:

  • does it take the one stock with the smallest mktcap and give it 5%; the one stock with the largest mktcap and give it 15%; and all the others are weighted like weight% = 5 + (15-5)*(Mktcap/Sum(Mktcap of the 10 stocks in the port))? It is likely to still need to do further adjustments to be 100% invested, no?

  • or does it first distribute the 10 stocks via Mktcap/Sum(Mktcap of the 10 stocks in the port) , then try to give 5% to anything and everything that is below 5% and 15% to any stock that is above 15% and then do further adjustments to make it 100% invested per the radio button “Automatically adjust new transactions to remain at 100% invested”?

  1. For a portfolio that has been running for some time, how are the adjustment decisions made for “Automatically adjust new transactions to remain at 100% invested”?
    A good example is if you have a buy condition that prevents buying for an extended period of time → say, you end up one day with 5 positions (over time, the portfolio sold some stocks but is forbidden from buying new ones)
    What will happen then? (I have tested and have different cases as a result). I have a case where it is ending up 75% invested. I assume it is =5x15% meaning the setting “Automatically adjust new transactions to remain at 100% invested” overrules the mktcap weighting allocation and has all the stocks @15%. Is this the case?

NB: this is a great feature and I am very thankful to you guys for having added it. As part of my design logic, I systematically try to understand / anticipate what (market) situation would brake the logic of my algos to be aware of as many of its weaknesses as I can identify in advance (i.e. things not visible in the backtest as did not happen in the past but could happen in the future). So, some light on the blackbox active rebalance is helpful.

Many thanks in advance,

Jerome


Hi Jerome and all,

I have been experimenting with the Dynamic Position Sizing in an ETF portfolio that holds two ETFs. I would like to eliminate all the very small share purchases and sales that occur over the simulation period, as the portfolio tries to make micro-adjustments to achieve optimum weights. Of course, this occurs when “Allow Immediate Buyback” is set to “Yes.”

However, I have found nothing that helps in the dynamic position sizing under the Rebalance Tab. P123 staff tells me that this new section does not do what I want, which makes me wonder, “Why not?” It seems unusual to have created a completely new section/capability of the site and not resolve an issue that has existed since in P123 about 2004 or 2005.

The optimum position sizing would obviously be 50% for the two positions in the portfolio. However, if under “Weight Constraints,” I enter a Minimum Weight of 30% and Maximum Weight of 70%, I receive the error message that nothing is being bought, regardless of adjustments made to these settings.

Is there anything that will accomplish the resolution of this issue? Any suggestions would be helpful. However, I am getting the impression that there may only be a few people using this ‘feature’ of Sims/Ports. Thanks to anyone who can offer any help/suggestions.

Chris

I’ll second Jerome’s request for more transparency into the workings of “Formula Weight”.

I am very satisfied with the new rebalancing module.
Assume you want to hold 60%VTI and 40%BND.

buy rule: ticker(“VTI,BND”)
sell rule: 1
Number of Positions =2
Position Weight Formula: 6Ticker(“VTI”)+4Ticker(“BND”)
Min Rebalance Transaction = 100% for no rebalancing, or smaller percentage for some rebalancing.

It is as easy as that, thanks to the great effort of the P123-Team.

Hi Georg,

Thank you for the feedback. However, the ETF strategy I am referring to in this case is choosing the two, highest ranked ETFs from a universe of similar ETFs. It could be an equity, a fixed income, international, – whatever – ETF universe. It is holding the two ETFs in (approx) equal amounts. I would just like to eliminate the 10-share, 5-share, etc. purchases that are made at many rebalances.

Of course, this also occurs with stock portfolios as well as ETFs, always when “Allow Immediate Buyback” is set to “Yes.” (This setting is required for these particular portfolios.)

Is there a setting I am missing that will eliminate (or significantly reduce) these superfluous transactions?

Chris

Chris,
In buy rule list all the ETFs.
Position Weight formula: try using the Eval function.

Hmmm… I am not sure how to configure the Eval function to control a minimum number of shares bought, min $, min. %, or other variables. Can you give me an example of what you mean, please?

Thanks again,

Chris

Chris,
Put your current buy rules into buy, and sell rules into sell.
Position Weight formula for 2 ETFs: 5Ticker(“ETF1”) + 5Ticker(“ETF2”)+ 5Ticker(“ETF3”) +…5Ticker(“ETF10”)

That should work.

Thanks Georg,

But I guess I wasn’t clear. I have a 200-ish-ETF Universe. The port rebalances and selects the two highest-ranked ETFs each week (avg of 2 months between trades). So your last approach won’t work (unless I am entirely misunderstanding it). I do appreciate you giving it time and thought, though. Let me know if you have any other ideas.

My guess is that it is an impossible mission. The one thing I have considered is if I get really complex and build my sell rules back into the buy rules with a command not to rebuy what is already in the Port. I have done this with a very simple Sim, but it would be a lot more complicated to do that with this one. I find that ‘complicated’ usually results in unintended consequences down the road.

It is unfortunate that P123 has not seen fit to add hedge timing to ETF portfolios. It’s one of the few missing capabilities that I could really put to use.

And I concur 100% with Jim on the original subject of this post; that it would be very helpful if we could understand the inner-workings/ intricacies of the Dynamic Positioning module. I would know then if I could use it to eliminate “Buy/Sell Difference” transactions. As it stands now, we just plug in numbers and… well, hope for the best. Amirite?

Chris

Hey Chris, have you tried adjusting the Minimum Rebalance Transaction value to eliminate small rebalancing buys and sells? I believe that works independently of the Allow Immediate Buyback setting (Immediate Buyback was the only way to rebalance existing holdings before rebalancing and reconstituting were separated logically). To see that it’s working, use a minimum dollar amount at first, then adjust as desired. You may find that you don’t need Allow Immediate Buyback set to yes for your model now.

If your optimum position size is equal weighting per position, just enter a constant “1” in the Position Weight Formula field. That way, you can use the minimum rebalance transaction feature without actually using dynamic position sizing.

Chris,
I thought that your universe was only 10 ETFs of which you select 2.
Bob is correct.
Allow Immediate Buyback: yes
Position Weight Formula: 1
Min Rebalance Transaction : 5% will reduce the number of trades.

To see the implementation details of weight constraints, read my post Re: Weight constraint - dynamic position sizing. (Would this be a handy appendix in the Dynamic Position Sizing tutorial?)

As for the Automatically adjust new transactions to remain at (100% invested/target exposure) option of Exposure after Rebalance, the system will do its best to come within 0.000001% of the target position exposure by equally distributing the difference among the transactions not eliminated by any preceding option or constraint. It uses an iterative process to make these adjustments because whole-shares throws off this process. The process also respects the minimum rebalance transaction option, eliminating rebalance transactions which fall below the option in the process. Since the transactions are best if executed by amounts rather than by shares, exposure is estimated using the transaction price.

Here’s the gist of its behavior (differences between the two conditions are [color=red]red[/color]):
[]If the estimated position exposure would be below the target:
[
][color=red]Increase[/color] all transactions ([color=red]increase[/color] buys, [color=red]decrease[/color] sells) until estimated exposure is [color=red]above[/color] the target.[]Decrease [color=red]buy[/color] transactions until estimated exposure is [color=red]below[/color] the target.[]If the estimated position exposure would be above the target:
[][color=red]Decrease[/color] all transactions ([color=red]decrease[/color] buys, [color=red]increase[/color] sells) until estimated exposure is [color=red]below[/color] the target.[]Decrease [color=red]sell[/color] transactions until estimated exposure is [color=red]above[/color] the target.[*][color=red]If it’s a cash portfolio, it will then increase sell transactions again until exposure is again below the target.[/color]

Aaron,

Absolutely!

It would also be helpful to define some of the unfamiliar terms and syntax, such as (assuming this is JavaScript?).

Right! That was just pseudo code I used (read ad hoc syntax) to denote operations on the set [font=courier new]Positions[/font]. Perhaps it might be more effective as a descriptive plain-language explanation?

Aaron,

Pseudo-code is good by me!

//dpa

Pseudo-code, being more restrictive, is better for me, too. I usually find a narrative (and/or example-based) descriptions too open to interpretation.

Walter

Bob & Georg,

Thank you much for those tips! I can see that there is a lot more control over the size of the transactions, virtually eliminating the “Buy/Sell Difference” transactions.

A note of caution before others jump into this with both feet, while the previously referenced settings (I tested from 5% to 50%) reduces most of the small transactions (a reduction of ~28% of the total transactions), it also reduces the annual return by a fraction of 1% and increases Max DD by about -4% for my particular setup (from -21% to -25%). This effect results from eliminating the micro-adjustments to the portfolio positions made during its lifespan. So, the use of this approach just depends on your objective; i.e., squeezing out the last ounce of return, or reducing the micro and small transactions for easier maintenance. Notably, the percentage of Overall Winners also went up by 5%, (from 66% to 71%) so that’s a plus that largely offsets that one-time MDD.

At least now I can see the effect of ignoring those small transactions and for me, the minimal percentage-return decrement is worth it if I can reduce effort and costs while eliminating the chump-change transactions.

Chris

PS - Thanks for the details of how the Dynamic Position Sizing works, Aaron.

Chris and others,

The net effect of limiting small rebalance transactions is strongly dependent on a combination of factors, and can result in better return and drawdown or worse return and drawdown. I urge all to test their particular combination of model, rebalancing schedule, position values, and transaction costs. Do not assume what the results will be!

Precisely, Bob. That’s exactly what I was trying to say, in (apparently) a round-about way. :slight_smile:

Users should definitely test different settings, as each setting will result in slightly different results. I actually ended up using 50% for “Min Rebalance Transaction” (with two-position ETF port) or 100% for one-position ETF port and “Allow Deviation up to 5% from 100% invested.” This allows each position to be set very close to the optimum desirable but with +/- 5% wiggle room either way.

Also, after reading the info from Aaron, I tried using the last setting, “Automatically adjust new transactions to remain at 100% invested” as a viable alternative, if “Min Rebalance Transaction” was set to 5% below optimum. In my case, that was 45% for a two-position portfolio (for 5-stock portfolio, perhaps try 100% / 17%). Read Aaron’s narrative on how the logic flows, linked earlier in this thread. And, as Bob said, YMMV, so test, test, test.

I am also more comfortable with future outcomes now that I understand how the logic works behind the interface. Thanks, Aaron.

Chris

Aaron,

I think I understand the weighting logic as explained in the linked thread. Based on my understanding, we would require additional cross-sectional functions to replicate the schema using native P123 syntax: namely, FMin(“”, #Scope) and FMax(“”, #Scope"). Am I correct to assume this?

I made a feature suggestion for these functions (in addition to Percentile) to augment the existing cross-sectional functions. I hope it isn’t much work to implement.

My immediate reason for this request is to be able to a) cross-check weightings, b) re-normalize weights in-situ and c) create in-situ liquidity thresholds. As it stands right now, I am getting some negative weightings for a long-only PortSim which I think is due to the goal-seeking re-weighting process combined with the minimum and maximum constraints. I have no major gripes with the current process, but based previous experience I realize how tricky weighting optimizations can be.

//dpa