Hi
I noticed that due to the contruction of the scheduled events class any errors that occur in it aren't linked to the particular line where the error qctually ocurred it merely says that it happend in the scheduled event. This makes debugging more complicated situations nightmarish. Fortunately there is the debug messaging and by putting in a few log messages one can sometimes work out the rough region in which the error occured by looking at which log messages never ran. This however is made more difficult by the rate limiting of messages - I'm aware in the docs it says that only identical messages will be rate limited but I am finding that when I try to debug a loop through a large number of pairs where for each message I append the unique pair name string I am still getting the rate limiting. Is there anything that can be done about this as it makes the framework almost unusable for more complicated stratergies?
Alexandre Catarino
Hi Ralph West
Sorry about the wait.
I couldn't reproduce the exception issue. Here is what I did:
class MultidimensionalUncoupledShield(QCAlgorithm): def Initialize(self): self.SetStartDate(2019, 5, 3) symbol = self.AddEquity("SPY").Symbol self.Schedule.On( self.DateRules.EveryDay(symbol), self.TimeRules.AfterMarketOpen(symbol,1), self.Rebalance) def Rebalance(self): x=1/0
and got
Runtime Error: In Scheduled Event 'SPY: EveryDay: SPY: 1 min after MarketOpen', ZeroDivisionError : division by zero at Rebalance in main.py:line 14 :: x=1/0 ZeroDivisionError : division by zero
Do you have a simple example?
The algorithm will get rate limited because of the sheer amount of messages. For debugging, we recommend using the IDE debugging feature instead of intensive logging.
Ralph West
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!