Updates python framework to support python datetime

Updates nuget package to support conversion from C# DateTime to python datetime.
Updates algorithms to reflect this change.
This commit is contained in:
AlexCatarino
2017-05-23 13:40:26 +01:00
parent 326e80415e
commit 18d83fb8ec
33 changed files with 142 additions and 173 deletions
+2 -1
View File
@@ -20,6 +20,7 @@ from System import *
from QuantConnect import *
from QuantConnect.Algorithm import *
from QuantConnect.Data import *
from datetime import timedelta
class ScheduledEventsAlgorithm(QCAlgorithm):
@@ -59,7 +60,7 @@ class ScheduledEventsAlgorithm(QCAlgorithm):
# the scheduling methods return the ScheduledEvent object which can be used for other things here I set
# the event up to check the portfolio value every 10 minutes, and liquidate if we have too many losses
self.Schedule.On(self.DateRules.EveryDay(), self.TimeRules.Every(TimeSpan.FromMinutes(10)), Action(self.LiquidateUnrealizedLosses))
self.Schedule.On(self.DateRules.EveryDay(), self.TimeRules.Every(timedelta(minutes=10)), Action(self.LiquidateUnrealizedLosses))
# schedule an event to fire at the beginning of the month, the symbol is optional
# if specified, it will fire the first trading day for that symbol of the month,