Hey Quants,I'm relatively new to Quantconnect and come as you might have guessed from the Quantopian community :). When trying out a backtest, every now and then a RuntimeError occurs at special times.
The attached backtest from 2010-today works without problems. If you start the same algorithm for the period 2005-today it aborts July 2006 with this error message:
Runtime Error: In Scheduled Event 'SPY: MonthStart: SPY: 15 min before MarketClose', AttributeError : 'Index' object has no attribute 'levels' AttributeError : 'Index' object has no attribute 'levels'
Stacktrace:
QuantConnect.Scheduling.ScheduledEventException: In Scheduled Event 'SPY: MonthStart: SPY: 15 min before MarketClose', ---> System.Exception: AttributeError : 'Index' object has no attribute 'levels' ---> Python.Runtime.PythonException: AttributeError : 'Index' object has no attribute 'levels'
at Python.Runtime.PyObject.Invoke (Python.Runtime.PyObject[] args) [0x00035] in <c56ab175820d412caf052e079c2ab9ef>:0
at QuantConnect.Scheduling.ScheduleManager+<>c__DisplayClass15_0.<On>b__0 (System.String name, System.DateTime time) [0x00011] in <76bf9fe7f75d4895a52327a40a07b107>:0
at QuantConnect.Scheduling.ScheduledEvent.OnEventFired (System.DateTime triggerTime) [0x00027] in <76bf9fe7f75d4895a52327a40a07b107>:0
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
Do you know any fix to this issue?Or maybe a workaround, to except that particular RuntimeError?
Thank you for your help.
Rainer Gabel
Hey Derek,
thanks for your fast support. Your code upgrade fixed this issue. However running in Jul 2008 there is another error generating endless canceled orders leading to a Backtest Handled Error: You have exceeded maximum number of orders (10000), for unlimited orders upgrade your account.
Would you mind checking this issue too?
Best,
Rainer
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!