Commit Graph

52 Commits

Author SHA1 Message Date
Michael Handschuh 5ba44ed5ab Remove universe symbols from history requests
The engine defines securities for each universe to properly track them within
the data feed. These securities are not tradable and have no price data associated
with them, and as such, we should not be sending history requests for these symbols.
This change removes all universe symbols from history requests.
NOTE: Requests made directly to the history provider are not filtered out, as the
filtering happens within the QCAlgorithm implementation.
2018-03-05 14:18:33 -05:00
AlexCatarino 599c00be5b Historical Data Requests fetchs data from non-subscribed securities
It was not possible to add a security based on its historical data, since we needed to add the security before requesting its security data. Universe Selection algorithms are an example of such usage.
2018-01-16 18:08:28 +00:00
Jared 755a0f8ba7 Merge pull request #1475 from StefanoRaggi/symbol-null-comparison-fix
Fix bug in Symbol inequality operator
2018-01-15 17:15:26 -05:00
Stefano Raggi 89a59351cd Add OnWarmupFinished method to QCAlgorithm
This method is being added to allow algorithms to complete initialization tasks that cannot be executed during Initialize, such as cancelling existing open orders in live trading.
This method will be called only once, when the warmup task is complete.

Closes #1043
2018-01-15 13:46:30 +01:00
Stefano Raggi 1075571752 Replace Symbol.Empty checks with null checks 2018-01-12 21:56:10 +01:00
Maly-Lemire ba30b2c547 Merge branch 'master' into master 2017-11-29 21:12:16 -05:00
Maly Lemire 657d98fa59 Added SetWarmUp resolution parameter. 2017-11-29 20:57:41 -05:00
Andrew dcd6f478a0 Include the TickType in the HistoryPacket
Currently the HistoryRequest includes information regarding the tick type, but that information is not passed to the HistoryPacket. Therefore, only the common data types for a history request are returned for history requests. This is problematic for crypto history requests that specify Trade History.
2017-11-13 15:25:10 -05:00
Andrew 357c6c79c4 Lift History request restrictions on Crypto security types
Currently, Crypto security types are restrictied to history requests that return QuoteBars. This removes that restriction and allows Crypto securities to make TradeBar history requests.
2017-11-12 16:57:12 -05:00
Andrew bf3eadf0c9 Throw when History methods recieve Symbol.Empty
Often users will request History with a string instead of a Symbol. Because of the implicit conversion between Symbol and string, this only works if the ticker has been first added to the algorithm as a security using a method like AddSecurity(), AddEquity() etc. This commit checks for failed implicit conversions in History request and returns an error message to the user that should better enable users to debug what has gone wrong.
2017-11-01 15:13:16 -04:00
Michael Handschuh 0e4fc0f7fb Prevent security price seeding if no history provider
This appears to be causing exceptions in travis when running the automated
test suite. I'm still unsure why it's only failing on this branch and not
on the master branch.
2017-10-17 12:15:58 -04:00
Jared 72b66501eb Merge pull request #1131 from QuantConnect/crypto-security
Crypto security
2017-09-14 10:48:31 -04:00
Stefano Raggi c0fa78080a Fix security type test 2017-09-11 20:48:43 +02:00
Stefano Raggi f5d4c4a318 Enable security seeding for Options and Futures 2017-09-11 20:37:07 +02:00
Michael Handschuh 89c6a1a566 Remove multiple enumerations of enumerable
Depending on the IHistoryProvider implementation, this could result in
multiple history requests being sent GetLastKnownPrice function call.
2017-09-02 13:56:48 -04:00
jameschch@outlook.com 578efe843f Further changes for crypto type 2017-08-29 12:19:15 +01:00
12112 4be1b7b413 Merge branch 'master' of https://github.com/QuantConnect/Lean 2017-08-22 16:56:52 +01:00
12112 921ec8f983 merge from upstream 2017-08-22 16:56:35 +01:00
Andrew c82f31aa6a Use GetCommonTickTypeForCommonDataTypes to get default tick types for history requests 2017-08-22 11:17:07 -04:00
Andrew 08bb34a1eb Add TickType field to the HistoryRequest class 2017-08-22 09:42:42 -04:00
Andrew 6aa87b458c Added Security.IsCustomData method
This method is a convient way to check if the security has a subscription that represents custom data. It returns true if the security contains at least one subscription that represents custom data
2017-08-21 16:27:51 -04:00
Andrew 8a5af16051 Remove parameterless HistoryRequest constructor
This contractor was removed so that history requests do not assume any defaults - especially with exchange time zones and data time zones
2017-08-21 14:55:49 -04:00
Stefano Raggi 001183a917 Fix Warmup for Options and Futures
Warmup history requests for options and futures were only creating a single subscription for open interest (no trades or quotes).

