Commit Graph

337 Commits

Author SHA1 Message Date
Jared d09a9caf8b Merge pull request #3434 from QuantConnect/performance-3403-finefundamental-source-resolution-v2
Improve FineFundamental backtesting source resolution performance
2019-07-26 10:19:17 -07:00
Martin Molinero 0ee2102bb1 Fix or ignore failing unit tests 2019-07-26 12:46:02 -03:00
Martin Molinero b6e9498b9e Improve FineFundamental backtesting performance
- Reduce the amount of `Path.Combine()` usages -> it has a peformance
overhead
- Improving `FineFundamentalSubscriptionFactory` GetSource algorithm,
now it will not check if each file exists while finding the appropriate,
since we already iterated the directory before
- `DefaultDataProvider` will not check if file exists since `new
FileStream` performance the same operation internally
2019-07-25 22:35:28 -03:00
Stefano Raggi e9739064e6 Fix LiveEquityDataSynchronizingEnumerator for input data after the current time
Previously the enumerator would get stuck and stop emitting data if one of the underlying enumerators returned a data point with the time greater than the current time. The existing unit test would only emit the first data point for the two underlying streams.

The enumerator has been updated to support data points in the future and the unit test has been extended to assert both data point counts and values.
2019-07-09 16:49:50 +02:00
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
Martin Molinero e8660d9f52 Address reviews 2019-06-17 23:40:56 -03:00
Martin Molinero 760e32cf65 Add unit test for Coarse Scheduled Selection
- New unit test fails in master
- Adjust lower invalid time limit to 5 AM
2019-06-17 23:40:56 -03:00
Martin Molinero 65201cb808 Adding StepTimeProvider for live
- Adding new `StepTimeProvider` that will advance time based on a
desired custom evaluator.
- Live trading `Options`, `Futures` and `Coarse` data will use a
`FrontierAwareEnumerator` + `StepTimeProvider`. This will allow to hold
the selection data until its the desired time
- `Universe.CanRemoveMember` will round the members time in the universe
based on the `UniverseSettings.MinimumTimeInUniverse`
2019-06-17 23:40:55 -03:00
Jared 8cebf10483 Merge pull request #3315 from Martin-Molinero/bug-3273-quandl-unit-test-hangs
Retry file operation in Quandl unit test
2019-06-17 09:18:54 -07:00
Jared ff19bd266c Merge pull request #3312 from QuantConnect/bug-datamanager-remove-utcnow-usage
Remove usage of DateTime.UtcNow in DataManager
2019-06-17 09:15:23 -07:00
Martin Molinero f91fe853e1 Retry unit test file operation 2019-06-17 12:03:10 -03:00
Stefano Raggi 5143645fe6 Fix LiveTradingDataFeed handling of Auxiliary data at Tick resolution 2019-06-14 23:18:17 +02:00
Stefano Raggi c9d8abf30e Add new BrokerageSetupHandler unit test 2019-06-14 22:02:24 +02:00
Martin Molinero 7aafdef827 MapFile and FactorFile data feed resolution
- Moving `MapFile` and `FactorFile` resolution to the data feed stack so
that they do not add a performance overhead to the algorithm thread.
- Create logging string messaged only if required.
- Calculate `FactorFileRow.PriceScaleFactor` the least amount of times
2019-06-12 17:48:47 -03:00
Martin Molinero c38e9bff2d Add try catch in Quandl test
- Adding try catch statement in timer callback for Quandl unit test
2019-06-06 14:01:09 -03:00
Martin Molinero d360ec36ac Address reviews 2019-05-31 18:26:18 -03:00
Martin Molinero 57fbf588fe Download RemoteFile once for backtests
- For backtests download RemoteFile just once
- Live subscriptions and history requests will continue to download the
`RemoteFile` on each request.
- Adding unit tests
2019-05-29 18:38:07 -03:00
Jared 8a95a35d95 Merge pull request #3191 from StefanoRaggi/bug-3190-live-suspicious-tick-filtering
Add Suspicious Tick Filtering in LiveTradingDataFeed
2019-05-29 07:10:07 -07:00
Stefano Raggi ce45493d38 Filter suspicious ticks for tick consolidators in TimeSliceFactory.Create
With subscriptions at non-Tick resolution, suspicious ticks are filtered at the live data feed level for bar aggregations, while at Tick resolution they are never filtered (intentionally).
This change prevents ticks from being added to the consolidator update data, used by the AlgorithmManager to update tick consolidators (and indicators).
2019-05-28 18:29:35 +02:00
Stefano Raggi 1119d79f0e Add Suspicious Tick Filtering in LiveTradingDataFeed 2019-05-28 18:29:35 +02:00
Martin Molinero bb6671b811 Fix tests after RemoteFileSubscriptionStreamReader changes 2019-05-28 13:24:52 -03:00
Jared ac3374f47b Merge pull request #3218 from Martin-Molinero/bug-3156-rest-source-reader-infite-polling
Fix infinite live rest custom data polling
2019-05-22 17:56:42 -07:00
Jared 1d6bbb89e3 Merge pull request #3220 from simonsonjack/feature-delete-dailyfx-class
Delete DailyFx class
2019-05-22 17:39:47 -07:00
Martin Molinero d4a4a992a5 Address reviews 2019-05-22 16:31:17 -03:00
Martin Molinero 35ca60aa31 Fix duplicate OnOrderEvent invoke
- `BacktestingBrokerage.Scan()` is now reentrant and was causing
duplicate processing and events. To solve this updateing the order
status keeped by the brokerage. Adding unit tests
2019-05-22 15:33:09 -03:00
Jack Simonson 543abd77c5 Delete DailyFx class
Deleted DailyFx class and associated references in algorithms and tests
2019-05-22 09:36:19 -07:00
Martin Molinero 7becc869af Fix infinite live custom data polling
- Adding `IStreamReader.RateLimit { get; }` specifying if a stream
reader `ReadLine()` calls should be rate limited by the source readers.
- Adding two failling unit tests in `master`
2019-05-21 16:15:38 -03:00
Jared 2f46e708a1 Merge pull request #3184 from Martin-Molinero/refactor-3183-remove-backtestingtransactionhandler-thread
Removing BacktestingTransactionHandler thread
2019-05-17 07:22:24 -07:00
Martin Molinero 173e5c27cb Reverting unrequired changes 2019-05-16 15:06:27 -03:00
Martin Molinero 72a0d8d2bb Fix custom mocked data
- `CustomMockedFileBaseData` was always incrementing data time in minutes
even if configuration was != Resolution, now it will increment based on
the configuration.increment
2019-05-16 14:52:16 -03:00
Martin Molinero 7f12cbb901 Addressing reviews 2019-05-15 18:56:08 -03:00
Stefano Raggi f03d0389ee Fix failing LiveTradingDataFeed unit tests
- In some tests SymbolCache.GetSymbol was being called before AddData, throwing an exception when launched as single tests.
- HandlesManyCustomDataSubscriptions was failing both locally and in Travis (only occasionally). This behavior started since #3040 was merged (LiveSynchronizer is now using a 500ms timeout for the reset event) and the asserts have been updated to reflect this.
2019-05-14 18:44:57 +02:00
Martin Molinero f976ffa099 Removing BacktestingTransactionHandler thread
- For backtesting the algorithm thread will sequentially process pending
order requests
   - Adding new non blocking `BusyCollection`
