Commit Graph

643 Commits

Author SHA1 Message Date
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
Jared 92ff37f1c9 Merge pull request #3402 from gsalaz98/feature-3401-improve-tradingeconomics-downloaders
Improves TradingEconomics Downloaders
2019-07-24 13:35:19 -07:00
Gerardo Salazar 920010b242 Add rategate to all requests so that we don't run over rate limits
Improve logging across all TradingEconomics Downloaders

Add retries to HTTP requests due to occassional failure

Added skipping of duplicates, skipping of
fields with no actual value, temp file writing, temp file moving

Write to proper output directory

Update data directory structure

Update GetSource in BaseData implementation for TradingEconomics

Parallelize data processing and writing to disk
2019-07-16 12:02:47 -07:00
Gerardo Salazar a9a11fc848 Address Mike's review 2019-07-09 17:46:15 -07:00
Gerardo Salazar 4a83793067 Address review 2019-07-09 17:46:15 -07:00
Gerardo Salazar d5e148b05c Adds Psychsignal data converter and custom data implementation 2019-07-09 17:45:31 -07:00
AlexCatarino 7b81f1a64d Implements Estimize Equity Endpoints Alternative Data
- Release: Financial releases for the specified company
- Estimate: Financial estimates for the specified company
- Consensus: Consensus of the specified release

For each equity endpoint, we create a `BaseData`, a Downloader and add unit tests.
2019-06-21 13:14:47 +01:00
Jared e7b8ba4dee Merge pull request #3268 from AlexCatarino/feature-3200-tradingeconomics
Implements Trading Economics Data
2019-06-20 13:33:51 -07:00
Jared 2eeb718c72 Merge pull request #3325 from gsalaz98/bug-3324-fix-failing-sec-report-deserialization-null-value-formercompanies
Fix Handling of Potential Null Values In SEC Report Submissions
2019-06-20 12:09:53 -07:00
AlexCatarino 66a0c7377d Addresses Reviews
- Changes the destination folder
- Remove Symbol converter
- Refactors Get method to return `Task<string>`
  - Since `HttpRequester` returns `Task<string>`, it makes more sense to pass this result than returning a `IEnumerable<string>`.
2019-06-20 10:35:56 +01:00
AlexCatarino 6ce48315a6 Implements Trading Economics Data Downloader
Implements an interface for all Trading Economics Data
- Adds Trading Economics Calendar Downloader and program to be used in the Toolbox.
- Adds Trading Economics Indicators Downloader and program to be used in the Toolbox.
- Adds Trading Economics Earnings Downloader and program to be used in the Toolbox.
2019-06-20 10:34:01 +01:00
Gerardo Salazar 7ed94c0a35 Update SECDataConverter to not write null values
Update SECReport* to ignore null values
2019-06-19 14:44:48 -07:00
Gerardo Salazar a04d8dc0ab Fix potential null value in field FormerCompanies
Update data to reflect changes

Add missing AAPL data point we originally intended to include
2019-06-19 11:09:47 -07:00
Jared 40da80357b Merge pull request #3314 from QuantConnect/bug-3287-universe-selection-schedule
Adding PredicateTimeProvider for live mode
2019-06-19 10:58:26 -07:00
Gerardo Salazar ff6d1a814f Fix issue where SECDataConverter would fatally fail 2019-06-18 17:54:33 -07:00
Martin Molinero e8660d9f52 Address reviews 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
Gerardo Salazar 5a304a4cb5 Change path of alternative data folder
Delete converter because an existing utility already existed

Moved code from factory to converter class as statics

