Commit Graph

978 Commits

Author SHA1 Message Date
Gerardo Salazar 7e2b69db98 Update regression tests statistics and trades placed 2019-09-24 10:34:35 -03:00
Gerardo Salazar ba424cd5b6 Fix failing regression algorithm tests - associated issue is #3597 2019-09-24 10:34:35 -03:00
Gerardo Salazar 56462f0283 Address reviews from Mike and Martin
* Added better documentation for AddData methods
* Added new regression algorithms for adding in OnSecuritiesChanged
* Changed regression algorithms to add data that exists
* Styling and logging fixes
2019-09-24 10:34:35 -03:00
Gerardo Salazar 4b0ed03b4f Added new regression algorithms
* Deleted regression algorithms because they tested behavior similar to
other existing regression algorithms
* Fixed new bug in regression algorithm due to AddData changes
* Added unit tests for wrapt version and package existence

* Fix issue where data would be set to raw normalization mode
2019-09-24 10:34:35 -03:00
Gerardo Salazar 9d052afcf3 Work in progress commit
* Added new method for Symbol to allow creation with underlying
* Added new unit tests
* Alter SecurityIdentifier method signature for BaseData
* AddData changes to accept underlying Symbol
* Added AddDataImpl
2019-09-24 10:34:35 -03:00
Gerardo Salazar 48e4d3660a Add unit tests for AddData for changes 2019-09-24 10:34:35 -03:00
Martin Molinero 787c8bd149 Revert collission work around 2019-09-24 10:34:35 -03:00
Michael Handschuh 6362d101c1 Append type to custom data symbol
This is being done in an effort to prevent symbol collisions within the
custom data (SecurityType.Base) namespace. The custom data type's name,
is used for disambiguation. As written, this change will break several
user algorithms that still rely on using the implicit string -> Symbol
lift. Providing this type information is optional an currently only being
used by AddData<T> methods. Other consumers of SecurityType.Base symbols
arn't at risk for collision, such as the UserDefinedUniverse, ScheduledUniverse
and others that are LEAN controlled. In order to maintain backwards compatibility,
the SymbolCache was updated to do a hard search when the requested ticker was
not found, looking for the prefix ('ticker.').

Fixes #3332
2019-09-24 10:34:35 -03:00
Martin Molinero e7ca829a0d PythonNet bump 1.0.5.25 2019-09-23 19:45:46 -03:00
Michael Handschuh 49af364055 Update Algorithm.CSharp to respect CA1304 and CA1305
Updates all occurrences of parsing/ToString-ing to go through the new
StringExtensions methods that use CultureInfo.InvariantCulture

