Improvement of my Ranking System

One more question: Are you going to trade this Ryan?
Best Regards
Andreas

Hello Andreas, I’ve set up two versions of this port as a live system on automatic re-balance.

I’m also working on a Canadian version (where I’m from), but so far I can’t get the results like in the US versions yet. Getting about 28% CAGR (20 yr), but higher DD (with hedge). This sim also shows a very volatile last two years, overall performance is essentially flat. The Canadian market is very different than US, i.e. higher concentration of financials, energy/mining, resource etc. There are several P123 factors that are unavailable for Canadian stocks as well, i.e. short interest. I also find a higher proportion of small cap/low volume Canadian stocks are uncovered by analysts (which can be a good thing), but any factors relying on analyst estimates will provide a high proportion of NAs.

See 10 & 20 yr sims for the Canadian version attached, 25 stocks.

Not invested yet in the US versions yet, I’ll see how they behave in realtime/out of sample, it’s also a good way to ferret out any bugs, i.e. see the actual stocks being selected, some can be fantastic on one factor and an absolute dog on another. I’ve started doing this the last few months on other sims/ports, this is a very valuable tool and strategy I’ve only recently started using.

If I trade it, I’ll need to change brokers for this low volume account. My current broker doesn’t offer GTC orders.

Any tips on the buying w/ GTCs? My take is the best way is to put in an order 2-3% lower than Friday close, and wait a few days. Any tips/tricks would be great!

I’ll keep you posted with any developments.

Thanks for sharing your twitter progress, I’ll be sure to follow you.

Love your posts and videos, keep it up. And good luck going pro next year!

Cheers,
Ryan



Opps, to avoid confusion I meant to change @adt to 200000 as I did for the other items in the list. But since I introduced the confusion let me clear it up.

I put my liquidity rules inside a custom universe rather than as a buy rule. That avoids unintended consequences when I use a rankpos < x as a buy rule or > x as a sell rule. Here are the two relevant lines from my universe specifications:

SetVar(@adt,200*1000)
MedianDailyTot(10,0)>@adt and MedianDailyTot(10,10)>@adt and MedianDailyTot(10,20)>@adt and MedianDailyTot(10,30)>@adt

Using @adt is just a quick way for me to change the threshold in the multiple conditions in the second line.
I just realized it would make more sense to call the variable @mdt since I now use mediumdailytotal rather than averagedailytotal.

Brian

Cool!

Hi all,

I just tried the upper formula of Steve, on an empty RS and the result is here attached. As I noticed this kind of istagramm many time in my RS, I am asking the forum how to avoid a sudden crash (probably in this case a too high ratio of NPMgn% is intolerable) when the quartile is high (>80-90%). Is there a solution to avoid the drop?


Hi Fabio,

I doubt there is a way to avoid a systematic drop-off as it depends on what you are ranking.

However, you could try to configure your ranking so that you “displace” the peak value conveniently to the right / left.

Caveat → I have never used a displaced ranking myself

Good luck

Jerome

Nicoletta - I would not use the formula in isolation as there are a lot of other factors to consider. (My point in the previous post was that earnings growth is not really sorting on earnings growth as you cannot grow earnings if there aren’t any.)

You should use it in conjunction with other factors. Use enough good factors and the top end roll-off that you see in the ranking performance should disappear.

Steve

I think you have to understand WHY the performance drops off.

Increases in profitability/margin can signal two things: an increase in earnings or a decrease in sales. A company with a huge increase in profitability is probably experiencing both. And a large increase in earnings with a large decrease in sales indicates a possibility of earnings manipulation.

Margin increases are extremely useful signs, but you have to read those signs the right way. And a higher-is-better system is probably a bad idea.

How about using the linear regression slopes in the ranking system.
LoopSum(“RoE%(CTR,ANN)(3-CTR)",7,0,1,1) / LoopSum("Sales(CTR,ANN)(3-CTR)”,7,0,1,1) [higher is better]

