New Volatility Functions and Factors - and more

Dear All,

We released several new Factors and functions. The main area we expanded deals with volatility: we added support for relative volatility which is better suited when comparing size dependent factors.

We added three new ratios to measure a company’s efficiency and profitability which are directly related to their “economic moat” (a term popularized by Warren Buffett).

Lastly we added three additional line item factors, some utility functions and a weekly version of RSI.

Please find details of this release below. We have much more to come including a full suite of regression functions (coming next), and an ambitious foray into AI (coming soon after). Let us know what you think.
The Portfolio123 Team­

Volatility Functions

:arrow_forward:We added the following Standard Deviation (SD) and Relative Standard Deviation (RSD) functions. RSD is a more appropriate way to compare volatilities of certain factors. For example, ranking stocks based on EPS SD alone makes little sense since stocks with fewer shares will have larger EPS’s and larger volatilities; but using RSD normalizes away the share count.

FHistStdDev(“formula”, …)
SD of ‘formula’ sampled multiple times in the past.

FHistRelStdDev(“formula”, …)
RSD of ‘formula’ sampled multiple times in the past.

LoopRelStdDev(“formula(CTR)”, …)
RSD of ‘formula’ sampled multiple times using an offset.

We calculate Relative Standard Deviation as follows: RSD = 100 * (SD/Abs(mean))

:arrow_forward:We added an “annualize” option to these functions


See the full description for more information and the exact formula for each.­

Volatility Factors - Technical

:arrow_forward:We added the following price volatility factors. The volatilities have been annualized to make the factors more comparable.

TRSD1YD: 1 year annualized daily volatility
TRSD30D: 1 month annualized daily volatility
TRSD60D: 2 months annualized daily volatility
TRSD90D: 3 months annualized daily volatility
TRSD3YM: 3 years annualized monthly volatility
TRSD5YM: 5 years annualized monthly volatility
TRSD3YD: 3 years annualized daily volatility
TRSD5YD: 5 years annualized daily volatility

Line Items Factors

:arrow_forward:We added three additional line item factors: two RSD factors , and one growth factor comparing TTM values to those of a quarter earlier.

Evaluates the RSD of the item sampled 10 times in past 5 years

Evaluates the RSD of the item sampled 10 times in past 10 years

Calculates the momentum of TTM vs 1Q ago

See the full description for more information and the exact formula for each.­

New Moat Factors

:arrow_forward:We added three new “economic moat” ratios.

SGA2GP: Selling General and Administrative costs to Gross Profit is a profitability ratio that assesses how much of the net revenues are absorbed by indirect costs. Companies that consistently spend under 30% of their Gross Profit on SG&A have a wide moat, and don’t need to spend a lot on overhead to operate.

DepAmort2GP: Depreciation & Amortization to Gross Profit is an efficiency ratio. When DepAmort is consistently less than 10% of Gross Profit, it’s a sign that the company doesn’t need a lot of capital expenditure assets to maintain its competitive advantage and has a moat.

NI2CapEx: Net income to Capital Expenditures is an efficiency ratio that assesses how much of the company profits are reinvested into capital expenditure. For companies with average to low growth rates, a high Net Income to CapEx indicates that a higher portion of profits can be rewarded to shareholders or used to reduce debt, rather than being tied up to maintain the cash needs of a business.


:arrow_forward:We added the following miscellaneous functions:

RSI_W(weeks, …) : Calculates weekly RSI
IsNeg(A, B): returns B if A is negative
IsNegOrNA(A, B): returns B if A is negative or NA
IsZero(A, B): returns B if A is zero
BetaFunc(period,…) now allows up to 1300 samples for 5Y daily Betas


Nice, TY Marco.

Given that when the SGA2GP denominator is <=0, NAs are reported, I think GP2SGA may produce fewer NA results. Under the ‘Easy to Trade US’ universe, there are 372 companies with GrossProfitTTM<=0 and only 15 with SGandATTM<=0 (as of today).

1 Like

Thanks - this looks really useful!

Thank you. Nice new factors and looking forward to using the new functions!

Excellent, guys!

On a related note, the second parameter to IsNA() should default to 0 because 0 is by far the most common value and it would save me a lot of a lot of typing and simplify my formulas.

Does that make sense to you? It should be a simple tweak.

Can you do it?

It’s this line of reasoning why CapEx2NI was changed to NI2CapEx. The finance guys wanted it. Not sure why they did not push to flip the other two. Now it seems inconsistent. I have to ask them.

But to be honest, I was never fully on board with flipping any of them. These are “moat” factors, i.e companies that have sustainable advantages. A company that loses money has no moat, it will eventually go out of business. The factors you deploy have to make sense with the strategy you are developing.

In any event, we will have a chat about it. Thanks

Sounds good. We’ll try to squeeze it in next release.

1 Like

@WalterW So I spoke with analysts re. SGA2GP , DepAmort2GP and NI2CapEx.

The reason why we flipped only NI2CapEx (from CapEx2NI) is because it’s Net Income. So it’s more like Earnings Yield vs PE. Net income includes all sorts of costs not related to the direct manufacturing and selling of products or services.

For something like Gross Profit to be negative they felt it’s ok, and desirable, to have N/A when GP is in the denominator.

Hope this helps.

I do think that’s a mistake, but a fixable one for the user.

For the ‘Easy to Trade US’ Universe, there are 343 more NAs with GP in the denominator. That’s about 8.5% of the universe. For ranking systems that handles NAs as neutral, that needlessly obfuscates many stocks that would otherwise be ranked near the bottom. If there is a signal there, it’s weakened to some degree.

Thanks for looking into this.