Is there a way to get this information? I would want to close out my shorts before this date passes.
QUANTCONNECT COMMUNITY
Is there a way to get this information? I would want to close out my shorts before this date passes.
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.
Michael Handschuh
public void OnData(Dividends data) { // Dividends is a dictionary of Dividend data keyed by symbol }
Matthew Martin
I think one needs this information before the dividend is "paid". Even though (I think) Lean fires this even on the ex-Dividend date and not the true payment date - which is technically incorrect - one still needs to know this information before market open.
TradingDay.EquityDividends might work for the day-of, but I don't think it is implemented.
I am guessing that external data must be used at this point if you want to know the date far in the future.
Â
Derek Melchin
Hi Matthew,
It is correct that EquityDividends is not yet implemented, so external data must be used to utilize the ex-dividend date in a backtest. Refer to our previous thread for more information.
Best,
Derek Melchin
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.
Laurent Crouzet
Hi Derek (and Matthew Martin, and Craig McWilliams!)
I wanted to place this message on the other thread, but it is closed from now on: adding the "ex-dividend date" in QC itself would help us building Alpha with this useful information.
As using daa from other sources is mostly not possible on Alphas, that is a pity we cannot currently use this piece of information, so important to develop sound option strategies.
Hopefully, you will add this soon!Â
Keep up the good work!
Matthew Martin
Hi all,
One other thing I discovered that may be useful to others. It appears to me that the dividend event does fire at midnight of the ex-Dividend date, so in that sense, you can at least have the information before the market open. So you could close positions on open in response, just not days before.
Â
Laurent Crouzet
Yes Matthew, but midnight is too late in the real-world trading (and Alpha Streams): we need to get that piece of information at the very least the day before...
Craig McWilliams
Hi Guys. I've been coding like a maniac.  I have found a source with a REST API. (Would that work in an Alpha?)   It's IEX Cloud.  I'll let you know when I have an implementation.
Derek Melchin
Hi Craig,
Since IEX is a trusted source, it's possible to get this data inside an alpha model. Which product are you trying to use? We may implement it ourselves.
Best,
Derek Melchin
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.
Craig McWilliams
Hi Derek,
That is very good news.  Here is the endpoint: Â
https://iexcloud.io/docs/api/#dividendsI seek to write an app that will take in a list of stock symbols and retrieve the dividend data.  Their documentation is comprehensive and some helper API codes are available as well.
Â
Â
Derek Melchin
Hi Craig,
Thank you for providing the endpoint. To retrieve dividend data from IEX, a paid subscription is required. We will consider building this data source into the LEAN engine.
Best,
Derek Melchin
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.
Gary Rosner
Has any progress been made on incorporating IEX as a data source?
If not, can Craig or anyone provide an example of how to incorporate pulling upcoming Ex-Dividend dates into QC?
Louis McLennan
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!