If RoE% has a steeper slope than Sales, this would indicate higher profitability. You don’t want higher Sales with lower RoE%.

Georg et al - I have a basic problem with LoopSum(“Sales(CTR,ANN)*(3-CTR)”,7,0,1,1).

Take two companies. Company 1 has annual sales as follows:

2, 3, 4, 5, 6, 7, 8

Company 2 is twice the size of company 1 and has annual sales as follows:
4, 6, 8, 10, 12, 14, 16

Both companies have the same sales growth profile, the only difference is that Company 2 has twice the sales of Company 1.

If you use the formula LoopSum(“Sales(CTR,ANN)*(3-CTR)”,7,0,1,1) the calculation for company 1 comes out as:

2*(-3)+3*(-2)+4*(-1)+5*(0)+6*(1)+7*(2)+8*(3) = 28

The result for Company 2 is:

4*(-3)+6*(-2)+8*(-1)+10*(0)+12*(1)+14*(2)+16*(3) = 56

The slope is twice as big for company 2 simply because the company has twice the sales to start with. The formula is correct but it does not meet the intent of what we are trying to achieve (in my opinion). Both companies are growing at an equivalent pace but Company 2 comes out 2x company 1 for this metric.

Putting the sales in the denominator doesn’t help as ROE%ANN is already a normalized figure.

There may be some value for having Earnings in the numerator and Sales in the denominator. I will have to think about that some more.

SteveA

Steve, Thank you for this example.

You have just shown us why “Sales” on its own is not a good indicator to select stocks by, and as Yuval and I found earlier “Sales” does not work well.
https://www.portfolio123.com/mvnforum/viewthread_thread,12038_offset,20

However, “RoE%” is a much better indicator, because replacing in your example “Sales” with “RoE%” will produce the result you want.

ROE should work much better. But when you say “works much better” you need to make sure you are testing against 7±year-old stocks only. This means creating a universe of stocks that has 7 years of data minimum, then run your ranking system on it. Otherwise the newer companies could be influencing your results. How? First of all there are IPO lockups that cause stocks to tank 6-9 months after IPO. Second, smallcaps have been underperforming for several years. So if you include these newbees in your universe, they are going to be placed at the bottom of your ranking system, assuming the formula comes out as “N/A”, making the RS look better than it should.

SteveA

Thanks a lot to all (SteveA, Yuval, Georg, and Jerome). It’s a plasure to write here and find experienced people that helps you.

It’s sure not my intention to create a RS with a single rule. I am seeking new way to improve my poor results, trying each factor and assembly the one with better results in an unique RS, and I just wanted to know if there’s a way to avoid the drop in the last decile that some parameters have.

As far as I understand the answer is no… no way to filter…unless to change the formula.
As Steve says “You should use it in conjunction with other factors. Use enough good factors and the top end roll-off that you see in the ranking performance should disappear”
Thanks again
Fabio