Add rankandfile as a CIK to ticker mapping source
2019-06-17 16:45:54 -07:00
Gerardo Salazar 3c04d922c2 Address reviews 2019-06-17 16:45:53 -07:00
Gerardo Salazar 2ad1f19f85 Implements Sec Custom Data, ToolBox Application, and Sample Algorithm 2019-06-17 16:45:53 -07:00
Jared ac0de6b466 Merge pull request #3303 from Martin-Molinero/performance-3302-mapfile-factorfile-data-feed-stack-resolution
MapFile and FactorFile data feed stack resolution
2019-06-13 16:37:36 -07:00
Martin Molinero d9e407b2f4 Fix quandl data source 2019-06-13 18:43:58 -03:00
Jared Broad 4c81aebe1e Revert FxcmVolume remove 2019-06-12 16:49:33 -07:00
Jared 04d4557558 Merge pull request #3305 from QuantConnect/bug-quandl-proxy
Update Quandl.cs
2019-06-12 16:01:30 -07:00
Jared 8a832047e2 Delete FxcmVolume.cs 2019-06-12 16:00:07 -07:00
Jack Simonson 0b5b4dacbe Update Quandl.cs
Cleaned up URL
2019-06-12 15:59:48 -07: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
Jack Simonson 4ee5855c94 Update Quandl.cs
Change source url to Quandl's direct API URL
2019-06-11 16:45:07 -07:00
Martin Molinero 1581801f9b Address reviews 2019-06-11 12:01:57 -03:00
Martin Molinero ec1d410907 Performance improvements
- `SecurityIdentifier` will calculate `StrikePrice` just once. Replacing
`!=` for a direct call to `Equals()` preventing unnecessary checks.
- Slightly improving Linq queries at `OptionFilterUniverse`
- Replace `OpenReader().CopyTo` for `Extract(stream)` avoids copying the
data twice.
- Replace `DateTime.Now` for `DateTime.UtcNow`
2019-06-10 22:40:19 -03:00
Jared adf4dba49b Merge pull request #3271 from QuantConnect/overall-performance-improvements-v2
More Overall performance improvements
2019-06-07 07:08:48 -07:00
Juan José D'Ambrosio 5caf86c4be Fix bad naming in MorningStart Industry name 2019-06-06 22:11:09 +00:00
Martin Molinero 08b72c5907 Overall performance improvements v2
- Adding `LazyToUpper()` implementation, that will avoid the call to
`ToUpper` if the string is already upper.
- Reduce the timezone conversions at `Time.EachTradeableDayInTimeZone`
- `TotalPortfolioValue` will iterate over all securities once
- Adding new `SecurityIdentifier` cache, significant impact for
algorithms using coarse/fine data
2019-06-05 17:06:59 -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
Jared cd80c70775 Merge pull request #2868 from gsalaz98/feature-2859-rdg-delistings-mappings-splits-dividends-generator
RandomDataGenerator Mapping, Delisting, Splits, and Dividends Generator
2019-05-14 15:46:24 -07:00
Alexandre Catarino 3f00762bfd Adds Custom Data from US Energy Information Administration (eia.gov) (#3136)
New custom data class USEnergyInformation with new demonstration algorithms, the updated config file for users to set their EIA token.

Adds `CloseTime` to represent the time that the data period end. `EndTime` represents, in turn, the time the data is emitted. There is an offset between `CloseTime` and `EndTime` that is defined by the difference between the last bar as emitted and its time. 

In live mode, if the `USEnergyInformation.Reader` returns null, the `CollectionSubscriptionDataSourceReader.Read` method will pull for new data constantly. Therefore it should return an empty `BaseDataCollection` object.
2019-04-30 17:22:11 -07:00
Juan José D'Ambrosio 0e083e4183 Implement helper classes for MorningStar AssetClassification package 2019-04-22 22:09:21 +00:00
Martin Molinero c39638668c Overall performance improvements
- `FactorFile` will keep an ordered reversed list with the dates.
Calling `Reverse()` on the `SortedList` is expensive.
- `MapFiles` will keep first and last date, so we don't need to call
`First()` and `Last()` multiple times.
- `Liquidate` will go through all the algorithms securities only if
necessary
- `TradeBar` parsing will not call `new T` for pure `TradeBar` which is
expensive
- Removing `Lazy` hash code and security type for the
`SecurityIdentifier`, replacing for direct initialization. Accessing the
`Lazy` value adds an overhead.
- Replacing `Enum` to string for hardcoded switch statement. `Enum.ToString` is expensive.
- `DataManager` will be lazy for counting the subscriptions for
determining if its above the limit
- Adding `AlgorithmSecurityValuesProvider.GetAllValues()`, removes the
need to fetch all the security keys twice.
- During universe selection, will not try to re add already added symbol
2019-04-22 10:47:27 -03:00
Jared 0c20ca870b Merge pull request #3088 from AlexCatarino/feauture-3082-universe-settings-data-normalization-mode
Implements UniverseSettings.DataNormalizationMode
2019-04-17 15:44:14 -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
AlexCatarino c151fd51de Adds Missing Argument in OptionChainUniverse and Universe 2019-04-17 15:18:04 +01:00
AlexCatarino e92a40192d Implements UniverseSettings.DataNormalizationMode
Implements `DataNormalizationMode` field in `UniverseSettings` to enable the settings of a desired `DataNormalizationMode` to the securities that are chosen in Universe Selection.
2019-04-17 15:18:03 +01:00
Martin Molinero b7930aff67 Performance improvements
- Using `Aggregate(lambda)` vs `Sum(lambda)` since the later is slower
due to performing an extra `Select`
- For `QCAlgorithm.Framework.OnFrameworkData()` will avoid calling
`ToArray()` on empty `Enumerables` due to its cost * the number of
calls. If the `Enumerable` is the empty instance, which is static,
will create a new empty array and return it instead.
- Replacing `SecurityIdentifier` `SecurityType` and `GetHashCode`
implementations for `Lazy` versions, that are performed just once, since
these values do not change and are used multiple times.
- For the different `DataDictionary<T>` implementations adding `this[
Symbol] get; set` since existing overload `this [string]` produces an
extra round operations `Symbol->string->Symbol` with a significant
impact.
- Adding `PortfolioTargetCollection.AddRange()` overload using an array
to avoid unnecessary convertions.
2019-04-11 19:01:27 -03:00
Jared b331fad160 Merge pull request #3043 from AlexCatarino/feature-3042-pyobject-scheduled-universe
Adds Constructor Overload with PyObject to ScheduledUniverse
2019-04-10 16:49:03 -07:00
Gerardo Salazar f9336514fd Parameterize probability of IPO, splits, dividends, renames, and
dividends every quarter.

Check for existing directory before attempting to write in MapFile
2019-04-09 15:01:55 -07:00
AlexCatarino e4e3ee6524 Adds Constructor Overload with PyObject to ScheduledUniverse
Adds constructor overload that accepts a PyObject representing a `Func<DateTime, Symbol[]>` object to `ScheduledUniverse`. With this overload, we are able to create a `ScheduledUniverse` with a selector defined in a python script.
2019-04-08 22:10:36 +01:00
AlexCatarino 0202df35f4 Replaces Enum CalendarType for Static Class with the Same Name
Replaces Enum `CalendarType` for static class with the same name. This class defines two properties (`Weekly` and `Monthly`) that can be used to define the previous calendar date (Monday or 1st of current month) which will correspont to the `Time` of a `IBaseData` object.

Refactor `PeriodCountConsolidatorBase` to define use `GetRoundedBarTime` based on a period specification that depends on the constructor overload: `integer`, `TimeSpan` or `Func<DateTime, CalendarInfo>`. The last one can be set with the `CalendarType` properties.
2019-04-08 22:10:04 +01:00
AlexCatarino 5314e7426d Implements Calendar (Weekly/Monthly) Consolidator
Implements consolidators that group bars by a calendar unit (week or month).
2019-04-08 22:10:04 +01:00
Martin Molinero 91f19f781d Implement AddUniverseSelectionModel
- Implementing `QCAlgorithm.AddUniverseSelectionModel`
- Adding C#/Py regression algorithms using the new API
- Modifying `ManualUniverSelectionModels` symbol, adding hash of
the selected `Symbol.Values`
- Modifying `Coarse` and `Fine` symbol, adding random GUID
- Adding `NullUniverseSelectionModel`
2019-04-08 16:58:42 -03:00
Gerardo Salazar 645bb031b3 Improved random generation to more closely match sample factor files
Fixed bug where factor file reference price output had very high
precision

Fixed bug where map file had a useless entry before the final line if
the asset was not delisted

Fixed bug where program would crash because of NextPrice reaching its
maximum attempts. Fixed by removing call to NextPrice and using another
generation method.
2019-04-02 21:25:10 -07:00