Commit Graph

361 Commits

Author SHA1 Message Date
Gerardo Salazar b61377cd37 Adds demonstration Tiingo NLP Algorithms
* Adds `AltData` folder to Algorithm.CSharp|Python
2019-10-03 11:35:56 -07:00
Jared baeb8741fc Merge pull request #3654 from Martin-Molinero/bug-3652-tiingo-news-backtesting-time
Add TiingoNews.HistoricalCrawlOffset
2019-10-02 09:50:14 -07:00
Martin Molinero d1abefc1fe Add TiingoNews.HistoricalCrawlOffset - Rename
- Add `TiingoNews.HistoricalCrawlOffset`, timespan to add for
backtesting
- Rename:  remove `Data` from `TiingoNewsData` and rename `TiingoDailyData` to `TiingoPrice`
2019-10-02 13:11:31 -03:00
Martin Molinero 73eaa60785 SetBenchmark will check SymbolCache for ticker 2019-10-01 14:15:58 -03:00
Michael Handschuh 8c1867193b Add Security.Data => DynamicSecurityData
Provides dynamic access to cached security data keyed by the type's name.
For example, `security.Data.GetAll<Tick>()` would yield a list of ticks.
Likewise, using the dynamic accessors, `((dynamic)security.Data).Tick`
would return the same list. In C# you'll need to cast security.Data to
a dynamic. In python, all C# objects are viewed as dynamic, so python can
simply access `security.Data.Tick` directly.

See #3620
2019-09-30 13:31:56 -04: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 48e4d3660a Add unit tests for AddData for changes 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
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
Gerardo Salazar e6a510d803 Add Mapfile support for custom data sources 2019-08-20 16:56:02 -03: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 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
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 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
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
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 5b34e2519a Adds TradingEconomicsCalendarIndicatorAlgorithm
Adds C# and Python version of TradingEconomicsCalendarIndicatorAlgorithm to show how TradingEconomics data can be added to an algorithm.
2019-06-20 10:35:56 +01:00
Gerardo Salazar 2ad1f19f85 Implements Sec Custom Data, ToolBox Application, and Sample Algorithm 2019-06-17 16:45:53 -07:00
Martin Molinero 2c1cf0fa93 Address reviews
- Adding new regression test algorithm
- `SecurityPortfolioManager` will subscribe to the `CashBook.Updated`
event to invalidate the `TotalPortfolioValue
2019-06-07 17:51:30 -03:00
Jared a2a63ae058 Merge pull request #3016 from QuantConnect/feature-3015-add-weight-to-insights
Add Insight optional Weight
2019-06-04 16:52:48 -07:00
Martin Molinero 97c2889cc2 Fix Orders Placed in OnOrderEvent
- The `BacktestingBrokerage` will also verify there are no more pending
orders when deciding if it needs to continue scanning
2019-05-28 14:38:12 -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
Jack Simonson 21f0222fa8 Add template algorithms
Two demonstration algorithms showing how to incorporate Python into a C# algorithm and vice versa
2019-05-14 16:50:13 -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
Martin Molinero 968adcea32 Adding InsightWeightingPortfolioConstructionModel
- Adding new `InsightWeightingPortfolioConstructionModel` that will
generate percent `Targets` based on the latest active `Insight` `Weight` per
`Symbol`.
   - Will ignore `Insights` that have no `Weight`.
   - If the sum of all the last active `Insight` per `Symbol` is bigger than 1, it
will factor down each target percent holdings proportionally so the sum is 1.
- Adding unit tests
- Adding a new regression test framework algorithm
- Note most of the code, including tests, are reused from the
`EqualWeightingPortfolioConstructionModel`
2019-04-24 11:05:14 -03:00
AlexCatarino c3de660551 Updates pythonnet to 1.0.5.20 2019-04-23 23:15:14 +01:00
Stefano Raggi e5028e087f Remove usage of DateTime.UtcNow in buying power models (#3115)
Remove usage of DateTime.UtcNow in buying power models

In PR#3013 we added support for fee models with history, so the new changes to the GDAXFeeModel exposed this bug, breaking a couple of regression tests (issue #3044)

Update regression stats for EmitInsightCryptoCashAccountType

* Fix typos

Add missing time keeper in CashBuyingPowerModelTests
2019-04-23 07:38:39 -07:00
AlexCatarino 3c019cdbda Adds SmaCrossUniverseSelectionAlgorithm
This algorithm is an example for WarmUpIndicator method usage
2019-04-18 23:29:51 +01:00
Jared b7de35df78 Merge pull request #3100 from Martin-Molinero/performance-3096-add-stateful-stateless-coarse-universe-selection
Adding new Coarse performance benchmarks
2019-04-18 14:31:18 -07:00
Martin Molinero b5c216f7f3 Adding new Coarse performance benchmarks
- Adding stateless and stateful coarse universe selection benchmarks.
Will be used to benchmark future performance improvement.
2019-04-18 12:47:49 -03:00
AlexCatarino bd9f1c9154 Adds Regression Algorithm 2019-04-17 18:11:48 +01:00
AlexCatarino b366f5b2b5 Adds C# and Python examples 2019-04-09 17:59:46 +01:00
Jared d32d1bc90d Merge pull request #3066 from Martin-Molinero/feature-3065-adduniverseselectionmodel
Implement AddUniverseSelectionModel
2019-04-08 14:00:11 -07:00
Jared 16124d17f7 Merge pull request #3059 from AlexCatarino/feature-3058-python-manual-universe-selection-model
Implements the Python Version of ManualUniverseSelectionModel
2019-04-08 13:35:40 -07: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
Martin Molinero 4d108094e5 Implement QCAlgorithm.AddRiskManagement
- Implemention `QCAlgorithm.AddRiskManagement`
- Adding Py/C# regression test algoririthms
- Moving `CompositeRiskManagementModel` from `Framework` to `Algorithm`
project
2019-04-08 10:53:06 -03:00
AlexCatarino a0dce83b72 Implements G10CurrencySelectionModel
Implements `G10CurrencySelectionModel` as an example of a selection model with a fixed list of securities.
2019-04-05 23:16:46 +01:00
Martin Molinero 68d9f48c2d Address reviews
- Adding new `CompositeAlphaModel.AddAlphaModel()`
- Adding C#/Py regression algorithms using the new `QCAlgorith.AddAlphaModel()`
- Improving exception message
- Add python version of `QCAlgorith.AddAlphaModel()`
2019-04-05 18:34:18 -03:00