Also some History overloads had the same issue.
2017-08-21 15:58:23 +02:00
Stefano Raggi 49b2240a73 Fix bug in security seeding when using Tick resolution
With securities added at Tick resolution the wrong data type was used for the seeding history request.
2017-08-09 17:58:38 +02:00
12112 83fdf9c386 crypto wip 2017-07-14 16:53:42 +01:00
Stefano Raggi b5c6af53c7 Fix Warmup/History requests for canonical symbols
CreateDateRangeHistoryRequests and CreateBarCountHistoryRequests were incorrectly including canonical symbols in history request generation
2017-05-05 15:07:13 +02:00
Stefano Raggi 2cbe2af4fd Remove redundant properties in HistoryRequest class
SecurityType and Market properties are already implicitly included in the Symbol property.

With this change we avoid forgetting to set these properties when creating HistoryRequest objects (issue #863)
2017-04-29 20:31:39 +02:00
Stefano Raggi 29da91847d Reuse LeanData.GetDataType in CreateHistoryRequest 2017-04-19 13:25:45 +02:00
Stefano Raggi f9de571521 Fix history request data type with Tick data and non-Tick resolution 2017-04-19 02:23:17 +02:00
Stefano Raggi dad6d3282d Replace Obsolete attributes with Error message for FX and CFD 2017-02-22 16:14:16 +01:00
Stefano Raggi ce38515446 Obsoleted History methods returning IEnumerable<TradeBar>
Non-generic history methods returning IEnumerable<TradeBar> have been marked as obsolete because they return an empty result when called with Forex and CFD security types.

The recommended replacements are their generic equivalents, using TradeBar or QuoteBar data type arguments, depending on the security type.
2017-02-20 23:53:49 +01:00
Jared 685c0c4c25 Merge pull request #758 from andrewhart098/history-request-by-sec-type
History request by security type
2017-02-20 12:26:44 -05:00
Andrew f1e38f8fe4 Added test to ensure QuoteBars are properly seeded 2017-02-20 12:17:26 -05:00
Stefano Raggi 8f3181e621 Fixed data type bug in CreateHistoryRequest
This method is returning typeof(TradeBar) instead of typeof(QuoteBar) for Forex history requests
2017-02-20 16:01:40 +01:00
Andrew b413f95b3c Set proper security type when seeding a new security price 2017-02-17 17:03:01 -05:00
Andrew Hart 544452853b QCAlgorithm.History.GetLastKnownPrice does not issue history request for Cacnonical securities
QCAlgorithm.History.GetLastKnownPrice sets the securityType on the history request.
2017-01-06 15:56:40 -05:00
Stefano Raggi 8af8a74a55 Use Minute as the minimum resolution in GetLastKnownPrice 2016-12-09 17:52:10 +01:00
Andrew Hart d81b436b30 Added BrokerageModelSecurityInitializerTests
Renamed ISeedSecurity GetLastData to GetSeedData

Renamed QCAlgorithm.History.GetSingleBarHistory to GetLastKnowPrice

Minor Style refactor
2016-12-01 11:55:48 -05:00
Andrew Hart 54df455813 Added ISecuritySeeder to seed security prices when securities are created
FuncSecuritySeeder implements this new interface and is used in BrokerageModelSecurityInitializer to seed new securities with a price when they are created. FuncSecuritySeeder uses a new method,  GetSingleBarHistory, in QCAlgorithm.History to get the last price from the history provider.
2016-12-01 08:37:04 -05:00
Michael Handschuh 591f6b2127 Use IBaseData in type constraints
Refactors existing consolidators, indicators, and helper methods to depend on
IBaseData instead of BaseData. These updates also defines an IBaseDataBar to
act as an abstraction point between TradeBar and QuoteBar.
2016-11-09 09:20:16 -05:00
Michael Handschuh a44ce9f2ab Remove single subscription assumption from history impl
When this was originally written, we were assuming one subscription per security.
This removes that assumption and tries to find subscriptions matching the request
2016-04-12 19:06:43 -04:00
Michael Handschuh 2ad63429b7 Memoize enumerables returned via the history API 2016-04-12 19:06:39 -04:00
snugs 2b3c3973c9 Fixes custom data history bug introduced via e4f9902 2015-12-02 15:37:33 -05:00
snugs 6c17128eed Adds QCAlgorithm.SetWarmUp alias 2015-11-23 20:13:42 -05:00
snugs 9e660ffcbe Remove usages of Symbol implicits from non-algorithm projects 2015-11-18 18:15:31 -05:00
Stefano Raggi 7687411f0b Fixed History bug with Security.Resolution=Tick 2015-11-17 12:18:41 -05:00
snugs 224366f734 Fixes tz bug in SetWarmup(barCount)
We were passing UTC to a function expecting algo tz -- long term should stop using DateTime :/
2015-11-03 14:36:57 -05:00
snugs d7520d2a6a Remove explicitly implemented IAlgorithm members
It seems the IronPython engine had a hard time resolving explicit interface
implementations, so we'll just remove the explcitness. It was originally provided
to coax algorithm writers to not directly use the provider due to its API.
2015-09-28 15:07:16 -04:00
snugs f3f27d8403 Prevent future history requests 2015-09-23 21:21:08 -04:00
snugs 6bf9cc0f2a Fix duplicate tz application in History API impls 2015-09-23 20:26:22 -04:00