Commit Graph

55 Commits

Author SHA1 Message Date
AlexCatarino e92a40192d Implements UniverseSettings.DataNormalizationMode
Implements `DataNormalizationMode` field in `UniverseSettings` to enable the settings of a desired `DataNormalizationMode` to the securities that are chosen in Universe Selection.
2019-04-17 15:18:03 +01:00
Stefano Raggi b026813145 Fix SubscriptionManager.AddConsolidator for Resolution.Tick
Since subscriptions are enumerated in non-deterministic order, tick consolidators for multi-tick-type security types (such as Crypto, Future and Option) could end up being added to the wrong subscription, e.g. QuoteBarTickConsolidator added to a tick subscription with TickType.Trade. This was causing the Consolidated event handler to never be called.
The Resolution.Tick case is now handled properly, checking the subscription tick type.
2019-02-28 14:50:34 +01: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 d6f958b94a Rename to I...Service - Merge Create and Add 2018-09-28 14:48:21 -03:00
Martin Molinero 9ff55bd95e Applying style formatting to modified files 2018-09-28 12:00:44 -03:00
Martin Molinero 9d5351152d Adding new ISubscriptionDataConfigBuilder
- Adding new ISubscriptionDataConfigBuilder implemented by DataManager, exposed by
SubscriptionManager
- SecurityManager and SubscriptionManager will use new interface.
In a next PR, its intended for it to also be consumed by Universe.GetSubscriptionRequests().
- Moving LookupSubscriptionConfigDataTypes implementation into
DataManager
2018-09-27 18:09:08 -03:00
Martin Molinero 1c7e519776 Rebase from master - Refactor to reduce coupling
Refactoring previous commit so DataManager only keeps and receives a
reference to IAlgorithmSettigs, with the objective of reducing tight
coupling

Note: Investigate if IAlgorithmSettings.DataSubscriptionLimit should limit subscriptions or unique securities.
Today its using SubscriptionManagerSubscriptions.Where(x => !x.Symbol.IsCanonical()).DistinctBy(x => x.Symbol.Value).Count() @DataManager
2018-09-26 16:19:59 -03:00
Martin Molinero d9f984a151 Remove unused AlgorithmSettings constructor parameter for SubscriptionManager 2018-09-26 14:08:48 -03:00
Martin Molinero 0cf5cb6466 Adding new GetOrAdd() method for DataManager. This will allow us to always get the currently used SubscriptionDataConfig instance which will have any Consolidators if set. 2018-09-26 14:08:48 -03:00
Martin Molinero 953cc48997 Addressing reviews. Some renames and setting new interface IDataFeedSubscriptionManager for future work 2018-08-31 16:06:41 -03:00
Martin Molinero 41873b2315 Fixing unit tests 2018-08-31 16:06:41 -03:00
Martin Molinero a500fe010a Create DataManager class 2018-08-31 16:06:41 -03:00
Martin Molinero 6da57a1e12 Improving GetMaximumOrderQuantityForTargetValue 2018-08-03 16:26:14 -03:00
Stefano Raggi 18de62b091 Make SubscriptionManager thread safe 2018-06-06 13:50:21 +02:00
Michael Handschuh 99491a9ec7 Add IDataConsolidator.Dispose to remove event handlers
All consolidators now clear the event handlers list when being disposed.
In addition, SubscriptionManager.RemoveConsolidator will now dispose of
the consolidator before returning. This ensures the consolidator and any
downstream indicators that were attached to it can be properly cleaned
by garbage collection.
2018-04-03 14:59:10 -04:00
Michael Handschuh ff64a013f7 Add SubscriptionManager.RemoveConsolidator
This allows algorithms to remove consolidators at run time. This is especially
relevant with universe selection where we can add/remove securities at run time
and potentially be creating indicators as well. When the security is removed
from the universe we'll also want to remove any consolidators/indicators that
have been wired up as well.
2017-11-21 14:45:31 -05:00
Andrew 662c0511fe Switch order of default subscriptions type for crypto securities 2017-10-26 18:37:29 -04:00
jameschch@outlook.com dc24dd5296 Fixes crypto tick types 2017-09-06 14:08:47 +01:00
jameschch@outlook.com 3354ee2f71 Adds tick type trade for crypto 2017-09-06 13:27:06 +01:00
jameschch@outlook.com ca4cd13476 Merge branch 'master' of https://github.com/QuantConnect/Lean 2017-08-29 11:11:04 +01:00
Stefano Raggi 492bc70229 Fix Options and Futures subscriptions at Tick resolution
Previously Tick resolution subscriptions only received ticks with TickType.Trade, now TickType.Quote and TickType.OpenInterest are received as well.

This PR replaces PR #1065
2017-08-22 02:20:36 +02:00
12112 83fdf9c386 crypto wip 2017-07-14 16:53:42 +01:00
Stefano Raggi f812395eed Prevent duplicate entries in SubscriptionManager 2017-06-16 14:29:51 +02:00
Stefano Raggi 344dfd1b05 Fix AddConsolidator to support all input data types available
Futures and Options have multiple data types: QuoteBar, TradeBar and OpenInterest.

