Commit Graph

49 Commits

Author SHA1 Message Date
Gerardo Salazar 25f7ccf0c2 Performance improvements 2020-12-06 19:15:38 -08:00
Martin-Molinero 4a0fb30df5 Fixes for OpenInterest storing (#4712)
- Fix Slice.Get OpenInterest type. Adding unit test
- Fix for SecurityCache that wasn't storing OpenInterest types
- Updateing regression tests to covere these usages
2020-09-11 15:28:27 -07:00
Martin Molinero 3e09d2f3c9 Adding new ReferenceWrapper
- Adding new ReferenceWrapper for structs, value types, to avoid thread
  race conditions while reading and writting. In C# reference type
  assignments are atomic, so it allows us avoid using locks.
2020-04-30 19:56:15 -03:00
Martin Molinero 7989d41aa7 Fix SecurityCache OHLC data type
- Fix for Equity SecurityCache OHLC default data type to be used. Will
  ignore QuoteBars
2020-04-08 19:31:37 -03:00
Martin Molinero 4eac5e4142 Add comment in Slice.cs
- Add a comment in Slice.cs about temporary patch until GH issue 4196 is
  fixed
2020-04-07 11:30:41 -03:00
Martin Molinero 5671a3293a Slice dynamic accessors ignore Quote for equities
- Slice dynamic data accessors will ignore QuoteBars and
Ticks TickType.QuoteBars for equities. This is to make slice dynamic
accessors deterministic and avoid breaking backwards compatibility when
adding QuoteBars for equities.
2020-04-06 10:33:02 -03:00
AlexCatarino 64b78df045 Addresses Peer-Review
- Fixes:
 - `Slice.GetValues`
    Not returning the `Value` but the `KeyValuePair`
 - `ExtendedDictionary.update(PyObject)`
    Paramenter type should be `PyObject` not `PyDict`
- Adds unit test for `update()`
- Fixes `OrderListHash` of `PythonDictionaryFeatureRegressionAlgorithm` test.
2020-04-01 16:15:05 +01:00
AlexCatarino 2c0d7e9ebe Implements Logic in ExtendedDictionary.this[string]
And removes it from chidren implementation.
2020-04-01 16:15:05 +01:00
AlexCatarino 27d31b7846 Renames BaseDictionary to ExtendedDictionary
Changes the return type of `keys()` and `values()` methods to `PyList`. Since `Keys` and `Values` return `ICollection` in some cases, the Python type was not consistently of `list` type.
2020-04-01 16:15:04 +01:00
AlexCatarino a59bd17fb9 Adds BaseDictionary That Implements Python Dict Methods
`BaseDictionary` is an abstract implementation of `IExtendedDictionary` keyed by `Symbol` that implements Python `dict` methods. `Slice`, `DataDictionary`, `SecurityManager`, and `SecurityPortfolioManager` derives from it in order to behave like Python `dict`.
2020-04-01 16:15:04 +01:00
Martin Molinero 07a4285baf Test approach 2020-04-01 16:15:04 +01:00
AlexCatarino c1e18f82bb WIP 2020-04-01 16:15:04 +01:00
Martin Molinero b28f9f501a Refactor and fix Slice bugs
- Fixing Python slice enumeration which would not happen when custom
data was present. Adding unit test
- Fix Slice constructor which would fail to create data collections due
to relying on non-deterministic 'slice._data'. Adding unit test
- Improving custom data retrieval for symbols which have more than 1
data type in a slice. Adding unit test
- First step refactoring slice internally, no behavior changed
2020-03-27 12:44:05 -03:00
Martin Molinero 2a2711d056 IndicatorWarmup fixes
- WarmupIndicator will be able to determine the correct type to use
- Fix bug in `History.GetMatchingSubscriptions()` which would use the
same TZ for exchange and data. Covered by regression algorithm.
- Consolidate will only infer `TickType` from `T` is not abstract
- Adding regression algorithm
- Slice will expose `Get(Type)` to get data by type, adding unit tests
2020-03-25 18:52:48 -03:00
Jared 57010f2eee Revert "Slice[Symbol] return type order" 2020-03-11 19:14:16 -07:00
Martin Molinero 05fc9a5006 Keep track of types and always return based on the same order
- SymbolData at Slice will keep track of the types it has and GetData
will always return in the same order, TradeBars, QuoteBars, Tick, Custom
- Fixing slice.Get(type) for custom type which relied on insertion order
- Updating regression test
2020-03-11 22:13:34 -03:00
Martin Molinero 0f595efa1f Performance improvements
- Only define `DEBUG` is `SelectedOptimization` is not defined
- `DynamicSecurityData` will Keep a cache of the generic types
- Avoid using so much linq at `Security.Update()`
- `Slice` will also keep a cache of the generic types
2019-10-09 11:46:21 -03:00
Martin Molinero 0b9862a7a7 Fix for PythonSlice 2019-10-02 23:22:52 -03:00
Martin Molinero 57a0934e78 Reduce dynamic usage 2019-10-02 20:03:44 -03:00
Martin Molinero ec203be632 Self review - improvement 2019-10-02 18:25:20 -03:00
Martin Molinero a349f619a0 Add Slice.Get(Type) for python
- Adding `Slice.Get(Type)` and `Slice.Get(Type, Symbol)` for python use case
- Adding unit tests
2019-10-02 18:19:44 -03:00
Michael Handschuh d709d1c4e0 Update Common to respect CA1304 and CA1305
Updates all occurrences of parsing/ToString-ing to go through the new
StringExtensions methods that use CultureInfo.InvariantCulture

See #3045
2019-09-12 14:13:24 -04:00
Stefano Raggi 5d90a3ef87 Fix generic Slice.Get to handle TradeBar and QuoteBar for the same symbol 2019-01-23 11:45:06 +01:00
Martin Molinero ff5e888313 Fix for delisted subscription data being sent 2018-07-18 09:45:13 -03:00
Stefano Raggi 0c30fd84bc Generalize data type used in Slice.GetKeyValuePairEnumerable 2018-05-02 20:49:05 +02:00
Stefano Raggi 311703dba4 Fix RuntimeBinderException when enumerating Slice with tick data
Closes #1949
2018-05-02 17:34:40 +02:00
quant1729 3819561a82 Merge branch 'futures' into master-futures-merged
Conflicts:
	Common/QuantConnect.csproj
	Tests/RegressionTests.cs
2016-12-01 17:32:40 +01: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
quant1729 1141cd21e6 Merge branch 'futures' into master
Conflicts:
	Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj
	Algorithm/QCAlgorithm.cs
	Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
	Common/QuantConnect.csproj
	Common/Securities/Option/Option.cs
	Data/equity/usa/factor_files/aapl.csv
	Data/symbol-properties/symbol-properties-database.csv
	Engine/DataFeeds/Enumerators/Factories/BaseDataSubscriptionEnumeratorFactory.cs
	Engine/DataFeeds/Enumerators/Factories/OptionChainUniverseSubscriptionEnumeratorFactory.cs
	Engine/DataFeeds/SubscriptionDataReader.cs
	ToolBox/QuantConnect.ToolBox.csproj
2016-11-07 16:18:11 +01:00
quant1729 80e20788b0 Added FutureChains property to Slice class 2016-10-03 19:55:28 +02:00
quant1729 f89ea2183f Added real-time support for futures. Tested with IQFeed, IB. 2016-09-28 19:10:03 +02:00
Michael Handschuh bf7f8bc72d Adds QuoteBars/OptionChains to Slice 2016-04-07 13:39:28 -04:00
jameschch@outlook.com 0ae38360b3 Fix for History<Tick> 2016-03-03 21:41:37 +00:00
snugs a5dd738a52 Fixes bug in Slice ctor HasData 2015-12-09 13:32:32 -05:00
snugs 4f73c7ecea Make Slice DataDictionary lazy eval 2015-12-07 12:02:16 -05:00
snugs ef4e3f5ab5 Clean up warnings from bad pragma comments 2015-11-19 19:46:36 -05:00
snugs d9dcd9b9aa Clean up Obsolete compiler warnings 2015-11-18 13:31:29 -05:00
snugs 7b6c82841f Initial implementation of SecurityIdentifier 2015-11-12 13:55:42 -05:00
snugs c67ff638f4 Renames Symbol.SID to Symbol.Permtick
Coming soon we'll have a full SID system, so renames to make backwards compatibility easier
2015-09-20 23:14:53 -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 a21840e1ec Convert Slice to using new generic dict builder 2015-08-25 21:29:15 -04:00
snugs 4bc2092d8c Adds OnData(SymbolChangedEvents) handler 2015-08-25 21:22:43 -04:00
snugs 844a040be5 Initial impl of coarse universe selection
Adds concept of Subscription to contain everything a data feed needs in order to process  single data feed item
Moves preparation of all data to data feed thread, algo thread receives data in format it needs
QCAlgorithm.SetUniverse( func ) allows selection based on market/symbol/dollar volume/price
Remove laziness from Slice as optimization, no order by in real time handler
2015-08-06 17:52:23 -04:00
snugs 958da71995 Fixes bug in Slice.TryGetValue 2015-08-02 23:54:30 -04:00
snugs f4d1955da2 Delisting changes from review 2015-07-29 14:41:39 -04:00
snugs 2c1a00fa23 Implements Delisting events in the algorithm
This change adds OnData(Delisting data) event handler to the algorithm and is fired when a security gets delisted.
Likewise, when a security is delisted, data will stop being sent into the algorithm and if the algorithm has any
holdings then a MarketOnClose order is submitted at midnight on the last day of trading. If you require that the
algorithm does not sell its shares, then you must cancel the MarketOnClose order before close of trading.
2015-07-29 13:21:25 -04:00
snugs 3905276033 Fixes bug in Slice accessors 2015-07-03 16:58:42 -04:00
snugs 87554ecf0d Implements OnData(Slice) and remove v1.0 event handlers
Also cleans up IAlgorithm interface of unused/old methods
Slice is a new type that contains all the data from a time slice to be sent into an algorithm
2015-07-03 15:15:15 -04:00