See #3045
2019-09-12 15:30:45 -04:00
Martin Molinero f96cb2a0cf Bump PythonNet to 1.0.5.24 2019-09-10 12:11:42 -03:00
Martin Molinero e396c3ef10 Bump PythonNet to 1.0.5.23 2019-09-05 23:55:30 -03:00
Martin Molinero f00049f709 Bump PythonNet to 1.0.5.22 2019-09-03 16:05:12 -03:00
Jared 5accca2197 Merge pull request #3521 from QuantConnect/feature-3296-add-support-for-custom-data-mapping-v2
Add support for custom data mapping v2
2019-08-21 14:01:04 -07:00
Martin Molinero 24527e0cc2 Address reviews - Renaming 2019-08-21 16:30:03 -03:00
Jared e2883f72c5 Merge pull request #3523 from Martin-Molinero/bug-2381-2260-benchmark-symbol-not-added-to-cache
Benchmark Symbol will not be added to cache
2019-08-21 12:11:15 -07:00
Xin Wei baf2062667 Remove Hard-Coded Token from QuandlImporterAlgorithm
Remove Hard-Coded Token from QuandlImporterAlgorithm
2019-08-20 16:21:35 -07:00
Martin Molinero 6b00a97b0d Address review 2019-08-20 19:22:18 -03:00
Martin Molinero 7cd1c18887 Benchmark Symbol will not be added to cache 2019-08-20 18:42:31 -03:00
Martin Molinero 73d780daae Moving UsesMapFiles to DataType
- Custom data types will know whether or not Lean should use map files
- Updating regression test with sample custom data using map files,
which can run locally
- Adding unit tests for the `SubscriptionDataReaderHistoryProvider`,
checking it mappes equities and options correctly
2019-08-20 17:33:41 -03:00
Gerardo Salazar c25bdc6a07 Address self review and mchandschuh's review 2019-08-20 16:56:02 -03:00
Gerardo Salazar e6a510d803 Add Mapfile support for custom data sources 2019-08-20 16:56:02 -03:00
Jared 62b6659481 Merge pull request #3485 from mchandschuh/bug-3045-add-fxcop-analyzers-and-invariant-culture-helpers
Add FxCop analyzers and invariant culture helpers
2019-08-16 15:05:34 -07:00
Jared cd59e4082a Merge pull request #3448 from Martin-Molinero/bug-3444-subscriptionfrontiertimeprovider-skips-time-step
SubscriptionFrontierTimeProvider will advance new subscriptions
2019-08-16 14:23:23 -07:00
Michael Handschuh c7df4e9fb3 Add StringExtensions and Parse utilizing CultureInfo.InvariantCulture
Adds static methods of the form Parse.<TypeName>(string str) that use
CultureInfo.InvariantCulture. These are to be used when parsing strings.
It's still safe (from the CA1304/CA1305 perspective) to use the ToDecimal
extension method for decimals.

Adds string extension methods for common operations that will now require
CultureInfo.InvariantCulture. These are to be used when converting values
to strings, such as ToStringInvariant()/ToStringInvariant(format), but also
useful for searching within strings, StartsWithInvariant, EndsWithInvariant
 and IndexOfInvariant.
2019-08-16 18:08:28 -03:00
Michael Handschuh 703f915182 Configure QuantConnect.ruleset in all projects
The initial ruleset is specifically aimed at addressing #3045. When we'd like
to start addressing other issues available via the FxCopAnalyzers, we can update
the action in QuantConnect.ruleset. A nice way to do it is to first set it to
warning, then go through the solution, project-by-project, fixing each warning.
At the end you can flip it to error and ensure it still builds. Moving forward,
any changes will fail if they violate the rule.

In support of #3045, we'll be configuring the following rules:
> CA1304: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1304-specify-cultureinfo?view=vs-2017
> CA1305: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1305-specify-iformatprovider?view=vs-2017
2019-08-16 18:08:18 -03:00
Michael Handschuh c42057809d Add Microsoft.CodeAnalysis.FxCopAnalyzers to all projects
FxCop has various rulesets for enforcing things within our codebase.
For this particular issue, we'll be enforcing CA1304 and CA1305 to
ensure we're always using an IFormatProvider or a CultureInfo where
applicable.

