Hi there,
I am using ScheduledUniverseSelectionModel - and trying to call it just before market open at 9:31 AM EST on weekdays.
However, when I log self.Time from the callback method, it always shows 19:31:00+00:00 (which is 7:31 PM).
Also, this universe gets populated for the previous day (not on the trading day).
This is how my initialization looks liks
self.SetUniverseSelection(ScheduledUniverseSelectionModel(
self.DateRules.Every([DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday]),
#self.TimeRules.AfterMarketOpen("SPY", 1),
self.TimeRules.At(9, 31),
self.GetSymbolsFromChartMill
))
self.Schedule.On(
self.DateRules.EveryDay("SPY"),
self.TimeRules.AfterMarketOpen("SPY", 5),
Action(self.LongShortStrategy)
)
And here are relevant logs to showcase the problem
- Fetching data from ChartMill : 2017-01-03 19:31:00+00:00
- Executing LongShortStrategy : 2017-01-04 09:35:00
(notice the 19:31 and difference in dates)
What am I doing wrong?
Thanks!
Mayank Jain
All I am trying to do is get some symbols from ChartMill (a stock scanner service) just after the market opens & then trade them.
Meghdoot dhameliya
Mayank Jain have you set the correct timezone in algorithm?
self.SetTimeZone("Europe/London")Mayank Jain
Thanks Meghdoot, will check and confirm.
Cheers!
Alexandre Catarino
Hi Mayank Jain
We created a GitHub issue to address the issue since this is not the expected behavior.
When we set up the ScheduleUniverseSelection for 9:31 using the TimeRules.At, the universe selector method should be triggered at 14:31 UTC, not 19:31 UTC.
Mayank Jain
Thanks Alexandre Catarino - looking forward to the fix.
Cheers!
Mayank Jain
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!