Abs (FRank (“factor”, #sector [or #industry or #all], #desc) - 80 [or 70 or 60]) with lower values better

This is, in my experience, a good way to use factors for which you don’t want the highest or lowest value in a ranking system. Alternatively you could specify an actual value that you think a stock should aspire to. For example, I use the following formula in my ranking systems:

Abs(LoopMedian(“OpMgn%(Ctr,TTM)-OpMgn%(Ctr+4,TTM)”,12,0)-1.5)

That means I want companies whose operating margins have grown between -5% to 8% per year over the last three years. 1.5% is the midpoint there. Of course, this makes much more sense as a screening rule, but I like putting everything into a ranking system for the sake of flexibility.

1 Like

The only thing I don’t like about this is that you can end up throwing the baby out with the bathwater. I prefer to solve the problem by throwing more factors into the mix. If you have enough factors the best stocks should remain near the top.

SteveA

A great technique when there’s a supporting theory for down ranking the extremes. For example, for dividend paying stocks, avoiding those with high yield since they may have higher risk of dividend cuts and also avoid low yielding issues since they can fail to impose fiscal discipline on management;

abs(Yield-FMedian("Yield",#Industry)) // Lower is Better

But I wouldn’t do the same just to patch-up a poorly performing factor. Seems like data-mining to me.

Walter

That depends on the factor, Steve. There are a lot of factors for which it simply doesn’t make sense for the top values to be best and the bottom values to be worst. You have to think each factor through logically.

Change in margin is one such factor. The companies whose margin has risen the most have decreasing sales and increasing income. That is not a good thing.

Sales growth is another such factor. Companies with unsustainable sales growth are usually punished by the market. I bet you could look at a hundred years of data and see this play out well.

Size may be a third such factor. Really really really tiny companies may not outperform in the long run, especially if you take transaction costs into account. While the SMB factor works pretty well in theory, you have to place a limit on the S (and this may depend on the holding period).

I would guess that about a third–maybe even half–of the most commonly used factors are NOT linear in terms of the slope of the bucket performance but instead follow a skewed bell-shaped curve, and there’s usually a good reason for that drop off. It’s absolutely vital to think every factor through. Ask yourself: Are stocks that have super high factor X really more likely to outperform than stocks that have middling factor X? You’ll often find yourself answering: Well, not necessarily.

And while it may be “data-mining” to estimate an optimal FRank or value for a factor, that may be more LOGICAL than settling on the highest/lowest value.

1 Like

Good discussion here folks.

I agree that it’s important to see how multiple factors work together, however I’d have to agree with Yuval’s point above, many factors are mean-reverting, i.e. stocks with a particularly high factor score may be at the peak of their cycle for the given factor and can be positioned for a downswing, indicated by the drop in performance of top ranked deciles.

Another possible source for the drop-off in top ranked deciles is outliers. An exercise I find very helpful is to screen the stocks for the given factor and take a look at the actual values for the factor across the stocks, not just the overall rank chart.

I’ve actually been looking at this recently in the Magic Formula (and hopefully a Seeking Alpha article to follow). Take Return on Capital from the P123 Greenblatt ranking system:

OpIncAftDepr(0,TTM)/New Working Capital or ( NetPlant(0,qtr)+ Recvbl(0,qtr)+ Inventory(0,qtr))

If you create a screen report with this formula, you will find the median ROC values for the top 30 stocks today is 19%.

The stock ranked as #10 is INVA, a pharmaceutical firm. Its ROC is 365%, a significant outlier from the rest of the portfolio. Maybe there’s good reason for this, however it’s worth digging deeper.

INVA currently has no net plant or inventory assets on its balance sheet, so the numerator in the ROC equation will be quite small, resulting in a very high ROC value, and also a high Magic Formula rank.

Is a ROC value of 365% predictive of future returns? As INVA is an asset light company, ROC is likely not a good factor to use for INVA and may not be predictive of future returns as the Magic Formula intended.

For what it’s worth, INVA lost 24% since being purchased by the Magic Formula model one year ago.

This is one specific example, but the point is that it may be worth taking a look at the actual values of the stocks being screened by your factor(s), outliers like the above may also be skewing your decile ranking performance results.

Cheers,
Ryan

We must be thinking of two different definitions of margin Yuval, or perhaps you are thinking of a specific industry that behaves differently than the norm. Increasing margins shouldn’t have anything to do with decreasing sales, in fact increasing sales generally improves efficiencies and hence margins. If you truly want to “think this through logically” then perhaps the answer is to find additional factors that weed out the stocks that are prone to mean reversion. Otherwise, you are indiscriminately throwing out the baby.

So there are certain companies with unsustainable sales growth AND there are also companies out there with very sustainable sales growth. I don’t see that as a reason to discard all high growth companies. In fact, I have systems that capitalize on high sales growth that target specific industries.

To each his own.

I’ve never been a size-based trader so this one I don’t care about.

Margin is earnings divided by sales. There is no other definition of margin. If a company’s sales go down and its earnings stay the same, the margin goes way up.