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)
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.
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.
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.
When this was originally written, we were assuming one subscription per security.
This removes that assumption and tries to find subscriptions matching the request
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.