Commit Graph

861 Commits

Author SHA1 Message Date
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 fb12e79a1c Changes PandasConverter accessibility levels
Private field PandasConverter _converter is now public property PandasConverter.
With this change, we will be able to use it in QuantBook.
2017-12-04 21:38:39 +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
Michael 9b23180ec9 Merge pull request #1358 from Maly-Lemire/master
Added SetWarmUp resolution parameter.
2017-12-04 11:24:02 -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
AlexCatarino 4c982f37f9 Fixes CalculateOrderQuantity
Since we were not rounding off feeToPriceRatio, we were reducing order quantity more than needed in limit cases.
Fixes RegressionTests that were wrongly modified.
2017-12-04 14:04:27 +00:00
AlexCatarino 122ff90e23 Fixes CalculateOrderQuantity to handle decimal quantities
In quantity calculation, we didn't reduce the order quantity by decimal numbers, leading to a big step when dealing with crypto-currencies. For example, from 2.3456 it would drop to 1.3456 where values in between should've been tested.
2017-12-04 14:03:03 +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
Andrew dcd6f478a0 Include the TickType in the HistoryPacket
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.
2017-11-13 15:25:10 -05:00
Andrew 357c6c79c4 Lift History request restrictions on Crypto security types
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.
2017-11-12 16:57:12 -05:00
Jared 4da946fe6c Merge pull request #1269 from andrewhart098/symbol-tostring-no-subscription
When string cannot be converted into a symbol, log an error message
2017-11-01 15:22:24 -04:00
Andrew bf3eadf0c9 Throw when History methods recieve Symbol.Empty
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.
2017-11-01 15:13:16 -04:00
AlexCatarino b31e7e18a6 Adds support for Historical Requests of Custom Data for python 2017-11-01 12:43:06 +00:00
Jared dccbf635c8 Merge pull request #1264 from QuantConnect/ib-fills-fees
Add Financial Advisor support and Real Order Fees to IB Brokerage
2017-10-27 14:56:47 -04:00
Michael Handschuh 205b1cde3c Add QCAlgorithm.AddSeries method
Adding a scatter plot is an involved process because there's not
direct and easy way to just define a series object. This change
allows an algorithm to simply define the series without pumping
any data into it. This allows the user to set the series type and
the unit for the series
2017-10-27 00:04:03 -04: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
AlexCatarino c01470e1db Fixes PlotIndicator for python algorithms
Available PlotIndicator method overloads did not cover all the possibilities, so we now use PyObject as a pseudo-generic.
2017-10-24 20:24:52 +01:00
AlexCatarino c43a87d93e Enables Universe Selection Helpers in Python 2017-10-24 19:06:16 +01:00
Michael Handschuh 0e4fc0f7fb Prevent security price seeding if no history provider
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.
2017-10-17 12:15:58 -04:00
Jared ef9a841ae1 Merge branch 'master' into gdax 2017-10-13 21:43:19 -04:00
AlexCatarino 6fc55de371 Extends SetBenchmark to accept functions as paramenters in Python 2017-10-12 23:57:20 +01:00
Jared 73546cb8f0 Merge pull request #1200 from Jay-Jay-D/DetrendedPriceOscillator
DetrendedPriceOscillator indicator.
2017-10-12 18:18:30 -04:00
jjd df0714f5e2 Michael reviews. 2017-10-12 17:50:17 -03:00
Jared b78897c6cf Merge pull request #1198 from AlexCatarino/setsecinit-py
Implements SetSecurityInitializer for Python algorithms
2017-10-12 16:33:17 -04:00
AlexCatarino 9536123160 Updates pythonnet
In this update, we have changed our version of pythonnet to give precedence to methods that include a PyObject parameter.
2017-10-12 16:41:50 +01:00
jjd 354da79c04 DetrendedPriceOscillator indicator.
Small redudant code fix at CompositeIndicator.cs
2017-10-11 09:56:57 -03:00
AlexCatarino 994c47e55b Implements SetSecurityInitializer for Python algorithms
Creates a class that wraps a PyObject that represents a ISecurityInitializer object for the case where we use a class to initialize securities
Adds SetSecurityInitializer method that accepts a PyObject that may represent a method, a function or class that is used to initialize securities
2017-10-11 10:37:47 +01: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
AlexCatarino 58a7f0cf8a Moves ToFunc method from QCAlgorithm to Util/PythonUtil
ToFunc method is used to convert a PyObject that represents a method into a System.Func. Since this method will be used across different classes, we are moving it to PythonUtil class.
2017-10-06 16:44:53 +01:00
AlexCatarino 1346acf0cf Adds support for FilteredIdentity indicator for python
Also adds FilteredIdentityAlgorithm as a working example.
2017-10-05 12:12:45 +01:00
andrewhart098 8bc187f38e Merge pull request #1171 from AlexCatarino/pythonnet-update
Updates pythonnet nuget version
2017-10-03 17:07:06 -04:00
AlexCatarino b4313ad740 Implements SetBrokerageModel for python algorithms
Adds BrokerageModelAlgorithm to showcase the implementation
2017-10-03 00:17:34 +01:00
AlexCatarino 751a66a36a Refactors Custom Models for python
Moves custom model setters from QCAlgorithm class to Security class.
Modifies algorithm examples to reflect the change.
2017-09-29 22:56:52 +01:00
AlexCatarino 099e871afd Updates pythonnet nuget version
In this new nuget package, we have included two versions Python.Runtime.dll for macOS
We also add the instructions to compile pythonnet for different operational systems
2017-09-29 17:59:38 +01:00
AlexCatarino 9998e65df9 Adds support for custom models for python
Adds support for fee, fill and slippage custom modelling.
Adds CustomModelsAlgorithm to showcase the new feature
Modifies C# version of CustomModelsAlgorithm to match existing data in github
2017-09-28 16:47:58 +01:00
AlexCatarino b03c9daa6f Improves Custom Universe Selection
Covers the case where the Symbol of a custom data source is important.
Adds CustomDataUniverseAlgorithm python algorithm as an working example
2017-09-27 00:33:19 +01:00
AlexCatarino a082f930fa Adds support for Custom Universe Selection
Includes DropboxBaseDataUniverseSelectionAlgorithm python algorithm as an working example
2017-09-27 00:33:19 +01:00
AlexCatarino 3da8449fea Improves Universe Selection for python
In python algorithm using Universe Selection, the selector method should return a List<Symbol>. To make it more pythonic, we allow returning python list. The conversion is, then, performed in C# side.
2017-09-27 00:33:19 +01:00