I am converting my algo from QuantOpian to QuantConnet. I want to convert the  before_trading_start() with the hints from Alexandre Catarino in his post "Migrating from Quantopian to QuantConnect" as follow:

self.Schedule.On(self.DateRules.EveryDay("SPY"), self.TimeRules.AfterMarketOpen(self.spy, -45),        Action(self.EveryDayBeforeMarketOpen))

And I also define another schedule funtion as follow:

self.Schedule.On(self.DateRules.EveryDay("SPY"), self.TimeRules.AfterMarketOpen(self.spy, 90),        
            Action(self.Balance))

But it seems these schedule-functions are not called after the defined TimeRules.

Detail see my attached algo.

What I get are as follow:

2017-01-01 00:00:00 :Launching analysis for fe7941eadeb3a161e0cbd4d1806ce18b with LEAN Engine v2.4.0.1.2105

2017-01-04 00:00:00 :EveryDayBeforeMarketOpen

2017-01-04 00:00:00 :Balance

2017-01-04 00:00:00 :SSO Close:77.03571422000

...

One can see the schedule-function 'EveryDayBeforeMarketOpen' is not called 45minutes before the market open. And the schedule-funciton is not called at 90 minutes after the market open.

 

Have I used the syntatic correctly?