OPEN-SOURCE SCRIPT

Joel Greenblatt Magic Formula

Joel Greenblatt Magic Formula. I always wanted to make this.
The Indicator shows 3 values.
ROC,EY,SUM.

ROC= Return On Capital.
EY=Earnings Yield
SUM= Addition of Two.

Formula:
ROC=EBIT / (Net Working Capital + Net Fixed Assets).
EY = EBIT / Enterprise value
Enterprise Value=(Market value of equity + Net Interest-bearing debt)


To implement the strategy, investors start by identifying a universe of stocks, typically large-cap or mid-cap companies that trade on a major stock exchange. Next, they rank the stocks based on their ROC and EY. The companies with the best combination of these two metrics are considered the best investments (based on this ranking).
For example, a stock that ranks 10th on EY and 99th on ROIC gets a value of 109. The two ranks are simply added together and all stocks are ranked on the sum of the two ranks. The stocks with the lowest values are best.



All credits to "The Little Book That Beats The Market" by Joel Greenblatt

The Magic Formula strategy is a stock selection method popularized by Joel Greenblatt’s book The Little Book That Beats the Market.

It involves ranking companies based on Two factors:
A high return on capital and A high Earnings Yield.
The companies with the best combination of these two metrics are considered the best investments. The strategy aims to find undervalued companies with strong financials that have the potential for high returns over the long term.
EarningsFundamental Analysisfundamental-analysisjoelgreenblattmagicformulaPortfolio managementranking

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Sharpie

Disclaimer