Tucked away in the Quantacula indicators list is a recent gem, an indicator called FundamentalRatio. This indicator creates a ratio by dividing any two fundamental items and/or price components and applying optional summing and multiplication. In order to see any useful results with FundamentalRatio, you'll first need to enable some fundamental data in Quantacula Studio.
Go to the DataSources view and click the Fundamental Data button to see the available Fundamental Data Sources.
You may see more providers listed here depending on the Extensions you have installed in the platform. For the purposes of this example, select the Q-Premium Fundamentals. This provider contains the quarterly dividend data we'll use. Please note, selecting Fundamental Data Sources will slow down your data access whenever you run a backtest, so use judiciously and turn them off when you don’t need them.
With the Q-Premium Fundamentals selected, if you open a chart you should see any dividends and splits for S&P 500 stocks. Now, find the FundamentalRatio indicator in the Indicators list and drop it onto the chart.
The indicator creates a ratio by dividing one fundamental item or price component (the numerator) by another (the denominator). Let's create an annual dividend yield. This is calculated by dividing annual dividend by price. For our numerator we'll select Dividend, and for our denominator Close (closing price).
Since the QPremium provides quarterly dividends, we need to sum up 4 quarters' worth to get an annual dividend. That’s why we set a value of 4 in the Sum last N Items option. The next parameter, Over N Months, keeps fundamental items only within a 12-month period. This prevents older dividends from contributing to the result. The final parameter, Numerator Multiplier, multiplies the annual dividend by 100 so we wind up with easier to read values like 2.12 instead of 0.212.
Now we see a nice annual dividend plotted in the bottom pane. Here's an example on a chart of Citigroup circa 2000 – 2003.
Looking at the chart, you'll note a stock split on August 23, 2002. The FundamentalRatio indicator uses the stock split information to reverse split the divided data before summing it. This keeps the ratio consistent and prevents distortions from the splits.
There you have it, one flexible indicator that has the option of producing limitless results. As we begin to roll out more fundamental data sources for Quantacula Studio, it will be interesting to see what else we can come up with using this little beauty!