Hi Everyone,
Here is the code from my latest algorithmic trading video. This strategy is an example of an earnings reversal bot, for all the details make sure to check out the video. If you have any questions or comments, definitely let me know.
Cheers,
Louis
Jared Broad
Great work Louis!
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.
Erol Aspromatis
Cool algo Louis. Â I'm thinking about including consensus earnings estimate data to the algo to see if I can improve on your performance. Â Building on your hypothesis, companies with bigger earnings misses relative to consensus should see a more negative impact. Â However, if the miss was driven by one-time items, perhaps it would bounce back quicker.
It looks like the Morningstar Fundemtal data captures unusual items, anyone know of a good 'free' data source for consensus earnings estimate data? Â Yahoo has it, perhpas someone has some code to scape it historically?
Chris J.T. Auld
Qandl has Zacks' Consensus data.... free it is not... cheap it is neither... Gonna keep looking for some other options...
Ernest Shaggleford
Interesting, although I'd suggest an algo that trades the post ER move using options.
One challenge is that the EarningReports.FileDate is only available after the earnings have been released so this may not be usable depending on the delay of the availability of the data. There are other sources but not free.
Andres Arizpe
Hi Louis,
I love your training courses but I've been stumped on this one for the last week with an error between 'EarningReportsFileDate' and 'datetime.timedelta' objects not being the same type.Â
I cloned your algo BTW so it's exactly as it is.
Here is the complete message:
Runtime Error: Trying to perform a summation, subtraction, multiplication or division between 'EarningReportsFileDate' and 'datetime.timedelta' objects throws a TypeError exception. To prevent the exception, ensure that both values share the same type.
  at <listcomp>
    fine = [x for x at fine if self.Time == x.EarningReports.FileDate + timedelta(days=self.daysSinceEarnings)]
 in main.py: line 40
Please help me figure out why this is happening now.
Cheers,
Andres
Andres Arizpe
Found it was missing the timeperiod at the end of the FileDate.
Line 59 shoule be:
fine = [x for x in fine if self.Time == x.EarningReports.FileDate.ThreeMonths +timedelta(days=self.daysSinceEarnings) ]
Its working now.
Cheers,
AA
Louis
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!