Your interactive trading laboratory!
 • 
19 users online

Quantacula Help

How-To
C# API Reference
Extensions
Development Blog
API-Extensions
Indicator Spotlights

QCommunity Extensions
The open-source GitHub repository of source code for the QCommunity Extensions library. Contains indicators and other extensions submitted by the Quantacula Community. Look for QCommunity indicators when you create a Building Block model, mark the "QCommunity" library check box to expose them.

TASC-Extensions
The open-source GitHub repository of source code for the TASCExtensions Quantacula extension. Contains indicators and other extensions adapted from the Traders' Tips articles in Technical Analysis of Stocks & Commodities magazine.
FundamentalRatio Indicator
Published by Q Glitch on 12/9/2018

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.

Fundamentals

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.

Fundamentals

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.

Fundamentals

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!