Back

Cannot get Dividends to work.

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.

Update Backtest







0

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.


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.

 

 

0

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.

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed