I am trying to create a dividend portfolio with the help of QuantConnect. It is my understanding that I find fundamentals in the FineFundamental data structure, right? Looking there I find for example in the EarningReports for ‘HWM’ (Howmet Aerospace Inc) from 10-31-2022:
EarningReports.DividendPerShare.ThreeMonths = 0.02
EarningReports.DividendPerShare.SixMonths = 0.04
EarningReports.DividendPerShare.NineMonths = 0.06
EarningReports.DividendPerShare.TwelveMonths = 0.04
My goal is to get the annual yield in %.
My questions are:
Am I looking at the right place?
If so, why is the twelve month value inconsistent with the other values?
What is the best way to get a historical annual % dividend yield?
Thanks,
Markus
Mia Alissi
Hello,
Yes, you are correct. The
FineFundamental
data structure is where you can find fundamental data, including dividend information. You can access this data in your algorithm using theFundamentals
property of theEquity
objects in your universe. For example:(Source: QuantConnect Documentation)
Regarding the inconsistency in the twelve-month value, it's important to note that these values represent the dividend per share over different periods of time. The twelve-month value is not necessarily the sum of the three, six, and nine-month values. It represents the dividend per share over the past twelve months. The discrepancy could be due to changes in the company's dividend policy, special dividends, or other factors.
As for calculating the historical annual % dividend yield, you would typically divide the annual dividend payment by the stock's price. However, the extracts provided do not contain specific information on how to calculate this in QuantConnect. You might need to use the
GetFundamental
method to retrieve historical fundamental data and calculate the yield manually. Here's an example of how to use theGetFundamental
method:(Source: QuantConnect Documentation)
Please note that this example retrieves the P/E ratio, not the dividend yield. You would need to replace
"ValuationRatios.PERatio"
with the appropriate field name for the dividend yield.I hope this helps! Let me know if you have any other questions.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Melanie Schiefele
Hi Mia,
Wow, that's what I call a fast answer, and a good one two.
I have just a tiny little question left. Can I use the GetFundamental function also in back-testing? What I see in your answer and in the documentation it is used in QuantBooks.
Thanks,
Markus
Mia Alissi
Hello,
Unfortunately, the
GetFundamental
function is currently only available in the Research Environment, not in the backtesting environment. This is mentioned in the QuantConnect Documentation.However, in the backtesting environment, you can use the
FineFundamental
objects to access fundamental data. This data is available in theCoarse
andFine
selection functions of your algorithm. Here's an example of how to use these functions:(Source: QuantConnect Documentation)
For historical fundamental data, one workaround mentioned in a QuantConnect Forum discussion is to use a rolling window to save the fundamental values.
I hope this helps! Let me know if you have any other questions.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Melanie Schiefele
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!