I'm trying to use an Option strategy example as a basic template, but I'm trying to reference Dividends -- and I have literally copied & pasted from the Dividends example -- and it's saying my dividends are refd before assignment. They arent. Can someone just show me how to reference dividend in ANY way, that would be great.
I can work in C# or Python, just any documentation beyond a picture of the Dividend class would be appreciated.
I also don't have a backtest to post -- if I did I wouldn't be on the damn forum.
Zach Oakes
Okay, solved dividend calculation -- however I'm not finding any way to filter (in universe selection). based on upcoming Ex div Date -- I saw one forum thread but it was unclear really a concrete answer... Is there a way to filter securities based on for ex an Ex Div date within the next 20 days, or something?
sorted( secList, lambda x: x.EvDivDate < timedelta(20)) etc.
Alexandre Catarino
Hi Zach Oakes
QuantConnect doesn't provide upcoming ex-dividend date at the moment, sorry.
We have created a GitHub issue to implement that feature:
Adds Upcoming Dividend/Split Event Information #3755
If you can find an external data source for this information, it can be implemented using the Importing Custom Data feature.
Zach Oakes
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!