Commit Graph

318 Commits

Author SHA1 Message Date
Michael Handschuh 063a11adac Merge remote-tracking branch 'origin/master' into feature-algorithm-framework 2017-12-12 14:06:46 -05:00
Michael Handschuh 36311be93f Remove ISignal, add Signal.GeneratedTimeUtc
This abstraction point is completely unwarranted. The signal object is really
just a DTO and it's extensible as it is currently defined. This also allows us
to enforce certain behaviors, such as internal set of GeneratedTimeUtc.

Removes GeneratedTimeUtc from the result object as it's now directly on the signal.
2017-12-12 11:57:03 -05:00
AlexCatarino 6d27c10e63 Sets Equity data to raw in option algorithms
In the options trading, the strike price, the options settlement and exercise are all based on the raw price of the underlying asset instead of the adjusted price.  In order to select the accurate contracts, we need to set the data normalization mode of the underlying asset to be raw.
2017-12-12 16:28:40 +00:00
Michael Handschuh cc3902de09 Set default benchmark to 2% per annum 2017-12-11 20:34:59 +01:00
Michael Handschuh 39f5080a40 Rename framework events to OnFramework<Event>
This more closely follows existing conventions.
2017-12-08 12:04:53 -05:00
Michael Handschuh c093b45319 Add IAlgorithm.SignalsGenerated event
This event will fire each time step that generates signals and will
include all signals generated by the algorithm at that time step.
2017-12-08 10:07:54 -05:00
Michael Handschuh 14a2a09581 Add explicit methods for updating framework models
IAlgorithm.FrameworkOnData is used to pulse models with new data each time step
IAlgorithm.FrameworkOnSecuritiesChanged is used to pulse models with security changes

These two functions need to be separate to ensure that if we add an indicator during
the securities changed event that it will get the data from the current time step.
This forces us to call the securities changed event before we invoke the consolidators
for the current time step.
2017-12-08 10:07:54 -05:00
Michael Handschuh 0591d45db2 Add QCAlgorithmFramwork w/ IPortfolioSelectionModel
Adds a default implementation of IPortfolioSelectionModel that creates a
universe using the securities explicitly defined by the user.
2017-12-08 10:07:53 -05:00
AlexCatarino 0efd3a0c48 Renames Fetch to Download 2017-12-04 22:20:19 +00:00
AlexCatarino 96562b335f Implements authentication headers 2017-12-04 21:25:41 +00:00
AlexCatarino a40ded1c14 Implements QCAlgorithm.Fetch method
Fetch wraps the WebClient.DownloadString method. It allows python users to fetch data from a uri without a third party python library.
2017-12-04 21:25:41 +00:00
Jared b34cedd646 Merge pull request #1311 from AlexCatarino/futures-quantbook
Implements historical futures data requests
2017-12-04 12:05:39 -05:00
AlexCatarino dfffbd6953 Adds IFutureChainProvider interface with base implementations
- Move BacktestingFutureChainProvider provider to Lean.Engine.DataFeeds along with its options equivalent.

