* regression tests
* fix: apply the same time convertion to history request time as for data time
* ver2
* fixup
* unit tests
* do not need this conversion because RoundDownInTimeZone returns in proper TZ
* comment
* requested changes
* refactoring
* more refactoring
* fix existing test: should return Sunday if open
* more symbols
* fix existing tests: submit new btcusd data
* fix
* add Cfd symbol
- 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
Update test to the new crypto and equity subscriptions rules:
- Only consolidates trades
- Low resolution data are only trades.
Update and fix tests
Add missing minute sample files
Update Regression algorithms statistics
Changes `GetLastKnownPrice` logic to retry to get non-null data after a first attempt. Previously, it would return null in the first attempt and illiquid securities would not have valid data to set its market price. In the second attempt, we increase the look-back period to the equivalent of three trading days worth of data.
- Removes `UniverseSettings.DataNormalizationMode` (it will ne addressed in a dedicated issue: https://github.com/QuantConnect/Lean/issues/3082)
- Adds examples/tests for Tick resolution, Forex (QuoteBar data) and Custom data.
- Tick resolution is not allowed: logs a message
- Custom data example/test added in `CustomDataNiftyAlgorithm`
- Adds support for ATR and VWAP since they are, respectively, a bar and a trade bar indicator.
- Adds consolidators to handle difference between data resolution and indicator resolution.
This helper method can be used to warm up indicators individually whether it is created after the security has been added to the universe or before (universe selection scenario).
- Fix the subscription addition to `SubcriptionManager` when a History request is made before the security is created, since it should be not added.
- `IndicatorBase.Update` does not throw when an input is older than the last update. We only log (adds QuantConnect.Logging dependency to QuantConnect.Indicators) the error and discard the addition. Removes unit test for that exception.
- `TextSubscriptionDataSourceReader` will now cache raw price mode data
points for each requested local source file, per data type.
Caching will be handled by the `MemoryCache` class.
- `GetLastKnownPrice()` will not `RoundDown` end time. This was causing
it to fail to fetch a data point in some cases.
- Adding new `HistoryRequestFactory` class. Will provide some methods to
facilitate the creation of new `HistoryRequests`. Moving
`CreateHistoryRequest` and `GetStartTimeAlgoTz` into the new
`HistoryRequestFactory`. And consolidating `GetStartTimeAlgoTz` and
`GetStartTimeAlgoTzForSecurity`.
> 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`
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.
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.
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
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.
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.
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.
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.
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
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.
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)