Cheat Sheet P123 Factors
In this post, I present a cheat sheet for my favorite P123 Formulas & Factors (will update in the future and send it out!) There are many more factors in the P123 Database, this is just a small part of it.
Factor & Function Reference
https://www.portfolio123.com/doc/doc_factors.jsp
Use that link for the search of a factor —> (also available when you build a screen or strategy or a ranking system).
Earnings estimates (powerfull!)
https://www.portfolio123.com/doc/doc_factors.jsp
After “//” the comment e.g. the explanation of the formula starts, you can copy it with the comment into buy and sell rules, it will be ignored.
%(CurQEPSMean, CurQEPS13WkAgo) // 13 Weeks EPS estimates growth [higher better]
%(CurQEPSMean, CurQEPS8WkAgo) // 8 Weeks [higher better]
%(CurQEPSMean, CurQEPS4WkAgo) // 4 Weeks [higher better]
%(CurQEPSMean, CurQEPS1WkAgo) // 1 Week [higher better]
CurQEPSStdDev/abs( CurQEPSMean) // EPS Estimate Variability current Quarter [lower better]
FRank (very powerfull function!)
Description: https://www.portfolio123.com/doc/doc_detail.jsp?factor=FRank
Use FRANK as a buy rule in a screen or strategy:
FRank("%(CurQEPSMean, CurQEPS13WkAgo)",#all,#DESC, #ExclNA) > 80 // all —> goes over all stocks and ranks them
FRank in a buy rule, will make sure, that only the top 20% of stocks in terms of
%(CurQEPSMean, CurQEPS13WkAgo) will pass the buy rule. If CurQEPS13WkAgo = 1 and CurQEPSMean 1.1, it would calculate 10% growth. But that is not all, all stocks will be ranked by the ratio %(CurQEPSMean, CurQEPS13WkAgo).
FRank("%(CurQEPSMean, CurQEPS13WkAgo)",#sector,#DESC, #ExclNA) > 80
FRank("%(CurQEPSMean, CurQEPS13WkAgo)",#subsector,#DESC, #ExclNA) > 80
FRank("%(CurQEPSMean, CurQEPS13WkAgo)",#industry,#DESC, #ExclNA) > 80
FRank("%(CurQEPSMean, CurQEPS13WkAgo)",#subindustry,#DESC, #ExclNA) > 80
FRank on Average True Range —>
FRank("ATR(20,0)",#subindustry,#DESC, #ExclNA) > 85 // —> subindustry that are in the top 15% of Average True Range last 20 Days, stuff that moves!
FRank("ATR(20,0)",#all,#DESC, #ExclNA) > 85 // —> stocks that are in the top 15% of Average True Range last 20 Days, stuff that moves!
Quick Rank on a screen —>one single factor ranking
%(CurQEPSMean, CurQEPS13WkAgo)
Other powerfull stuff I like (from “Small and Micro Cap Focus” and “Core: Sentiment” Ranking Systems)
LoopSum("EPSExclXor(Ctr,Qtr) > EPSExclXor(Ctr+4,Qtr)",6,0) // —> In how many of the last six quarters did the stock's EPS exceed its EPS a year earlier? [higher better]
(CurQEPSMean- HistQ4EPSActual)/Abs(HistQ4EPSActual) // —> This measures the growth of the company's most recent quarterly EPS estimate over the one a year earlier.
(FCFQ-FCFPYQ)/MktCap // —> This takes the familiar PEG ratio and applies it to the company's free cash flow, but using only values from the latest quarter and the same quarter a year ago.
CurFYEPSMean/Price // —> Forward earnings yield
ConsEstMean(#EBITDANTM,0)/EV // —> Forward EBITDA/EV
CurFYSalesMean/MktCap // —> Forward revenue yield
Abs(GrossPlantA/SalesA-FMedian("GrossPlantA/SalesA",#industry)) // —> This factor punishes companies whose ratio of gross plant to sales is quite different from the median in their industry. These are companies whose sales are incommensurate with their fixed assets and thus unsustainable, as well as companies whose sales are negligible considering how much capital they have. [lower better]
Aggregate("RSI(200)",#industry) // —> This is a useful barometer of industry momentum [higher better]
(InventoryA-InventoryPY)/AstTotPY // —> Companies that are decreasing their inventory are probably doing something right [lower better]
LoopMedian("ROE%(Ctr,TTM)",12) —> median ROE
Surprise%Q1 // —> Earnings Surprise last report [higher better]
Surprise%Q2 // —> Earnings Surprise last report before the last report ;-) [higher better]
AvgRec- AvgRec4WkAgo // —> Changes in Recommendation in the last 4 Weeks [higher better]
MedianVol(252)/SharesCur(126) // —> Share turnover is a standard metric which is very predictive of a stock's beta. The lower the share turnover, the lower the beta will be. [usally lower better, eps. with small caps]
MedianVol(65)/SharesCur(0) // —> Share turnover is a standard metric which is very predictive of a stock's beta. The lower the share turnover, the lower the beta will be. [usally lower better, eps. with small caps]
Aggregate("TotalReturn",#subindustry) // —> subindustry momentum
(OperCashFlTTM - CapExTTM + (1-TaxRate%TTMInd/100)*IntExpTTM)/EV // —> Unlevered free cash flow to EV This is a shorthand version of the ratio that powers intrinsic value calculations. Warning: it's relatively meaningless for companies in the financial sector.
(SMA(150,21)-SMA(150,252))/ATRN(150) // —> This is a momentum measure that takes the SMA a month ago, subtracts the SMA a year ago, and divides by the average true range. It favors stocks whose price has risen dramatically compared to their usual range. We don't look at the last month's worth of prices since we like to buy on the dip!
MedianDailyTot(126) // —> Median daily total amount traded (price * volume) for the past (in this example 126) number of bars.
AvgVol(13)/AvgVol(13,30) // —> stocks with a recent increase in volume are either exhibiting strong local momentum or strong mean reversion.
Momentum (from Core: Momentum)
close(0)/close(120) // —> 120 Days return
close(0)/close(140)
close(0)/close(160)
close(0)/close(180)
UpDownRatio(120,0) // —> up and down ratio last 120 Days
UpDownRatio(60,0)
UpDownRatio(20,0)
Close(60) / Close(120) // —> 3 Months returns 3 Months ago
Close(120) / Close(180) // —> 3MoRet6MoAgo
Close(180) / Close(240) // —> 3MoRet9MoAgo
Pr26W%ChgInd // —> 26 Week Price Percent Change Industry (%)
Pr52W%ChgInd // —> 52 Week Price Percent Change Industry (%)
FOrder("Ret1Y%Chg",#Previous) <= 25 // Execute the rules (in a screen) above and then buy the 25 stocks with the highest 1yr return.
Actuals Data (very powerfull as well!)
https://www.portfolio123.com/doc/doc_detail.jsp?factor=ActualGr%25PQ
“Actuals are companies' historical financial data, such as earnings, sales, and net income. Unlike fundamentals that come from official filings submitted to government agencies, Actuals are collected primarily from company press releases and/or from brokers.
Actuals are primarily used to calculate surprises vs the analyst estimates. However, integrating Actuals in fundamental analysis can offer a unique perspective compared to only using data from 10-K and 10-Q filings. This is particularly relevant when Actuals reflect different GAAP treatments, including one-off items or other specific financial occurrences.
Many semiannual companies release earning releases every quarter, and analysts follow suit with quarterly estimates. The main downside is that Actual data can be spotty and inconsistent through time, especially in the past. For example sometimes more complete actuals are the semiannual ones, and sometimes the quarterly.“
ActualGr%ttm(#EPS) + ActualGr%PQ(#EPS) // —> Actual eps growth TTM + Last Quarter EPS Growth
%(CurQEPSMean, CurQEPS13WkAgo) // —> Earnings estimates growth last 13 Weeks, very strong on the industry and stock level
Quality Filters
AltmanZOrig > 1.81 // good quality filter on small caps! https://www.portfolio123.com/doc/doc_detail.jsp?factor=AltmanZOrig
FCFq > 0 // free cash flow > 0
Net Income
NetIncBXorTTM > 0 // net income trailing 12 months
NetIncBXorPTM > 0 // net income prior trailing 12 months
Avoid Value Traps (in growthy systems)
PEExclXorQ * 0.75 > LTGrthMean // Price/Earnings * 0.75 > long term EPS growth
Insider Buying
InsNetShrPurch * price > 0.5 // 500k net (buys - sells) insider buying last 6 months
Example Screen
You can build this in 5-15 minutes!
mktcap > 1000 // —> Market Cap > 1 Billion
sma(50) > sma(150) // —> stock in some kind of uptrend
FRank("ATR(20,0)",#subindustry,#DESC, #ExclNA) > 85 // —> subindustry that are in the top 15% of Average True Range last 20 Days, stuff that moves!
AvgDailyTot(20) > 5000000 // —> Total Dollar Volume Average last 20 Days above 5 Million $
Do not forget the QuickRank —>
And run the backtest:
All right, here you have it :-)
All the best and best regards.
Andreas
____________________________________________
The information on from Andreas Himmelreich / QuantStrike and this video / blog is for information and discussion purposes only. It does not constitute a recommendation to purchase or sell any financial instruments or other products. Investment decisions should not be made with this video, and one should consider the investment objectives or financial situation of any person or institution.
Investors should obtain advice based on their own individual circumstances from their own tax, financial, legal and other advisers about the risks and merits of any transaction before making an investment decision, and only make such decisions based on the investor’s own objectives, experience, and resources.
The information from Andreas Himmelreich / QuantStrike and this video / blog is based on generally available and paid information and, although obtained from sources believed to be reliable, its accuracy and completeness cannot be assured, and such information may be incomplete or condensed. All performance results are hypothetical and the result of back testing only. Out-of-sample performance may be different. No claim is made about future performance.
Investments in financial instruments or other products carry significant risk, including the possible total loss of the principal amount invested. Andreas Himmelreich / QuantStrike and this video / Blog do not purport to identify all the risks or material considerations which may be associated with entering any transaction. Andreas Himmelreich / QuantStrike and this video / blog accepts no liability for any loss (whether direct, indirect or consequential) that may arise from any use of the information contained in or derived from Andreas Himmelreich / QuantStrike and this video / blog.
this was so good, I had to resubscribe.
I guess I look to you for real-world usage of P123, and you do not disappoint ;-)
Have you looked into the P123 AI Factor feature yet. I do not have an Ultimate sub, but if you are making good use of it, I might try. Thanks