- EmptyFutureChainProvider: provider that returns an empty list of symbols
- CachingFutureChainProvider: implements caching by date
- BacktestingFutureChainProvider: provider that gets chain from local files
- LiveFutureChainProvider: provider that gets chain from external source (empty list of symbols for now)
2017-12-04 14:16:59 +00: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
AlexCatarino 783d841a59 Changes AddData method return type
Unlike other methods used to add securities to the algorithm that return a Security or a derived object, AddData was returning void. This commit change it to return Security for consistency.
2017-11-16 14:41:08 +00:00
Stefano Raggi a24164ecec Refactor OrderProperties class to IOrderProperties interface
This change will make it easier to add other planned brokerage features:
for Interactive Brokers, besides Financial Advisor support, we will be adding IB algorithmic orders soon (PR #1203).
2017-10-26 18:22:11 +02:00
Stefano Raggi ddb3c7d33b Add DefaultOrderProperties to QCAlgorithm
The properties in the default instance can be modified by users duing Initialize.
These properties are always copied into all new orders submitted with any method available (Order, SetHoldings, etc.)
2017-10-26 18:15:08 +02:00
Jared ef9a841ae1 Merge branch 'master' into gdax 2017-10-13 21:43:19 -04:00
Michael Handschuh 7c0a0c4698 Set algorithm name in setup handler
When using the console setup handler, the algorithm's type name
will be used as an identifier.
2017-10-06 16:23:38 -04:00
Michael Handschuh ecd92462da Clean white space 2017-10-06 16:23:37 -04:00
jameschch@outlook.com 7fab872927 Integrates with crypto security 2017-09-15 13:42:51 +01:00
Jared 72b66501eb Merge pull request #1131 from QuantConnect/crypto-security
Crypto security
2017-09-14 10:48:31 -04:00
Stefano Raggi f94cb659cb Fix missing underlying security in AddOptionContract 2017-09-06 17:48:57 +02:00
jameschch@outlook.com 0f4e166499 Changes market deriving logic and adds extra test cases 2017-09-01 12:29:25 +01:00
jameschch@outlook.com 6c06413fe4 Moves existing bitfinex to crypto and updates crypto tests 2017-08-30 13:46:30 +01:00
jameschch@outlook.com ca4cd13476 Merge branch 'master' of https://github.com/QuantConnect/Lean 2017-08-29 11:11:04 +01:00
12112 921ec8f983 merge from upstream 2017-08-22 16:56:35 +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
Andrew cd94d4f507 Clear cache when security is removed 2017-08-15 18:03:05 -04:00
Stefano Raggi e379457757 Refactor option chain providers
- Moved provider implementations out of brokerages into their own classes
- Removed DefaultOptionChainProvider
- Added BacktestingOptionChainProvider and LiveOptionChainProvider
- Moved SetOptionChainProvider call from Engine to setup handlers
2017-08-02 22:43:15 +02:00
Stefano Raggi 8fdb79e578 Add OptionChainProvider to IAlgorithm/QCAlgorithm
- SetOptionChainProvider method
- OptionChainProvider property
2017-08-02 22:43:12 +02:00
12112 83fdf9c386 crypto wip 2017-07-14 16:53:42 +01:00
Stefano Raggi 5c270e620d Fix SetBrokerageModel resetting leverage when called after AddSecurity 2017-05-31 18:50:59 +02:00
Stefano Raggi f9fdd82b06 Time-based removal of option contracts from universe in live mode
Previously, removal of option contracts from the option chain universe was allowed only on date change (in both live and backtesting).

Now, in order to reduce market data subscriptions in live mode, removal is allowed intraday if the contract has been in the universe for at least 15 minutes. When backtesting, behavior is unchanged.
2017-05-24 22:23: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
Stefano Raggi 6d47ab94b8 Add AlgorithmSettings class and IAlgorithm.Settings property 2017-05-22 20:50:23 +02:00
Stefano Raggi 2fb4847b41 Handle subscriptions for existing brokerage Option holdings 2017-05-19 15:50:45 +02:00
Stefano Raggi 0fc2af8025 Handle existing brokerage holdings in Futures universe selection filters 2017-05-17 22:11:43 +02:00
AlexCatarino 372823d2d7 Adds check for custom data existence after security removal 2017-05-02 17:34:17 +01:00
AlexCatarino bb1c960fb5 Removes lock from AddData method
AddData method has a lock that prevents the subscription of new custom data after initialization.
2017-05-02 17:34:17 +01:00
jaredbroad f07748135e Merging updates from master 2017-04-29 17:38:06 -04:00
Stefano Raggi e1710e9031 Remove BaseData underlying symbol from Future symbol 2017-04-17 13:52:23 +02:00
Stefano Raggi a62fab742c Fix SetBrokerageModel when called after AddSecurity and friends
Currently, calling SetBrokerageModel after AddSecurity, AddForex, etc. has no effect, the security initializer has already been initialized and its models have been set to their default implementations.

For example, Forex backtests using OandaBrokerageModel will report fees calculated with the default fee model (Oanda fees are spread-based, so they should always be reported as zero).

In this PR, SetBrokerageModel now calls SecurityInitializer.Initialize on all securities added before SetBrokerageModel is called.

Fees will be calculated using the correct fee models and the order of the calls in algorithm Initialize is now irrelevant.
2017-04-07 15:40:24 +02:00
jaredbroad 0f40b0df05 Merge remote-tracking branch 'origin/master' into pythonnet 2017-03-26 10:14:03 -04:00
Stefano Raggi d4461bd473 Add method QCAlgorithm.SetTradeBuilder 2017-03-21 20:16:58 +01:00
AlexCatarino 914475e26d PythonWrappers namespacing to match the project/directory structure
- PythonWrappers namespacing to match the project/directory structure
- Adds null checks to SetHistoryProvider and SetRunTimeError
2017-01-12 18:12:59 -02:00
Andrew Hart d3d5baf3ad Changed signerature of SecurityManager.CreateSecurity() 2017-01-12 14:55:06 -05:00
AlexCatarino 74194d6aca Few tweaks:
- Uses QuantConnect.pythonnet nuget pachage
- Python file location loaded from config
- Remove unnecessary if-null in QCAlgorithm's SetHistoryProvider and SetRunTimeError
2017-01-12 14:21:39 -02:00