With these asset types only QuoteBarConsolidator could be used before, TradeBarConsolidator and OpenInterestConsolidator can now be used as well.
2017-06-08 18:39:25 +02:00
Stefano Raggi eb8bbcb027 Move default IB subscription limit to BrokerageSetupHandler 2017-05-24 00:24:44 +02:00
Stefano Raggi f84d6f915c Add DataSubscriptionLimit property to AlgorithmSettings 2017-05-23 02:08:13 +02:00
AlexCatarino 372823d2d7 Adds check for custom data existence after security removal 2017-05-02 17:34:17 +01:00
AlexCatarino e7a744a236 Adds HasCustomData flag to SubscriptionManager
This flag will be used to speed python algorithms execution, since it avoids a wrapping operation that is only required when there is custom data in python algorithms.
2017-05-01 14:47:17 +01:00
Stefano Raggi 8714518dd1 Set CFD default data type to TickType.Quote
This change is required to receive data in live mode.
2017-02-06 16:57:31 +01:00
Andrew Hart 709d5aef2c Lookup types in SecurityManager.CreateSecurity() when none provided 2017-01-12 15:56:00 -05:00
quant1729 46d254c1a6 Turned on the tradebar support for options, futures 2016-12-05 16:49:44 +01:00
Andrew Hart e5377bdd82 Options/Futures ChainUniverse uses AvailableDataTypes to create subscriptions 2016-11-23 15:25:58 -05:00
Andrew Hart c71a55f7a9 AvailableDataTypes is now part of SubscriptionManager 2016-11-23 13:42:55 -05:00
Michael Handschuh cc25950e10 Adds SubscriptionDataConfig.IsFilteredSubscription
Subscriptions can now be explicit as to whether or not a SubscriptionFilterEnumerator is to be applied.
Regular security price data subscriptions get filtered (user/market-hours)
Universe subscriptions don't get filtered (even if a subscription of equity price data, such as options underlying feeds)
2016-04-05 15:51:45 -04:00
snugs c5527d1b2c Use exchange time zone for security time keepers 2015-12-01 14:16:44 -05:00
snugs 95bfe729a8 Adds ExchangeTimeZone to SubscriptionDataConfig 2015-12-01 12:03:00 -05:00
snugs 43fc0a2d6d Cleans up some methods accepts Symbol, sec type/market 2015-11-19 20:16:03 -05:00
snugs 9e660ffcbe Remove usages of Symbol implicits from non-algorithm projects 2015-11-18 18:15:31 -05:00
snugs 3ad5540a8a Remove dependency on Security from SubscriptionDataReader
Add dynamic data flag to config
Remove dynamic data flag from Security
Rename dynamically loaded flag to IsCustomData
Remove Security from SubscriptionDataReader ctor
2015-09-15 15:40:12 -04:00
snugs e1938baafe Clean up using directives 2015-09-01 22:17:35 -04:00
snugs df79ce30c2 Adds the Symbol type
This includes updating all usages of symbol as a security identifier to use the new type.
The type includes a unique field, SID, as well as the current ticker's value. This allows
for consistent addressability while also allowing the ticker to evolve over time with the
mapping changes.

Effort was made to maintain compile and runtime backwards compatibility.
2015-09-01 22:17:10 -04:00
snugs 1a8feaeb60 Remove IsTradeBar/HasVolume from API methods 2015-08-12 14:54:17 -04:00
snugs 836cbbaa38 Remove IsTradeBar/HasVolume from sub data config 2015-08-12 14:43:23 -04:00
snugs c8c32b4838 Remove dependence on SubscriptionIndex 2015-08-06 17:52:22 -04:00
snugs 28d8300e46 Fixes failing tests
Beefs up the UpdateOrderRegressionAlgorithm/updates statistics
Now using TimeKeeper/LocalTimeKeeper for dissemination of time to algo classes
2015-07-09 17:19:40 -04:00
snugs 6bd38ece77 Adds international/timezone support
Time sync:
	* Data feeds are required to time sync in UTC time
	* TimeSlice.Time is now in UTC

IAlgorithm
	* Time is now exclusively the algorithm's local time zone
	* Added UtcTime
	* SetDateTime( DateTime ) accepts a UTC time and is internally converted

SubscriptionDataConfig
	* Adds market and time zone as required ctor parameters

SecurityExchange
	* Now passes most calls directly through to SecurityExchangeHours class

SecurityExchangeHours
	* Holds market hours for each day of week (LocalMarketHours)
	* Talks in terms of local times in the SecurityExchangeHours.TimeZone time zone

Data/market-hours/
	* New data folder to hold market hour information
	* Includes market-hours-database.csv to hold market hours per market/symbol/security (see doc in file)
	* Includes holidays-usa.csv to hold holidays for 'usa' market
		+ The holiday files follow the pattern 'holidays-*.csv' where * is the market

TimeKeeper
	* Receives updates in UTC time
	* Passes that to LocalTimeKeeper's who lazily evaluate the time in their respective time zones
	* Eventually this can grow to be the sole source of time in the algorithm's scope

MISC:
	* Fixes exception thrown when exiting LiveTradingDataFeed
	* Fixes exception thrown when exiting FileSystemDataFeed
	* Fixes exception thrown when exiting StatusPing
	* Simplify FillForwardEnumerator logic with GetNextMarketOpen
	* Adds many time zones, see TimeZones.cs
2015-07-08 18:45:34 -04:00
QuantConnect 26e8cf4a21 Rework liquidity provider & country code to generic Market class, commented out python buggy code 2015-06-18 20:18:51 -04:00
QuantConnect 0f9f30be91 Typo fix in liquidity data provider 2015-06-17 17:43:59 -04:00
QuantConnect 5a810690b4 Moved Equities to be grouped by country code, forex grouped by liquidity provider 2015-06-14 12:31:44 -04:00
QuantConnect fde0cbed3a Strip out block quote section header comments 2015-06-13 16:04:27 -04:00