Implementing ATR-based risk parity position sizing in a Live Strategy

I'd like to implement position sizing based on ATR (risk parity style), where:

shares = (account value × risk factor) / ATR(20)

The idea is that each position targets roughly the same dollar-risk contribution to the portfolio (volatility-adjusted sizing), rather than equal-dollar or equal-weight sizing.

Has anyone implemented something like this in a P123 Live Strategy?

Unfortunately, P123 can't do this. I made a feature request for it but nothing happened. It's a shame because any sort of volatility or risk driven position sizing strategy produces much better results than ones based on price (I know from a career at a quant HF, we sized exclusively on risk (risk simply being the dollar value of the distance to a stop loss). For instance, let's say we have 2 stocks to buy, both trading at 100, with stop losses at the lowest low of the past 20 days. One stock is a utility with a very narrow range, low volatility, the second is some tech stock that is very volatile. So maybe we have stops placed at 97 for stock 1 and 77 for stock 2. P123 would have us buy the same numbers of shares of each based on price, despite the fact there is significantly more risk in stock 2 and it should therefore be sized smaller. The idea being to size each position so they are equal in risk (at least at trade initiation) rather than price.

Coming over from discretionary trading, this was another concept I had a hard time coming to terms with, alongside grading market conditions (the somewhat taboo market-timing discussion), convex crash protection, and a few others. For years I sized pretty much the way portfoliologic describes: every trade sized so a stop-out cost a fixed fraction of a percent.

As a discretionary trader, most of the risk control lived inside each trade: the stop, the size, whether to be in a name at all. A ranked model takes all of that out of the position level. There is no stop, the rank is the exit, and the model is always on. For me, that meant moving risk control up to the portfolio level.

Trying to bring old habits along was informative. Most of what I trade are designer models, so my testing is a bit indirect, but the stop tests I've run on ranked models have lowered the average trade, mostly through whipsaw.

I think part of the reason is that much of the discretionary edge was in the entry: finding spots where you expect price to move powerfully one way or the other, so you can win big when right and lose small when wrong. In my experience, that chart/technical behavior and the liquidity to exit cleanly often aren't there in thinner names.

At some level I still think combining the two approaches may be best, and I believe there's more synthesis to be found between what I used to do and what I do now. But part of my goal was to take myself somewhat out of the equation, and I know my personality, so I tread carefully in my explorations.

well with a ranking you still allocate cash in equal size to each ticker but not allocate risk in equal size .More volatile the stocks more risk you add ,thats why maybe some position deserve to be 3% an other 8% ,ranking does not change the % of a stock you own

I agree with you, and I would love to see the functionality added.

I think there are many use cases for what you guys want, but I was just sharing my experience in adapting to ranking systems.

The issue I ran into in practice is that stops are what make volatility-based sizing work the way I’m used to, and I believe most people here advocate not using stops with ranking systems.

With a stop, volatility can do two jobs that offset each other. A wild stock gets a wider stop and a smaller position; a quiet one gets a tighter stop and a bigger position. Multiply them out and every trade can be sized to lose roughly the same dollar amount when you’re wrong. That isn’t necessarily a preference for quiet stocks; it’s a way of equalizing defined initial trade risk, as you point out.

Take the stop away, however, and only one side of that relationship remains. There is no stop distance to offset the sizing differential. Your actual loss is now determined by how far a stock falls before the ranking system sells it, and ATR does not determine that.

Using portfoliologic's example in a $100k portfolio, where the stops sit 3% and 23% below entry, a method that might put roughly $33,000 in the utility and $4,300 in the tech stock gives both positions about $1,000 of defined initial stop risk. Remove the stops, and that equality disappears: you simply own more than seven times as much of the quiet stock.

That may be exactly what one wants, but it is a portfolio bet of its own, essentially inverse-vol weighting, which puts more capital in the quiet names on the assumption they stay quiet.

I don’t know if you guys are dealing in microcaps, but there is another wrinkle there. A low ATR can sometimes show up in a stock that barely trades, so you can wind up sizing up the positions that are hardest to exit. ATR also doesn't capture gap risk, dilution risk, or sudden liquidity disappearance, which, of course, have to be dealt with separately.

When I traded more discretionarily, I sized positions based on the stop I felt I could get away with, not necessarily the stock’s volatility. I preferred volatile stocks with a large average daily range and tried to buy them at points I felt should hold, so I could size relatively large against a tight stop. If the trade worked, I would then loosen the stop to some multiple of volatility to let the winner run.

So I’m not arguing against the functionality at all; I'm just sharing that my experience moving from stop-based discretionary trading to rank-based portfolio trading has changed my methods and mindset in ways I never would have guessed.

I think I have a rough way to test whether this idea is actually worth pursuing in practice.

In Simulation, use the Dynamic Weight option and set the weight formula to 1 / TRSD1YD. That tilts the portfolio toward less volatile names. Then run the same test with TRSD1YD to tilt toward the more volatile ones. Compare both against equal weight on Sharpe and Calmar.

I ran that comparison on my own strategies and didn’t see a meaningful edge for the risk-adjusted weighting over equal weight. I realize that’s not exactly the ATR-based risk parity setup you’re discussing — especially without stops — but it should give you a reasonable first read on whether inverse-vol weighting helps in a rank-based system at all.