I am newbie learning how to work with QuantConnect.  One of my first things is to learn to run scheduled events.  This is my first attempt.  Any comments or help to solve my issues is greatly appreciated.

Attached backtest will show the following results:

695 | 13:25:18: Launching analysis for 68018fd385ee1bb284ef0050c3a326f0 with LEAN Engine v2.4.0.0.4278 696 | 13:25:28: Method: BeforeMarketOpen Start - 10/10/13 9:00:00:000 697 | 13:25:28: Method: BeforeMarketOpen End - 10/10/13 9:00:00:000 698 | 13:25:28: Method: TimelyCheck Start - 10/10/13 9:31:00:000 699 | 13:25:28: Purchased Stock 700 | 13:25:28: Method: TimelyCheck Start - 10/10/13 11:31:00:000 701 | 13:25:28: Method: TimelyCheck Start - 10/10/13 13:31:00:000 702 | 13:25:28: Method: TimelyCheck Start - 10/10/13 15:31:00:000 703 | 13:25:28: Method: BeforeMarketClose Start - 10/10/13 15:35:00:000 704 | 13:25:29: Algorithm Id:(68018fd385ee1bb284ef0050c3a326f0) completed in 11.21 seconds at 0k data points per second. Processing total of 8 data points.

Questions that I have:

  1. I put a sleep event in BeforeMarketOpen, but I don't see it being applied.  What's going on?
  2. Why is OnEndOfDay not being called?

 

Additionally, if "AddEquity(_spy, Resolution.Hour);" is commented, I get the following error:

715 | 13:30:59: 
During the algorithm initialization, the following exception has occurred:  not found in portfolio. Request this data when initializing the algorith