Commit Graph

648 Commits

Author SHA1 Message Date
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 1494603cf8 Add missing checks to python regression test 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
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 73a1a319fa Merge pull request #3379 from AlexCatarino/pr3368
While-lists Python Libraries
2019-08-14 16:05:11 -07: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
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 26bc0f9b0b Add symbol to USTreasuryYieldCurveRate so that we can index inside algos
Update USTreasuryYieldCurveRate python algorithm
2019-07-30 10:53:33 -07:00
Gerardo Salazar e3e3fc710a Add python example algorithm
Address reviews
2019-07-30 10:13:31 -07:00
Jared d61a693371 Update readme.md 2019-07-30 09:06:49 -07:00
AlexCatarino 0b0a1b31ff Refactors PythonIndicator
In order to provide full Lean Indicator functionality to python custom indicators, they need to inherit from a C# class. `PythonIndicator` will serve for this purpose.
Algorithms can use the former version (no inheritance).
2019-07-26 00:35:57 +01:00
AlexCatarino 84d548b5f2 Adds Custom Python Indicator Support for QCAlgorithm.PlotIndicator
In order to add support custom python indicators for `QCAlgorithm.PlotIndicator`, we created a `PythonIndicator` class that wraps the custom python indicator. In `QCAlgorithm`, the reference of the wrapper is saved into a dictionary keyed by the python indicator handle.
2019-07-23 22:02:33 +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
AlexCatarino cdca13a6f6 Creates Unit Tests for Python Packages
Verify whether python packages can ne imported and used with unit test instead of algorithm
2019-07-09 23:33:33 +01:00
Daniel Chen c5e1335e9d More Appropriate Modifications 2019-07-09 11:23:44 -07:00
Daniel Chen 20176eaaf1 Small Changes 2019-07-09 09:05:27 -07:00
Daniel Chen 9d20cf0e7a Add More Comments and Do Modifications
Add More Comments and Do Modifications for the 5 ML Algorithms.
2019-07-09 08:58:52 -07:00
Daniel Chen 6e76f5742d Add new machine learning demonstration algorithms 2019-07-05 14:10:29 -07:00
Gerardo Salazar 9aaf544d28 Fix wrong class name for python SECReportDataAlgorithm 2019-06-21 16:09:25 -07: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
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
Jack Simonson 7793033c32 Changes made to CS file too 2019-05-24 16:18:08 -07:00
Jack Simonson f2f732b614 Removed references to FrameworkBridgeAlgorithm, but kept essential points about adding EmitInsights 2019-05-24 16:04:30 -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
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 2f46e708a1 Merge pull request #3184 from Martin-Molinero/refactor-3183-remove-backtestingtransactionhandler-thread
Removing BacktestingTransactionHandler thread
2019-05-17 07:22:24 -07:00
Jack Simonson ec9b1170f3 Changes to start and end dates so open source project data can be used 2019-05-16 09:25:27 -07:00
Jack Simonson 4c1f147acf Changes based on review by Alex 2019-05-16 09:16:44 -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
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
Jack Simonson da6424b5cc Update TriangleExchangeRateArbitrageAlpha.py 2019-05-08 10:54:11 -07:00
Jack Simonson f63efbe6fa Update TriangleExchangeRateArbitrageAlpha.py
Updated code in symbol check -- data.Bars.ContainsKey() needs to take string argument
2019-05-08 10:24:17 -07:00
Chris Auld d8772051b2 Removed dependencies on PTVS
File had hard-coded references and calls to Python Tools for Visual Studio. This PR removes these.
Algorithm tested and runs in online QuantConnect deployment of LEAN.
2019-05-06 03:11:35 +08: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
Jared 26576c94f9 Merge pull request #3138 from linkliang/mono-config
Fix System.DllNotFoundException: python3.6m for mac&python users
2019-04-26 13:22:15 -07:00
linkliang e4458f94f3 refine readme.md 2019-04-26 10:33:19 -07:00
Stefano Raggi 74fcb8da93 Fix invalid currency pairs in G10CurrencySelectionModel 2019-04-25 21:47:32 +02:00
linkliang fbe42d27f6 add documentation for mac mono config issue 2019-04-25 08:11:24 -07:00
Jared fcf3558e94 Merge pull request #3122 from QuantConnect/feature-3117-update-pythonnet
Updates pythonnet to 1.0.5.20
2019-04-24 09:14:20 -07:00
Martin Molinero ac53e2a790 Rebase from master. Adding missing Python algo 2019-04-24 11:05:15 -03:00