Commit Graph

35 Commits

Author SHA1 Message Date
Martin Molinero e1482c50c2 Validate TimeRules.Every TimeSpan
- Will verify `TimeSpan` is not zero or less, adding unit tests.
2019-06-28 13:02:21 -07:00
AlexCatarino 1883bed1a7 Adds an Overload to DateRules.Every method that Accepts a Single DayOfWeek Object 2019-02-26 22:28:43 +00:00
Martin Molinero defe063647 Adding ToString for ScheduledEvent 2018-12-18 16:58:27 -03:00
AlexCatarino 88b97bd8e4 Adds overload to ScheduleManager.On method that accepts a PyObject parameter
Adding an overload to `ScheduleManager.On` method that accepts a `PyObject` parameter enables python algorithm to pass a method as parameter directly.
- Fixes `ScheduleEventsAlgorithm` to show the new feature in action.
2018-05-07 12:05:00 +01:00
Stefano Raggi 91ba63529b Remove Guid string from ScheduledEvent.Name
Fixes #1674
2018-03-07 21:33:33 +01:00
Michael Handschuh c8f20b7756 Add IExceptionProjection infrastructure
Provides a sample implementation of IExceptionProjection that
prepends the scheduld event name to the error message

 #1630
2018-03-01 12:36:00 -05:00
AlexCatarino 136ca90f6c Fixes message input in ScheduledEventException instance creation
Passes exception to Log.Error in RealTimeHandlers in order to include stack information
2018-02-20 17:39:03 +00:00
AlexCatarino af7b592dda Passes inner exception to ScheduleEvent exception
Without the inner exception, information on the user exception is lost. In python algorithm, the stack trace is completely lost.
Removes ScheduledEventExceptionMessage property as it is redundant to Message property inherited from parent class.
2018-02-19 19:11:55 +00:00
Stefano Raggi a8fc134c57 Support for scheduled events with same names or date/time rules
Fixes #1061
2018-02-05 11:53:09 +01:00
Stefano Raggi df925c4e3c Add new scheduler DateRules
- MonthEnd(): fires on the last day of each month
- MonthEnd(Symbol): fires on the last tradeable date for the specified symbol of each month
- WeekStart(): fires on Monday each week
- WeekStart(Symbol): fires on the first tradeable date for the specified symbol of each week
- WeekEnd(): fires on Friday each week
- WeekEnd(Symbol): fire on the last tradeable date for the specified symbol of each week
2017-12-12 12:32:06 +01:00
Andrew 2c156ce04a Add schedule event exception logic to BacktestingRealTimeHandler
Catching the exception in BacktestingRealTimeHandler prevents unhandled errors in backtesting and provides more specific logging to make debugging easier for users
2017-09-25 11:04:13 -04:00
Andrew be986a5a8f End execution of Lean if an error in a scheduled event is thrown 2017-09-25 09:51:45 -04:00
Andrew eabd36966d Added ScheduledEventException
These changes fix a bug so that when an exception is thrown with the LiveTradingResultHandler, the error is handled and the next scheduled event can happen as scheduled.
2017-09-22 18:23:15 -04:00
jaredbroad 77a511f99c Remove associated tests for negative time rules 2017-02-10 11:29:34 -05:00
jaredbroad 6043d40ebd Revert negative only time difference values 2017-02-10 09:01:24 -05:00
Jared 04de92dae5 Merge pull request #736 from quant1729/master-scheduler-trace-feature
Added simple event acknowledgement trace lines to ScheduleManager cla…
2017-02-08 13:05:53 -05:00
quant1729 c7ff07d7d5 Added simple event acknowledgement trace lines to ScheduleManager class. Tested using ScheduledEventsAlgorithm code. 2017-02-08 23:15:06 +08:00
quant1729 ecb95bb59c Changed time rules to explicitly require a user to specify only positive numbers in offsets for both live and backtest modes. Tests. 2017-02-08 18:04:56 +08:00
Stefano Raggi 4152ddbe17 Fixed typo in TimeRules.BeforeMarketClose parameter name 2016-03-13 21:11:06 +01:00
Stefano Raggi 1e7d8f47ee Fixed XML comments compiler warnings 2015-12-06 16:26:48 +01:00
snugs 35ce0342f9 Tidy up some usages of Symbol.Value/ToString
Includes other small changes from review
2015-11-19 16:23:41 -05:00
snugs 9e660ffcbe Remove usages of Symbol implicits from non-algorithm projects 2015-11-18 18:15:31 -05:00
snugs 7b6c82841f Initial implementation of SecurityIdentifier 2015-11-12 13:55:42 -05:00
snugs c67ff638f4 Renames Symbol.SID to Symbol.Permtick
Coming soon we'll have a full SID system, so renames to make backwards compatibility easier
2015-09-20 23:14:53 -04:00
snugs e1938baafe Clean up using directives 2015-09-01 22:17:35 -04:00
snugs df79ce30c2 Adds the Symbol type
This includes updating all usages of symbol as a security identifier to use the new type.
The type includes a unique field, SID, as well as the current ticker's value. This allows
for consistent addressability while also allowing the ticker to evolve over time with the
mapping changes.

Effort was made to maintain compile and runtime backwards compatibility.
2015-09-01 22:17:10 -04:00
snugs 776a1e59a7 Adds more Date/Time rules 2015-08-20 18:43:37 -04:00
snugs 293fc1224a Improves ScheduledEvent usability
Adds Enabled flag to turn event on/off
Adds EventFired event for runtime binding
Schedule builder methods now return ScheduledEvent instance
2015-08-20 18:43:07 -04:00
snugs 66604a698c Change visibility of some members in ScheduledEvent
Preparation for adding user facing API methods/properties/events
2015-08-20 17:14:28 -04:00
snugs 3e665def67 Fixes bug in SkipEventsUntil, always skipped first event 2015-08-20 14:54:51 -04:00
snugs 33a4db4559 Fixes bug scheduling events on same day 2015-08-20 14:34:13 -04:00
snugs 74d6ab6822 Prevent null ref in ScheduleManager before init 2015-08-20 14:30:22 -04:00
snugs 8380da11cf Adds fluent interface for scheduled events
Algorithms can now use syntax like the following to define events:
Schedule.Event(name).{DateRuleMethod}.{TimeRuleMethod}.Run( lambda )

For example: Schedule.Event(tues).Every(DayOfWeek.Tuesday).AfterMarketOpen(SPY, 20).Run(MyTuesdayHandler);
2015-08-11 10:51:58 -04:00
snugs b68a8be848 Move Date and Time rules to ScheduleManager 2015-08-10 11:38:48 -04:00
snugs 730430b1bb Adds scheduling feature
Adds the ScheduleManager which allows an algorithm to add/remove scheduled events
Check out the ScheduledEventsAlgorithm for syntax
ScheduledEvents are at their core an IEnumerator<DateTime> that defines the event times coupled with a callback
IDateRule defines dates for events
ITimeRule defines time(s) on a given date for events
2015-08-10 10:56:14 -04:00