443 Commits

Author SHA1 Message Date
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
AlexCatarino 68fd8a4120 New Python Support Framework
Initial commit
2017-01-10 16:12:19 -02:00
Stefano Raggi a0dac817ef Revert commit cb8f451 2017-01-06 15:41:52 +01:00
Stefano Raggi cb8f451ebb Disable margin calls by default in live mode 2017-01-05 15:09:32 +01:00
quant1729 2df14b7d0d Merge branch 'futures' into master-merge-new-updates
Conflicts:
	Engine/Engine.cs
	Launcher/Program.cs
2016-12-02 12:43:46 +01:00
Andrew Hart d81b436b30 Added BrokerageModelSecurityInitializerTests
Renamed ISeedSecurity GetLastData to GetSeedData

Renamed QCAlgorithm.History.GetSingleBarHistory to GetLastKnowPrice

Minor Style refactor
2016-12-01 11:55:48 -05: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
Andrew Hart 54df455813 Added ISecuritySeeder to seed security prices when securities are created
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.
2016-12-01 08:37:04 -05:00
quant1729 92a3be5ea5 Merge branch 'futures-quotebar-easy' into futures
Conflicts:
	Common/Securities/SecurityManager.cs
2016-11-28 14:46:46 +01:00
quant1729 55299e60fb Added new constructors to IBMapper class
Added support for history requirements, exposed by vol models. AM processes requirements.
Added new volatility model - standard deviation of returns - default vol model. Compared its results with publicly available.
Refactored option pricing engine to support optimal approximation calculations.
Added basic greeks approximation in case they are not available in QL. Tests.
Updated BasicTemplateOptionHistoryAlgorithm to print greeks.
2016-11-25 15:11:01 +01:00
Andrew Hart e5377bdd82 Options/Futures ChainUniverse uses AvailableDataTypes to create subscriptions 2016-11-23 15:25:58 -05:00
Andrew Hart c71a55f7a9 AvailableDataTypes is now part of SubscriptionManager 2016-11-23 13:42:55 -05:00
Andrew Hart f78831d629 Forex now defaults to QuoteBar data feeds and is backwards compatible with TradeBars 2016-11-21 16:41:44 -05:00
Andrew Hart 21b3196991 Refactor AvailableDataFeeds to public field on IAlgorithm 2016-11-21 15:09:36 -05:00
Andrew Hart 81fe2a94cb Data formats (Trade/Quote) are configurable for each security 2016-11-18 15:30:54 -05: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
Stefano Raggi b6a96c38c1 Fix benchmark subscription when same symbol added later
This change handles subscriptions when adding/removing the benchmark symbol from OnData or in universe selection.
2016-10-17 23:41:12 +02:00
quant1729 a1c35422ea Added trading calendar supporting option expirations, future expirations, holidays, weekends. First cut. Tests. 2016-10-08 16:34:05 +02:00
quant1729 f89ea2183f Added real-time support for futures. Tested with IQFeed, IB. 2016-09-28 19:10:03 +02:00
AlexCatarino 183cb917fe Makes IAlgorithm Debug/Error/LogMessages a ConcurrentQueue
IAlgorithm DebugMessage, ErrorMessage and LogMessage are now ConcurrentQueue<string> instead of List<string> because List.Add is not thread safe.
Copying a list (using ToList()) at LiveTradingResultHandler while adding an element to it at QCAlgorithm caused a runtime error.
2016-09-27 14:02:28 -03:00
quant1729 dd72878d2c Implementing futures support. Future, FutureCache, Futures Chain, Futures Universe classes and more 2016-09-26 13:56:02 +02:00
Andrew Hart a8621ba99c Default security markets are specified in BrokerageModel.DefaultMarkets
The default value for the market parameter in AddForex, AddOption, AddEquity and AddCfd is null.  This allows unspecified markets to be set from the BrokerageModel.DefaultMarkets in the AddSecurity method for new securities added with these methods.  SetBrokerageModel updates BrokerageModel.DefaultMarkets and therefore the market used for all new securities.
2016-09-22 14:50:48 -04:00
AlexCatarino 82d81108ad Implements price variation models
Implements IPriceVariationModel interface which takes the security object and returns a decimal variation
Implemets SecurityVariationModel class: default implementation of IPriceVariationModel that returns a fixed value (read from symbol-properties-database) for decimal variation
Implemets EquityVariationModel class: implementaion of IPriceVariationModel that returns a decimal variation as a function of equity price
Implemets AdjustedPriceVariationModel class: implementaion of IPriceVariationModel that returns zero
Adds unit test
2016-09-20 15:36:04 -03:00
quant1729 0396841d82 - Added support for sourcing and caching the full symbol list from IQFeed website.
- Added IQFeed options support to toolbox: option chain universe, option symbol list, subscriptions, live prices
- Added LiveTradingDataFeed to support options live screaming
- Added IB live options trading support: trading orders, holdings, live option exercising
- Modified ISymbolMapper interface to support derivatives (options, futures)
- Fixed minor bugs with (introduced ealier) symbol changes for options
Tested with IQFeed version 5.2.4.2. IB TWS offline version 957.
2016-09-14 21:56:12 +01:00
quant1729 2dce74e26d - Extended Option security and Option holding classes
- Updated IB fee model to support option exercise
- Added support for splits for options. Not tested on real data yet.
- Added option exercise functionality for long positions. Unit Tests. Not tested on real data yet.
- Added option assignment functionality for short positions. Assignment event. Unit Tests.
- Added basic option assignment simulator for backtesting brokerage. Simulates assignments for deep ITM short positions close to expiration. Unit Tests.
2016-08-31 18:00:00 +02:00