- Updating `UpdateOrderRegressionAlgorithm` that suffered of a race
condition: it supposed `OnOrderEvent` would be called after the call to
`Transactions.AddOrder()` was finished
2019-05-10 16:15:24 -03:00
Stefano Raggi 6e917f97e2 Resolve merge conflicts 2019-05-03 23:45:17 +02:00
Stefano Raggi c818313fb0 Add new LiveTradingDataFee unit test 2019-05-03 23:32:38 +02:00
Jared bcfd0fbae6 Merge pull request #3040 from QuantConnect/bug-live-synchronizer-high-cpu-usage
Reduce CPU Usage in Live Synchronizer
2019-05-03 13:39:23 -07:00
Martin Molinero 0f4327660a Add missing test for IDataCacheProvider.IsDataEphemeral 2019-05-02 11:44:51 -03:00
Stefano Raggi 24165c7b29 Fix time zone bug in FillForwardEnumerator and LiveFillForwardEnumerator (#3132)
* Fix time zone bug in FillForwardEnumerator

* Fix time zone bug in LiveFillForwardEnumerator
2019-04-30 17:22:59 -07:00
Stefano Raggi a5d12ed92d Fix test failing in Travis 2019-04-29 15:26:50 +02:00
Stefano Raggi 7d730f8db7 Improve timing of data available events for LiveSynchronizer 2019-04-29 15:26:50 +02:00
Stefano Raggi 513ef5d581 Fix DataManager live mode flag and failing unit tests 2019-04-29 15:26:50 +02:00
Stefano Raggi 9d930c170e Add new LiveSynchronizer + update live unit tests 2019-04-29 15:16:22 +02:00
Juan José D'Ambrosio 9fe9c59991 Fix asset classification reading bug
Add `AssetClassification` and  `CompanyProfile` properties to  the  FineFundamental object in the `FineFundamentalSubscriptionEnumeratorFactory`
2019-04-24 03:48:55 +00:00
Jared 5986ec2369 Merge pull request #3093 from QuantConnect/bug-3091-statistics-insight-manager-flat-insights
Scoring and statistics will ignore flat insights
2019-04-17 14:17:44 -07:00
Martin Molinero 771256fd2c Fix live coarse data subscription
- When subscribing to `Coarse` data the `LiveTradingDataFeed` will use
the normalized `CoarseFundamental Universe Symbol` for that market ->
not using the random GUID
- Adding unit tests which reproduce issue.
2019-04-17 17:18:33 -03:00
Martin Molinero 938047de47 Will ignore flat insights
- `Flat` insights will be ignored both for scoring (`InsightManager`)
and for statistics (`StatisticsInsightManagerExtension`). Adding unit
tests
2019-04-16 20:39:55 -03:00
Martin Molinero 9cabd32d19 Add AddAlphaModel method 2019-04-04 13:36:07 -03: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 19f1806ddc Address review: readd Framework project 2019-04-03 21:55:43 -03:00
Stefano Raggi 875666f42d Fix date bug in BaseDataCollectionSubscriptionEnumeratorFactory
This bug was causing coarse data to be shifted ahead one day and was introduced in PR #2996
2019-04-02 20:43:23 +02:00