I have taken the BasicTemplate in python and am working on creating a spread trading algo. As far as I can tell, it appears to be working properly -- at the very least, it was running without errors. Then I added a function for OnEndOfDay. Initially, my spread pair was SPY and QQQ. This worked okay. Then I changed to GLD and DGL. Now I get a "Runtime error in SPY.EndOfDay event: TypeError: OnEndOfDay() takes exactly 1 argument (2 given)"
I'm wondering why this has an error associated with SPY as I'm not doing anything with that ticker.
In addition, please add any comments, suggestions, on style or substance.
Ari Pine
I must not have added code appropriately. Here it is.
Alexandre Catarino
SPY is the default benchmark, so it is included to all algorithms.
We are going to look into this issue. Meanwhile you can either sets one the symbols as benchmark or sets a constant:
self.SetBenchmark(self._tkr1) # or self.SetBenchmark(lambda x: 0) # Constant zero as benchmark
Ari Pine
Thanks. I figured it was something like that. It runs as is but I wanted to make sure that I understand what is going on.
Ari Pine
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!