Commit Graph

1000 Commits

Author SHA1 Message Date
Jared 86807d3f04 Merge pull request #2298 from AlexCatarino/bug-2288-pythonnet-memory-leak
Updates pythonnet
2018-12-18 16:44:53 -08:00
Martin Molinero 75ffa300f1 Adding new IAlgorithm.AccountCurrency
- Adding new `IAlgorithm.AccountCurrency { get; }` that will point to the
`Portfolio.CashBook.AccountCurrency`. Setter will be added in a
following PR.
- Base `Brokerage` class will now have a `AccountCurrency { get }`
pointing to the `IAccountCurrencyProvider`. Will be used by the different
brokerages implementations.
2018-12-10 11:59:02 -03:00
AlexCatarino 823bb01438 Updates pythonnet
Includes memory leak fix (https://github.com/QuantConnect/pythonnet/commit/c6db86653e7fa4fa89e1f8404d72e346b67ed857 and https://github.com/QuantConnect/pythonnet/commit/bec9563d2958acc5adf3e8972b23609fe3914402)

- Fix python version to 3.6.6 (avoid updating to 3.7)
- Fix numpy version to 1.14.5 (tensorflow requirement)

- Adds py-earth python package (closes #2399).
2018-12-07 09:36:48 +00:00
Martin Molinero 8d5745319e Obsoleting Securities configurations properties
> This PR is a mechanical refactor, no behaviour changed

- Obsoleting `DataNormalizationMode`. Replacing the usaged by requesting
the `SubscriptionDataConfigs` to the new `SubscriptionDataConfigService`
> Note we still need to refresh the Security.DataNormalizationMode
property.
2018-12-05 10:41:21 -03:00
Martin Molinero 7d7ad17883 Obsoleting Securities configurations properties
> This PR is a mechanical refactor, no behaviour changed

- Obsoleting `IsFillDataForward`, `Resolution`, `IsExtendedMarketHours`
`Security` configuration properties. Replacing there usages by
requesting the `SubscriptionDataConfigs` to the new
`SubscriptionDataConfigService`
2018-12-05 10:05:53 -03:00
Martin Molinero 75f4ecaf54 Remove unused SubscriptionDataConfigs
- After removing a `Subscription` entirely, we will now also remove the
matching `SubscriptionDataConfig` from the `SubscriptionManager`
- Adding a new regression test, which fails in `master`
- Fixing previous PR change that removed `Trace` logging when adding
and removing a `Subscription`
- Fixing a bug in the `UserDefinedUniverse` where calling `RemoveMember`
would cause the `SubscriptionDataConfig` to be re added to the
`SubscriptionManager` (not the `DF`). Found this through added
regression test.
2018-11-15 11:35:31 -03:00
AlexCatarino 70e2ef9480 Changes the custom data type base class
By using the python object parant class, which is either `PythonQuandl` or `PythonData`, instead of `DynamicData`, the `AlgorithmManager.Stream` method can find a matching subcription data configuration used to create a data feed packet.

Closes #2694
2018-11-13 19:29:34 +00:00
Stefano Raggi 57d50c69c4 Fix XML documentation compiler warnings
- Fixed all warnings except for missing XML comments (CS1591)
2018-11-09 11:44:03 +01:00
Martin Molinero a288648929 Creating new ISecurityService
- Adding new ISecurityService and its implementation SecurityService.
Expose by SecurityManager.
This class will expose a method for creating new securities. The
SecurityManager is exposing this new interface, calling _securityService
internally, so Future/OptionUniverseSelectionModel.cs can use it
- Replacing all usages of SecurityManager.CreateSecurity for new
ISecurityService
- Modifying `Cash.cs` and `CashBook.cs` `EnsureCurrencyDataFeeds()` to
return newly added `SubscriptionDataConfig` instead of `Security`. This
will avoid using `Security.Subscriptions` at call site.
- Moving old SecurityManager.CreateSecurity into new
SecurityServiceTests.cs
2018-10-18 16:25:32 -03:00
Martin Molinero 5221999b88 Addressing reviews
- Some formatting, comments changes
- Removing SubscriptionManager from new FuturesChainUniverse constructor
- Making Option and Future properties in FutureChainUniverse and
OptionChainUniverse
2018-10-04 16:08:12 -03:00
Martin Molinero 7f1471000a Address reviews - Obsolete Constructors
- Adding new and obsoleting old constructors which received
SecurityInitializer as a parameter.
- Extracting the setting of Underlying security at UniverseSelection for
Option and Future chain universes.
2018-10-02 16:22:00 -03:00
Martin Molinero 2967776130 Refactor AddToUserDefinedUniverse
AddToUserDefinedUniverse will receive configuration settings as parameters.
2018-10-02 09:59:33 -03:00
Martin Molinero 4e424c4f19 Refactor UserDefinedUniverse, UniverseSelection
- Obsolete Universe.CreateSecurity, Universe.SetSecurityInitializer,
Universe.GetSubscriptionRequests(Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc)
- Adding new GetSubscriptionRequests() overload that will receive
instance which implementes new ISubscriptionService
- UserDefinedUniverse will stop using Security.Subscriptions
2018-10-02 09:59:23 -03:00
Martin Molinero d6f958b94a Rename to I...Service - Merge Create and Add 2018-09-28 14:48:21 -03:00
Martin Molinero d9f984a151 Remove unused AlgorithmSettings constructor parameter for SubscriptionManager 2018-09-26 14:08:48 -03:00
Michael Handschuh fdc866fda0 Reverting 'Merge pull request #2483 python-history-provider'
We didn't experience the expected performance improvements. Locally under
unit test there was aboout an order of magnitude throughput increase, but
when run against the history benchmark, this new approach was 60% slower.
We're reverting this for now to perform further analysis and better
understand the performance profiling of the python history stack.
2018-09-18 18:37:23 -04:00
AlexCatarino 5456f53545 Fix exception message: remove unrequired \ 2018-09-17 19:05:49 +01:00
AlexCatarino 8ac671d7ab Minor improvements
- Do not throw, but log, when a entry in the zip file does not exist. It can happen in trade bar data for options/futures since a given contract may only exist as quote bar.
- Verify whether the minimum requires arguments ("periods", "span" and "start") are present in the dictionary used to pass the variables.
- Adds doctring to History.
- Fixes type check for custom data.
2018-09-17 19:05:49 +01:00
AlexCatarino 3bc4d661c8 Implements Futures and Options support
Since futures and options have multiple entries in the zip file, we need to include the entry name in the request.
Futures have multiple open market periods during on trading day, therefore we need to apply a more complex mask to pandas dataframe index.
2018-09-17 19:05:49 +01:00
AlexCatarino aa078ec7d1 Implements Tick resolution support
- Removes HistoryRequest inheritance in PandasHistoryRequest
2018-09-17 19:05:49 +01:00
AlexCatarino 602644c65d Fix the implementation to support adjusted prices and non-regular market hours handling
- Adds unit tests.
2018-09-17 19:05:48 +01:00
AlexCatarino 3e4a71cd50 Creates QCAlgorithm.py: a bridge between C# QCAlgorithm and python algorithms 2018-09-17 19:05:48 +01:00
Stefano Raggi 04225dd691 Fix error getting account option holdings from brokerage 2018-09-13 13:01:41 +02:00
Martin Molinero 83897a7b88 Portfolio target percent respects FreePortfolioValuePercentage 2018-08-28 12:03:56 -03:00
Stefano Raggi b4a2536b86 AddOptionContract - throw if existing underlying equity not in Raw mode
Also added OptionChainProviderAlgorithm to regression test suite
2018-08-21 14:51:43 +02:00
Martin Molinero 17995f4c86 Adding a configuration for maximum data points per chart series. Limit will only apply for backtesting result handler 2018-08-17 18:14:33 -03:00
Martin Molinero fda1183222 Fix underlying security seeding at OnEndOfStep 2018-08-15 14:54:43 -03:00
Martin Molinero 6da57a1e12 Improving GetMaximumOrderQuantityForTargetValue 2018-08-03 16:26:14 -03:00
Michael 21a227eaae Merge pull request #2295 from AlexCatarino/bug-2293-python-custom-data-type
Fixes custom data type mismatch in python algorithms
2018-07-23 15:37:22 -04:00
Martin Molinero 2479768b7e Fix for null reference in TimeSlice.Create when calling HandleOptionData 2018-07-23 14:43:44 -03:00
AlexCatarino c3023825e0 Fixes custom data type mismatch in python algorithms
If the custom data type is a C# type, it should be used instead of wrapping it around a `PythonActivator` object.
2018-07-23 13:30:02 +01:00
AlexCatarino 4a1307d69f Revert logic removal in MarketOrder method. 2018-07-18 23:00:59 +01:00
AlexCatarino b6c6479b20 Refactors SetHolding to use MarketOnOpen for daily data
The logic to select the right market order type is moved to `SetHoldings`. If the market is closed or there is only daily data, a market on open order is placed.
2018-07-18 17:31:55 +01:00
AlexCatarino 8e3b7153b2 Rebase with pythonnet/master and fix datetime UTC bug
Updates pythonnet with pythonnet/master and fix datetime issue ([65ac279](https://github.com/QuantConnect/pythonnet/commit/65ac279a03dbded39fe3e28bb79c233f0c970f6f)).
2018-07-16 11:52:54 +01:00
Michael Handschuh f93704fbe0 Change RSI indicator helper to default to Wilders moving average 2018-07-06 06:08:04 -04:00
AlexCatarino e40a318f88 Fixes "object isn't callable" bug in Universe Selection
Reverse the order that a `PyObject` is attempt to be converted into a `Universe` object and a `Func`.
2018-07-03 17:19:03 +01:00
Michael e81e0bd507 Merge pull request #2180 from QuantConnect/bug-2161-setholdings-pending-market-orders
Fix SetHoldings not taking into account pending market orders
2018-07-02 11:26:19 -04:00
Michael 8ec32c58af Merge pull request #2176 from AlexCatarino/bug-2030-download-method-ambiguous-call
Fixes ambigous call bug for Download method
2018-07-02 11:18:10 -04:00
Stefano Raggi 5eae88f06b Show warning when defaulting to Equity in SetBenchmark 2018-07-02 11:31:24 +02:00
Stefano Raggi 7806466a24 Fix SetHoldings not taking into account pending market orders 2018-06-29 15:02:27 +02:00
AlexCatarino 4853e50dd2 Fixes ambigous call bug for Download method
Adds more overloads and remove the optional arguments.
2018-06-28 19:00:31 +01:00
Martin Molinero 82c2532a31 Improve performance for backtests with a large amount of trades 2018-06-21 16:59:29 -03:00
Stefano Raggi 535d8568c5 Fix non-deterministic query in QCAlgorithm.GetSubscription 2018-06-15 17:36:44 +02:00
Michael Handschuh bb21171943 Implements python Consolidate API
Collapse QuoteBar to TradeBar if trade bar handler specified
2018-06-12 13:17:49 -04:00
Michael Handschuh 007bcea6b8 Add Consolidate API
These new methods allow algorithms to quickly create, register, and
wire events on consolidators in a single line.
2018-06-12 12:58:28 -04:00
Michael 2f33dbdcf9 Merge pull request #2096 from StefanoRaggi/bug-2062-setsecurityinitializer-after-adduniverse
Make SetSecurityInitializer update security initializers in existing universes.
2018-06-08 14:02:18 -04:00
Stefano Raggi 86f0209a2d Add check if SetSecurityInitializer called more than once 2018-06-08 18:17:22 +02:00
AlexCatarino bcbe25fa79 Adds exception for StartDate greater than Today 2018-06-08 17:09:55 +01:00
Stefano Raggi 47e3668803 Require SetSecurityInitializer to be called during Initialize 2018-06-08 16:58:51 +02:00
Stefano Raggi a93817f790 Fix SetSecurityInitializer when called after AddUniverse 2018-06-08 16:10:46 +02:00