Index | Recent Threads | Who's Online | Search

Posts: 100    Pages: 10    1 2 3 4 5 6 7 8 9 10 Next
Last Post
New Thread
This topic has been viewed 6089 times and has 99 replies
judgetrade
Improvement of my Ranking System

Hi,
got some messages from P123 Comunity regarding my ranking system.
I used to trade only value and stock momentum but added quality and industry momentum:

Here the code:

Industry momentum

<Composite Name="Industry Momentum" Weight="xxxxx" RankType="Higher">
<IndFactor Weight="25%" RankType="Higher">
<Factor>Pr4W%ChgInd</Factor>
</IndFactor>
<IndFactor Weight="25%" RankType="Higher">
<Factor>Pr13W%ChgInd</Factor>
</IndFactor>
<IndFactor Weight="25%" RankType="Higher">
<Factor>Pr26W%ChgInd</Factor>
</IndFactor>
<IndFactor Weight="25%" RankType="Higher">
<Factor>Pr52W%ChgInd</Factor>
</IndFactor>
</Composite>

Quality:

<Composite Name="Quality (Gross Margin / ROE)" Weight="xxxxx" RankType="Higher">
<StockFactor Weight="20%" RankType="Higher" Scope="Universe">
<Factor>GMgn%TTM</Factor>
</StockFactor>
<StockFactor Weight="20%" RankType="Higher" Scope="Universe">
<Factor>GMgn%Q</Factor>
</StockFactor>
<StockFactor Weight="20%" RankType="Higher" Scope="Universe">
<Factor>ROE%TTM</Factor>
</StockFactor>
<StockFormula Weight="20%" RankType="Higher" Name="ROE Ratio TTM/5Y" Description="" Scope="Universe">
<Formula>ROE%TTM/ROE%5YAvg</Formula>
</StockFormula>
<StockFormula Weight="20%" RankType="Higher" Name="GMgn Ratio Q/TTM" Description="" Scope="Universe">
<Formula>GMgn%Q/GMgn%TTM</Formula>
</StockFormula>
</Composite>

Growth

<Composite Name="Earnings Per Share Growth" Weight="xxxx" RankType="Higher">
<StockFactor Weight="50%" RankType="Higher" Scope="Universe">
<Factor>EPS%ChgPYQ</Factor>
</StockFactor>
<StockFormula Weight="50%" RankType="Higher" Name="EPS Chg TTM" Description="" Scope="Universe">
<Formula>eval(EPSExclXorTTM>0 and EPSExclXorPTM>0,EPS%ChgTTM,NA)</Formula>
</StockFormula>
</Composite>

Best Regards

Andreas

Nov 14, 2019 2:29:32 AM       
judgetrade
Re: Improvement of my Ranking System

Here the backtest of my improved system. Thank you all @p123 (staff and users!) you helped my a ton!!!!

This Backtest is with variable slippage and with the average of high and low at the trading day (not last close or next open!)
it also trades as good at next days close!

Was able to go higher in market cap and even added performance at the same time.
Since my account is growing, I could not trade the nano caps anymore, to much price impact and slippage, so I am
really glad I could climb the market cap up!

Attachment Trading System Andreas Himmelreich.png (277619 bytes) (Download count: 447)


Nov 14, 2019 2:33:02 AM       
Edit 2 times, last edit by judgetrade at Nov 14, 2019 2:36:09 AM
InspectorSector
Re: Improvement of my Ranking System

Judgetrade - that is a pretty impressive simulation you've got going there!

I have one observation on your ranking system. The growth node EPS%ChgPYQ is probably not doing what you think it is doing. Stocks with small PYQ EPS i.e. close to zero, either negative or positive, will dominate other stocks for this factor. If a company has a seasonally weak quarter, that quarter will be amplified relative to the rest of the year. For example, a company that produces Octoberfest beer would rank very high or very low in the spring when its sales/profits are limited. This is simply because the divisor in the growth formula (quarterly EPS) is close to zero, hence the resulting node will be either very high and close to infinity, or very low and close to (negative) infinity.

On the other hand, this growth factor will emphasize stocks that are going from no earnings to positive earnings from year ago quarter, if that is the objective. But I don't think you would want to make that judgment on a single quarter. Perhaps the second factor in your growth section will help in that regard, I'm not sure.

Steve

Nov 14, 2019 3:49:59 AM       
kumar
Re: Improvement of my Ranking System

Andreas,

Please, help to post yearly performance and trade statstics, averge gain and average loss for your 23 stocks model.

Thanks
Kumar

Warren Buffett — 'Risk comes from not knowing what you're doing'
'Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks'

Nov 14, 2019 6:05:29 AM       
mgerstein
Re: Improvement of my Ranking System

Hi Andreas,

There are a couple of bugs: ROEttm/ROEq and GrMgnttm/GrMgnQ. Becasue each ratio deals with items that might be negative, you risk getting answers that are 180 degrees wrong. I suggest you use the (a-b)/abs(b) formulation rather than a/b.

