Commit Graph

26 Commits

Author SHA1 Message Date
Martin Molinero a92bee5bf1 Fix OnEndOfDay not fired
- Adding `IRealTimeHandler.OnSecurityChanged()` will be used to update
the `OnEndOfDay` security related scheduled events
- Adding `BaseRealTimeHandler.cs` to reduce code duplication in the
`Backtesting` and `LiveTrading` `RealTimeHandlers`
- Adding CSharp and Python regression tests
- Deprecating `OnEndOfDay()` callback because of two reasons, mainly
because Python does not support two methods with the same name, but also
because different assets have different market close times.
- `ScheduledEvents` set at the same time will now be deterministic
2019-06-20 17:35:28 -03:00
Stefano Raggi 513ef5d581 Fix DataManager live mode flag and failing unit tests 2019-04-29 15:26:50 +02:00
Martin Molinero cfa08a11fb Address reviews
- Removing `using QCAlgorithmFramework = QuantConnect.Algorithm.QCAlgorithm`
- Removing `QCAlgorithmFrameworkBridge`
- Removing `IsFrameworkAlgorithm`
- Making `EmitInsightBasedOnFill` private. Adding new
`IOrderEventProvider` exposing an `event` to which `QCAlgorithm` will
subscribe.
- `AccountType.Cash` algorithms will be allowed to manually trade and
emight insights manually or with alpha model.
2019-04-03 21:55:44 -03:00
Martin Molinero af8e6bf85c Fix starting capital for non usd cash
- Moving `UniverseSelection.EnsureCurrencyDataFeeds` call into the
`IResultHandler` implementation through usage of the new `SetupHandlerHelper`
class, that will also set an initial conversion rate if none present.
- Adding regression test, that reproduces original issue
2018-12-19 16:15:28 -03:00
Martin Molinero 251071ee73 Remove Security from Subscription
- Removing unneeded `CashBook` instance to create a new `TimeSlice`
- Adding new `TimeSliceFactory`, an instance base class that will
provide methods to create a new `TimeSlice`. Will own the `DateTimeZone`
property.
- Adding new `ISecurityPrice` and `IOptionPrice` that will provide a
reduced interface for accessing price properties and methods used when
creating a new `TimeSlice`
2018-11-14 18:28:18 -03:00
Martin Molinero f1ecfd5784 Move DataManager in front of DataFeed
- Completly move `DataManager` in front of `DataFeed`. Specifically
`AddSubscription()` and `RemoveSubscription()` implementations. Also
removing IDataFeed.Subscriptions
2018-10-29 16:13:27 -03:00
Martin Molinero 9bdf702c41 Creating new Synchronizer - TimeSlice streamer
- Creating new `Synchronizer` which will consolidate and combine `TimeSlice`
streaming for both live and backtests modes. Will live in front of the
`DataManager`
- `SubscriptionSynchronizer` will be the `FrontierTimeProvider` exposed,
and owned, by the new `Synchronizer`
- Updating existing tests
2018-10-19 15:36:08 -03:00
Martin Molinero a288648929 Creating new ISecurityService
- Adding new ISecurityService and its implementation SecurityService.
Expose by SecurityManager.
This class will expose a method for creating new securities. The
SecurityManager is exposing this new interface, calling _securityService
internally, so Future/OptionUniverseSelectionModel.cs can use it
- Replacing all usages of SecurityManager.CreateSecurity for new
ISecurityService
- Modifying `Cash.cs` and `CashBook.cs` `EnsureCurrencyDataFeeds()` to
return newly added `SubscriptionDataConfig` instead of `Security`. This
will avoid using `Security.Subscriptions` at call site.
- Moving old SecurityManager.CreateSecurity into new
SecurityServiceTests.cs
2018-10-18 16:25:32 -03:00
Michael Handschuh 1687f53a14 Fix duplicate application of diviends in live paper
This bug was only recently introduced via PR #2592. The issue is that the
PaperBrokerage's Scan method is invoked twice per time loop. This change
adds tracking to ensure we only invoke the dividend detection/application
on the first Scan invocation of a time loop. Tests added to confirm behavior.
2018-10-11 12:31:26 -04:00
Martin Molinero 008c9ca873 Fixing unit tests 2018-09-28 15:44:05 -03:00
Martin Molinero 1c7e519776 Rebase from master - Refactor to reduce coupling
Refactoring previous commit so DataManager only keeps and receives a
reference to IAlgorithmSettigs, with the objective of reducing tight
coupling

Note: Investigate if IAlgorithmSettings.DataSubscriptionLimit should limit subscriptions or unique securities.
Today its using SubscriptionManagerSubscriptions.Where(x => !x.Symbol.IsCanonical()).DistinctBy(x => x.Symbol.Value).Count() @DataManager
2018-09-26 16:19:59 -03:00
Martin Molinero 94449149b9 DataManager receives UniverseSelection instance
DataManager will now receive UniverseSelection instance as a constructor
parameter. With the objective of avoiding tight coupling.
2018-09-26 10:00:10 -03:00
Martin Molinero 1997197f47 Fix failing unit tests 2018-09-18 12:10:42 -03:00
Martin Molinero 953cc48997 Addressing reviews. Some renames and setting new interface IDataFeedSubscriptionManager for future work 2018-08-31 16:06:41 -03:00
Martin Molinero 41873b2315 Fixing unit tests 2018-08-31 16:06:41 -03:00
Jared ccf490a593 Merge pull request #2167 from QuantConnect/feature-lean-manager-begin-end
Add OnAlgorithmStart/End methods to ILeanManager
2018-06-29 09:57:48 -04:00
Martin Molinero f38431446d Fixing null pointer exception at brokeragetransactionhelper 2018-06-27 18:10:04 -03:00
Stefano Raggi 36122f0829 Add OnAlgorithmStart/End methods to ILeanManager 2018-06-27 00:17:32 +02:00
Martin Molinero 82c2532a31 Improve performance for backtests with a large amount of trades 2018-06-21 16:59:29 -03:00
Michael Handschuh a5179bc6ab Add universe data to TimeSlice
Pipes universe data from the data feed, through TimeSlice.Create and adds
TimeSlice.UniverseData dictionary property for read access from the algo
manager, where the data will be placed onto the correct security object.
2018-04-24 18:23:00 -04:00
Michael Handschuh 78fcc2e4ef Call algorithm.PostInitialize in benchmark tests 2018-03-26 11:35:51 -04:00
Stefano Raggi 91ba63529b Remove Guid string from ScheduledEvent.Name
Fixes #1674
2018-03-07 21:33:33 +01:00
Michael 32307598e7 Merge pull request #1551 from QuantConnect/refactor-cash-conversion-updates
Remove cash updates from time slice
2018-02-12 11:03:29 -05:00
Michael Handschuh f490fd4400 Remove cash updates from time slice
Instead of tracking just the security's symbol in the cash object we're now
maintaining a reference to the actual security object. This removes the need
to worry about cash update data in the time slice create method.
2018-02-09 14:51:47 -05:00
Michael Handschuh e8fa49e8ce Add benchmark for subscription synchronizer
If we add additional sychronizer implementations, this test can easily be extended to
accommodate those new implementations.
2018-02-09 12:55:43 -05:00
Michael Handschuh c904ce5ebe Add AlgorithmManager benchmark test 2018-02-06 18:44:01 -05:00