Linked Issue: #3045
2019-08-16 18:08:05 -03:00
Jared 48fab43550 Merge pull request #3491 from AlexCatarino/bug-3462-auto-filter-hasfundamental
Do Not Include Securities Without Fundamental Data When Performing Fine Fundamental Selection
2019-08-15 12:00:08 -07:00
Martin Molinero 4b1cb2c283 SubscriptionFrontierTimeProvider will advance new subscriptions
- `SubscriptionFrontierTimeProvider` will advance new subscriptions to find the current emit time of the enumerator. This will make enumeration more deterministic, since we will not skip any time step of the new enumerators.
- Adding a just in case flag to the backtesting `Synchronizer` to retry creating a new time slice when the time has not advanced but there is data in the slice, this could happen with subscriptions added after initialize using algorithm.AddSecurity() API, where the subscription start time is the current time loop (but should just happen once)
2019-08-15 15:46:07 -03:00
Jared 2227cf3da0 Merge pull request #3481 from gsalaz98/feature-3480-add-smartinsider-custom-data
Implements Smart Insider Alternative Data Source
2019-08-12 09:14:53 -07:00
AlexCatarino 6b28fc5f04 Do Not Include Securities Without Fundamental Data When Performing Fine Fundamental Selection
The engine will no longer try to look for fine fundamental files that does not exist.
Notifies the user that the algorithm should be handle the fine fundamental data filtering.
2019-08-09 23:31:47 +01:00
Martin Molinero 10fd48417b Adding new TimeSlice TimePulse
- `SubscriptionSynchronizer` will emit a `TimeSlice.TimePulse` before
performing any universe selection on each time loop. This will advance
`Algorithm.Time` which will allow universe selection data time and
`Algorithm.Time` to be aligned.
- Updating Regression algorithms that were using `algorithm.Time` in the
selection method.
- Coarse selection will start from the algorithms start date (not in the
next day)
- Adding regression algorithm
2019-08-07 14:45:39 -03:00
Martin Molinero cb4c574eeb Adjust algorithms statistics 2019-08-06 21:35:25 -03:00
Martin Molinero 0d6d66cd09 SPY default security benchmark
- Setting SPY as the default security benchmark
- The security benchmark subscription will be added at `UniverseSelection`
as an internal subscription. Using its own dedicated Security instance
which doesn't live in the algorithms.Securities collection.
- Reducing algorithms exposure to internal subscriptions
- `TimeSliceFactory` will prioritize higher resolution bars, when same
symbol is present twice (for non-internal subscriptionst)
- Adding regression test `CustomUniverseWithBenchmarkRegressionAlgorithm`
2019-08-06 21:15:33 -03:00
Gerardo Salazar 436a72f435 Implements SmartInsider custom data source
Implements Smart Insider data converter ToolBox application

Includes example algorithms demonstrating use of data
2019-08-05 13:42:08 -07:00
Martin Molinero 1983f36792 Allow Python selection to return unchanged
- We will now check if python selection method returned `Universe.Unchanged`
- Removing `ToList()` call on fine and coarse data before sending it to
the python algorithm
- Adding regression algorithms
2019-07-31 15:36:07 -03:00
Jared bfbdace989 Merge pull request #3427 from gsalaz98/feature-3426-yield-curve-alternative-data
Implement U.S. Treasury Yield Curve Alternative Data Source
2019-07-30 13:19:37 -07:00
Gerardo Salazar e3e3fc710a Add python example algorithm
Address reviews
2019-07-30 10:13:31 -07:00
Martin Molinero e322381dfa ConstantAlphaModel check Security.Price 2019-07-29 22:41:14 -03:00
Martin Molinero a4dfa708c5 Address reviews 2019-07-26 20:19:38 -03:00
Martin Molinero a79cc16b03 Add Kelly Criterion values
- New `KellyCriterionManager` will be used by the
`StatisticsInsightManagerExtension` to calculate and update the
`AlphaRuntimeStatistics` with the new Kelly Criterion values, on a daily
basis.
2019-07-26 19:16:36 -03:00
Gerardo Salazar d394251ac9 Implement U.S. Treasury yield curve alternative data source 2019-07-24 16:48:55 -07:00
AlexCatarino 966eaa8e10 Adds AccordVectorMachinesAlgorithm algorithm
This algorithm is an example on how to use Accord VectorMachines Learning.
2019-07-19 20:13:13 +01: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
Gerardo Salazar 2033c7873b Update outdated DotNetZip dependency in nuspec files 2019-07-02 18:02:23 -07:00
Jared 433edaa1d4 Merge pull request #3331 from Martin-Molinero/bug-2865-on-end-of-day-not-fired
Fix OnEndOfDay not fired - Undeterministic ScheduledEvent triggering
2019-06-21 09:10:34 -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
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
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