Aside from that, I’d say your quality exposure is very modest. Given the impact of seasonality, the Q vs TTM comparisons are not bona fide growth at all but a variation on momentum; specifically, these are trading on the price impact of inappropriate algorithms (which, in this day and age with all the money moving around based on algorithms that may or may not be fundamentally sound, can be a real thing — in a market with so many large players, might can make right).

The same holds true for Steve’s observation re: EPSpyq. It is often a very bouncy number for reasons he summarized. But then, again, there are trading opportunities to be had if enough players make the same fundamentally “wrong” decision at the same time.

There is a body of thought (behavioral finance) that looks to psychological factors rather than financial or statistical factors. What you have here is a variation of that I’ve been noticing — investing based on the behavior/emotions of machines and those who program them. I started to think about this a few years ago, when I noticed that adjusting for nonrecurring items seems to be less beneficial than it was in the pre-machine days. Fundamentally, you MUST make these adjustments since historic data is useful only to the extent one thinks it can persist into the future, but when non-recurring items are involved, we know with 100% certainty that these can’t persist. Or at least we humans who understand security analysis know that. Machines don’t know it and neither do many who develop algorithms and trade on them. And again, if enogh money moves a certain way at the same time, might make right. The same can be said for the Q vs TTM items. And as I type, it occurs to me it would be interesting to even test a/b versus (a-b)/abs(b).

In any case, one way or another we’re dealing with some version of momentum, which notes what the market is doing and presumes it will continue doing it — and hope we can notice a change in behavior before it becomes manifest in price action. Quality is the opposite — we’re looking for what’s substantive and has a high probability of persistence. Often this is more risk reducing than return generating.

Marc Gerstein
Director of Research, Chaikin Analytics
Blogs: https://actiquant.com, https://portfoliowise.com/portfoliowise-blog/ , https://www.chaikinanalytics.com/blog/
Twitter: @MHGerstein
I predict the future, as soon as it becomes the past

Nov 14, 2019 7:08:05 AM       
Edit 1 times, last edit by mgerstein at Nov 14, 2019 7:11:01 AM
philjoe
Re: Improvement of my Ranking System

Wow impressive that you only had a 25% drawdown!

Nov 14, 2019 11:43:04 AM       
geov
Re: Improvement of my Ranking System

Andreas,
Nice sim, $40,000 grows to $77,685,000 from Jan-1999 to Nov-2014. Is that correct?
How much where the trading costs?

Nov 14, 2019 6:45:53 PM       
wwasilev
Re: Improvement of my Ranking System

My sims look much worse. Is anyone else seeing that? The 'historical performance by ranks' graph looks very good, however.

I probably have some setting incorrect.

Walter

Nov 14, 2019 7:28:45 PM       
Nicoletta
Re: Improvement of my Ranking System

Judgetrade - that is a pretty impressive simulation you've got going there!

I have one observation on your ranking system. The growth node EPS%ChgPYQ is probably not doing what you think it is doing. Stocks with small PYQ EPS i.e. close to zero, either negative or positive, will dominate other stocks for this factor. If a company has a seasonally weak quarter, that quarter will be amplified relative to the rest of the year. For example, a company that produces Octoberfest beer would rank very high or very low in the spring when its sales/profits are limited. This is simply because the divisor in the growth formula (quarterly EPS) is close to zero, hence the resulting node will be either very high and close to infinity, or very low and close to (negative) infinity.

On the other hand, this growth factor will emphasize stocks that are going from no earnings to positive earnings from year ago quarter, if that is the objective. But I don't think you would want to make that judgment on a single quarter. Perhaps the second factor in your growth section will help in that regard, I'm not sure.

Steve

Steve,

true what what you are saying, I agree at all, but any suggestion to mitigate that problem?

Nov 15, 2019 5:46:39 AM       
InspectorSector
Re: Improvement of my Ranking System

I have been thinking a lot about this issue for a while. The %growth is convenient because the % can be comparable between stocks. Instead of using %growth, you could try to use the change in % earnings margin. You could use something like this:

100*(EBITDAQ/SalesQ) - 100*(EBITDAPYQ/SalesPYQ)

The 100* is not necessary for the ranking factor of course. I put it there so the calculation is recognized as a percentage.

Or you could use one of the built-in margins calculated by P123 such as;

NPMgn%Q - NPMgn%PYQ

This will keep the result as a % and comparable between stock while still addressing the desired parameter, that being Y-o-Y quarterly change. I haven't tried these suggestions, they are straight out of my imagination. If this idea looks good to you then let me/us know.

We need to start being more cautious about how the design of factors, particularly with regards to what goes in the denominator. The value fish are not jumping into our fishing boats like they used to.

Steve

Nov 15, 2019 7:52:32 AM       
Posts: 100    Pages: 10    1 2 3 4 5 6 7 8 9 10 Next
 Last Post